When you write expressions, it is common to assign the built-in time variable to an attribute so the attribute value predictably increases as the animation plays. It’s also useful to link an attribute’s value to the value of another attribute, such as setting the ball’s scale Y and Z attributes to equal the scale X value.
Ball.scaleY = 3 - time;
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 Maya’s 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 Ball’s scaleY attribute to time + 1, which equals 0.0417 + 1, or 1.0417. Because Ball’s 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.
Ball.scaleY = (time - 0.0417) + 1;