2010

Table Of Contents
When time equals 2 or more, the if condition is no longer true. The
statement that follows it, Balloon.scaleY = time, no longer executes. The
value of the scaleY attribute stays at the last value it had before time
became 2, specifically, 1.9583.
Recall that this example uses a frame rate of 24 frames per second. The
time and Balloon.scaleY have these values at various frames:
Balloon.scaleY (time)Time (seconds)Frame
000
0.04170.04171
0.08330.08332
0.1250.1253
1.01.024
1.95831.9647
1.95832.048
1.95832.0449
The if statements condition, (time < 2), is a comparison. The condition
must be surrounded by parentheses to isolate it from assignment that
follows it.
The < in the condition is a relational operator. A relational operator tests
how one value relates to another. In the example, the < tested whether
time is less than 2.
Besides the < operator shown in this example, there are several other
relational operators such as >, >=, ==, and so on. See the Maya Help for
more details.
9 Stop the animation and go to the start time. Balloon flattens again because
the scaleY attribute becomes 0 when you go to the start time. Time is 0,
so scaleY is 0.
636 | Chapter 12 Expressions