decorative banner

Assignments and operators (PB only)


    Assignments are the core of any Motion Math script, used to assign values or expressions to variables and create keyframes for specified properties. Create assignments using standard mathematical operators, such as the plus sign (+) for addition and the asterisk (*) for multiplication. Operators available in Motion Math are listed in Mathematical operators (PB only).

    Motion Math uses three types of assignments: those that assign a specific value to a variable, those that assign an expression to a variable, and those that create or modify keyframes. The following example shows the most basic type of assignment, which assigns a specific value on the right to a variable on the left:

    length = 2.1;

    Each assignment in Motion Math must end with a semicolon, which indicates that the assignment is complete.

    The second type of assignment assigns an expression to a variable, as shown in the following example:

    L1 = length * 10;

    The third type of assignment creates a keyframe by placing the value function or the effect_value function on the left. In the following example, the value function creates a rotation keyframe in layer 1 from the current value of the variable angle:

    value (layer1, rotation) = angle;

    For a description of the value function, see Layer property functions (PB only).