Specialized Animation Techniques ◾ 319
en we have written a simple MEL code fragment. It is: Knob.rotateY = (time *360).
Knob is the name given to the le knob. RotateY is the y-rotation attribute of the
knob. Time is a MEL keyword that represents the frame number divided by the frame
rate. All we have to do is hit Create in the lower le of the Expression Editor and then
run our scene.
(Another way to apply the expression to the knob is to right click on its Rotate attribute,
as seen in Figure11.46.)
Maya now provides some support for scripting using Python, a language that many
other animation applications, including Vue, Rhino3D, Poser, Blender, and Houdini, use.
The Rendering
We have manually keyframed the movement of the bolt into the door as it opens, as well as
the opening of the door itself. e nal frame is shown in Figure11.47. Note the position
of the knob.
A Note on Using the Outliner Window
Carefully building the scene hierarchy is what facilitated the rotation of the knob. e
Outliner window has been used to make
the bolt and the knob children of the door,
thus allowing the bolt and knob to have
their own independent motion, but to also
be constrained by the motion of the door.
USING MAYA EXPRESSIONS AND
VARIABLES TO ANIMATE MODELS
We will look at a couple of examples where
expressions can be used to animate an
object. en, we will look at a few useful
MEL system variables and at dening user
variables.
FIGURE 11.46 Knob expression.
FIGURE 11.47 Moved door and rotated knob.