2017

Table Of Contents
Expression Content
An expression is composed of numeric values, constants, channel references, or combinations of these used
with arithmetic operators. Expressions are calculated from left to right, according to a specific order defined
in
Operator Precedence (page 1248).
For example, the following expression contains channel references and multiplies the transparency value
of image1 by 2 to affect the transparency of image2 across all keyframes.
ExpressionChannel
image1.material.transparency* 2image2.material.transparency
Vectors
Certain channels such as Position, Rotation, Scale, and Shear are vector based since they represent 3D space
and include X-, Y-, and Z-axes. A vector contains three elements that represent the individual components
of the channel. Vectors are written using the convention (x, y, z) where x, y, and z represent separate scalar
values.
Expressions can either affect the components of a vector individually or collectively. For example, the
following expression sets the individual rotation for the x, y, and z axes to 30°, 45° and 90°, respectively.
ExpressionChannel
(30, 45, 90)axis1.rotation
The following expression sets the rotation for axis2 twice that of axis1, affecting the vector collectively.
ExpressionChannel
axis1.rotation* 2axis2.rotation
Functions
Smoke includes many predefined functions that can be used to perform calculations in an expression. You
pass function-specific values, called arguments, and they return another value back to the expression that
called it. A function call in an expression begins with the function name, followed by an opening parenthesis,
the arguments for the function separated by commas, and finally a closing parenthesis.
NOTE Function names are case-sensitive.
Arguments for functions can be either scalar values or vectors. When you use a function, make sure that
you pass it the correct type of parameter. See Function Reference (page 1249) for information on the arguments
and return values for each function.
You can nest function calls by using the return value of a function as one of the arguments of another
function. When a nested function is used as an argument, it must return a value that conforms to the type
and range that the argument requires.
You can define your own functions and use them in your expressions just as you would with any of the
predefined functions. See
Defining Your Own Functions (page 1269).
Advanced Animation: About Expressions | 1245