2010

Table Of Contents
another attribute, such as setting the balls scale Y and Z attributes to equal
the scale X value.
Control multiple attributes with a single expression.
Your expressions can control multiple attributes of the same object or of
multiple objects. Alternatively, you can write a single expression for each
attribute or object.
For more information on the various mathematical operators that are
possible with expressions, refer to the Maya Help.
Behind the lesson
Although not shown in the lessons, you can decrease an attribute value during
playback by subtracting time from some number. Example:
Ball.scaleY = 3 - time;
This decreases the value of Balls scaleY attribute for the first three seconds of
playback.
When you use the predefined time variable, note the animation start frame
value. The lessons in this chapter use a start time of 0. In your work, you might
create an animation with a start time of 1. With Mayas default frame rate of
24 frames per second, time is 0.0417 at frame 1.
Because of this small time offset from 0, the prior lesson would have required
more steps and instructions to work with frame 1 as the start time. For instance,
suppose you use following expression with the start time at 1.
Ball.scaleY = time + 1;
If you go to the start time, the expression sets the initial value of Balls scaleY
attribute to time + 1, which equals 0.0417 + 1, or 1.0417. Because Balls scaleY
attribute was 1 when you created it, going to the start time sets scaleY to a
value 0.0417 larger than its initial value.
This discrepancy means the Ball scaleY is larger than its scaleX and scaleZ
attributes in the first frame of the animation. Although the difference is minor
in this example, other cases might be more significant.
To start your animation at frame 1 and get the same result as the example,
you can subtract 0.0417 from the attribute:
Ball.scaleY = (time - 0.0417) + 1;
When you go to the start time, the expression sets Balls scaleY value to (0.0417
- 0.0417) + 1. This equals 1, its original scaleY value.
Beyond the lesson | 633