• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Going Further with MEL

Although the main focus of this chapter is to show you how to use MEL scripting to create character controls, you can do many other useful things with MEL. This section introduces you to some more advanced MEL scripting concepts that you can use to enhance your character controls and use to create custom tools that will enhance your Maya working environment.

Using Expressions with MEL

You can create expressions in your MEL scripts by using the expression command. Expressions can prove useful if you are trying to automate some of the character setup process. The -o or -object flag is useful if you are constraining multiple attributes on an object, because this flag enables you to state the object name only once, whereas the -s or -string flag is used to specify the actual expression connections. If you have multiple lines in your expression, make sure to place double quotes and curly brackets around all of them. Use the -n or -name flag to give your expression a name, which will then show up in the Expression Editor under the By Expression Name filter. To create the average expressions used in Chapter 4, “Character Skeleton Setup,” to constrain the torso to stay between the feet, for instance, you would run the following MEL code in the Script Editor:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint