2009

Table Of Contents
Beyond the lesson
In this lesson you learned how to:
Use conditional statements to control an expression.
You can accomplish many expression tasks with several if statements strung
after one another. However, using else statements instead of multiple if
statements makes an expression simpler to read.
If statements and else statements are two of the most common programming
features available in expressions. If youre familiar with programming, you
can write expressions with an extensive syntax similar to the C language.
For further information and related techniques, refer to the Maya Help.
Lesson 3: Controlling particle attributes
Introduction
You can use an expression to control attributes of particle objects. Particle
expressions can be more complex than other types of expressions. For example,
you can write an expression to control all particles in an object the same way,
or you can control each particle differently.
In this lesson you learn how to:
create a particle object
create a creation expression to set the initial color of the particles
create a runtime expression to control the color during playback
use a random function to randomize how the color changes
control the timing of an expression
Creating particle objects
In the following steps, youll create a particle object made of 100 randomly
positioned particles displayed as tiny spheres. Youll also dynamically add an
584 | Chapter 12 Expressions