2010

Table Of Contents
The expression checks whether the value of time is less than two seconds.
If so, it does the assignment Balloon.scaleY = time. If time is not less than
two seconds, the assignment doesnt occur.
NOTE When you compare the value of time to a number in an expression,
Maya interprets time as seconds rather than milliseconds, minutes, or any
other unit of time. In the example, Maya interprets 2 as two seconds.
Notice how the assignment Balloon.scaleY = time has been formatted so it
appears indented under if (time < 2). Maya ignores all indentation, extra
spaces, and blank lines between statements. We used the indentation to
make the expression easier to read. You could have also written the
expression as follows:
if (time < 2) Balloon.scaleY = time;
This isnt as easy to read. Consistent, organized spacing is a good habit
to develop. This lesson attempts to show examples of good spacing style
whenever possible.
7 Click Create to compile the expression.
The ball flattens.
The expression executes when you click the Create button. Because the
animation is at frame 0, animation time is 0. Because time is less than 2,
Maya sets Balloon.scaleY equal to the value of time, which equals 0.
A scaleY value of 0 flattens the object in the Y dimension.
8 Playback the animation.
The flattened Balloons scale increases along its Y-axis. It inflates as the
animation plays.
At 2 seconds and thereafter, Balloon no longer inflates.
Creating a conditional expression | 635