Chapter 6. Scripting MEL Character Controls

graphics/ch06.jpg

graphics/06inf01.gif

graphics/06inf02.gif

graphics/06inf03.gif

This chapter shows you how to create MEL-scripted character controls. MEL, or Maya Embedded Language, is the scripting language that creates the entire Maya interface. MEL scripting enables you to create a custom graphical user interface for animating your character. This is usually in the form of a floating window that contains a variety of character controls (see Figure 6.1). Inside the window, you create buttons that select various parts of your character, sliders that are connected to attributes on your character, and check boxes that turn on or off the visibility of your character's skin.

6.1. MEL-scripted character windows contain a variety of useful controls for animating a character, such as buttons, check boxes, and sliders.

graphics/06fig01.jpg

A MEL-scripted interface provides several advantages when animating your character. Such an interface is very intuitive to use, because all the controls can be clearly labeled, and written directions for their use can be included in the window. An animator doesn't have to remember whether a particular icon should be translated, rotated, or scaled, because all those specifications are inherently present in the MEL controls. In addition, because all the necessary limits are set into each MEL-scripted control, it is very difficult to break the rig when animating. In many cases, a character setup artist removes most of the normal menus and tools in Maya, and provides the animator with only what the animator requires to animate the character in the MEL-scripted window.

Another advantage of using a MEL interface is that it is generally faster to pose and set keys on your character with MEL controls than it is by keying iconic controls. The reason for this is that, when animating, it takes time to select your iconic controls, and it also takes time to change your active Transform tool. You can create a pose for your character by moving MEL sliders without having to select anything, and without having to change tools. To set a key on all of your character controls, you just have to click a single button.

One thing to keep in mind when using MEL is that it differs from other methods previously shown for controlling attributes. Unlike connecting channels, MEL controls do not constrain attributes in any way. When you assign a MEL slider to control an attribute on your character, for instance, the channel for the attribute does not turn yellow. The reason for this is that MEL controls are just an interface. They are not themselves an attribute that can be keyframed. When you set a key on a MEL control, it sets the key on the attribute it is controlling, not on the slider or button itself. The end result of this is that you can use both iconic and MEL controls on a character without them interfering with each other. Then the animator can choose to use one kind of control, or the other, or both.

Although most of this chapter focuses on creating a MEL-scripted interface for animating your character, additional uses of MEL scripting are presented toward the end of the chapter. You can use MEL scripting for a variety of purposes in Maya. More advanced uses, such as procedures and scripts that contain conditional statements, loops, and script jobs, are introduced.



Maya Character Creation. Modeling and Animation Controls
Maya Character Creation: Modeling and Animation Controls
ISBN: 0735713448
EAN: 2147483647
Year: 2003
Pages: 75
Authors: Chris Maraffi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net