2009

Table Of Contents
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.
Lesson 2: Conditional expressions
Introduction
Conditional statements set one attribute or variable for an expression based
on the condition of another attribute or variable. This means that when a
particular defined condition exists for one attribute then another attribute is
changed based on how the expression defines it to do so.
In this lesson you learn how to:
Use conditional statements to control an expression.
Refine the conditional statements using if and else statements.
Creating a conditional expression
In the following steps, you create a default sphere and write an expression to
increase its Scale Y attribute based on the animation playback time. In the
first two seconds of the animation time, Scale Y increases with the value of
the time. At two seconds and thereafter, Scale Y no longer increases.
To create an expression using conditional statements
1 Make sure youve done the steps in
Preparing for the lessons on page 566.
2 Create a NURBS or polygonal sphere at the origin with an X scale, Y scale,
and Z scale of 1.
3 Name the sphere Balloon.
574 | Chapter 12 Expressions