2010

Table Of Contents
transform node of the particle object. If a particle objects transform node
is selected, move the mouse pointer to the scene view and press the down
arrow key to select the particle shape node.
2 Enter this expression and then click the Create button:
BubblesShape.rgbPP = <<1,0,0>>;
When you click the Create button in the Expression Editor, Maya checks
the syntax of the expression. Assuming you made no typing errors, the
expression executes once for each of the 100 particles.
The expression colors all particles in the object red. The double angle
brackets << and >> enclose a vector that sets the red, green, and blue
components of the rgbPP attribute to 1, 0, and 0. In the RGB color scheme,
this gives the object a red color.
If the particles are uncolored, check that youve turned on Shading >
Smooth Shade All. This shading mode is necessary for particles to show
the color assigned in an expression.
3 Play the animation. The particles remain red.
Using runtime expressions
There is one other type of expression you can create for a particle object (shape
node)a runtime expression. By default, a runtime expression executes each
frame during playback. A runtime expression does not execute when you go
to the start time (or at the time in which a particle is emitted).
Youll often create both types of expressions for a particle objecta creation
expression that initializes an attribute value in the first frame, and a runtime
expression that controls the attribute value in subsequent frames.
The following steps show how to create a runtime expression to change particle
color during playback.
646 | Chapter 12 Expressions