Using Help | Contents | Index Back - Adobe AFTER EFFECTS 5.5 Help Manual

Table of Contents

Advertisement

Adobe After Effects Help
Using Help
|
Contents
Motion Math scripts use the Motion Math language, a simplified version of the C
programming language. You can write scripts in the Motion Math script editor, or you can
write them in any text editor and then load them into the Motion Math script editor. When
writing scripts in Motion Math, the language element menus help you more easily create
statements. See "Using the language element menus (PB only)" on page 329.
Note: To ensure that After Effects can properly run your script, make sure that the script's
file size does not exceed 32K.
Saving a script (PB only)
Once you have modified an existing script or written one from scratch, you can save it for
future use.
To save a script:
1 In the Motion Math window, click the Save button.
2 Type the name of the script you want to save. Scripts are saved with a .mm extension.
Controlling the built-in loop (PB only)
When writing scripts, note that Motion Math runs a script using a built-in loop, cycling
through it at a sampling rate you specify in the Motion Math window.
For example, if you type a Sample At rate of 15 samples per second, Motion Math runs the
script 15 times each second over the range of the selected work area. If the work area is 4
seconds, Motion Math runs the script 60 times, creating 60 keyframes for one or more
properties. Motion Math also includes a loop statement for use inside scripts so that you
can repeat a statement or series of statements more frequently than the sample rate.
The values of keyframes created by Motion Math are based on the values of variables at
the time of the sample. To base the values of keyframes on some other time, use the tmap
() function (see "Motion Math language reference (PB only)" on page 329).
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)" on page 331.
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;
Using Help
|
Contents
|
Index
|
Index
Using Motion Math (PB only)
Back
321
Back
321

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents