9

Expression Controller 321
Scene element Controller
Creation parameters Any numeric creation
parameter
Transforms
Position [X, Y, Z]
XRotation
YRotation
ZRotation
Scale [X%, Y%, Z%]
Modifiers Any numeric modifier
parameter (including
creation parameters)
Materials Colors [R, G, B]
Any n u m eric material
parameter
Note: Expression controllers can work only with
the individual XYZ components of Euler rotation.
You can’t assig n an expression to TCB Rotation or
other kinds of rotation controllers.
See also
Expression Techniques (page 1–146)
Expression Controller Techniques (page 2–324)
Tr igonometric Functions (page 1–150)
Vectors (page 1–151)
Pr ocedur es
To assign a constant value to a variable:
1.
Highlight the variable name in the Scalars or
Ve c tors l i s t .
2. Click Assign To Constant.
Anewdialogopens.
3. On the d ialog, enter the new value (or, in the
case of a vector, values) for the constant, and
then click OK.
To assign a controller to a vari able:
1.
Highlight the variable name in the Scalars or
Ve c tors l i s t .
2. Click Assign To Controller.
The Track View Pick subdialog is displayed,
show ing the track hierarchy. The dialog display
is similar to the Track View hierarchy.
3. Highlight the track for the variable to use, and
then click OK.
Ex ample: To create a n ex press ion that moves a
sphere in a precise circle:
1.
Create a sphere with Radius=15.0.
You’ll use Track View to create the Expression
controller.
2. Intheactiveviewport,right-clickthesphere
and click Curve Editor.
3. In the Hierarchy list, scroll down to the Object s
branch and, if necessary, expand Sphere01 the
branch so the s phere’s Position track is visible.
Click the Position label to highlight it.
4. In t he Hierarchy list, r ight-click the Position
label and then choose Assign Controller
The Assign Controller dialog opens.
5. Choose Position Expression from the list of
controller types, and then click OK.
The Expression Controller dialog opens.
Note: You can also open the Expression
Cont roller dialog with Track View > Cont roller
menu > Propert ies.
6. Replace the default expression by typing the
following position expression in the Expression
field:
[100*cos(360*NT), 100*si n(360*NT ), 0]
The expression specifies a circular path for the
sphere. NT is a variable that means normalized
time. Movement based on NT happens exactly
once per the active time segment, regardless of
how man y frames are in the animation.
7. Click Evaluate.