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

Table of Contents

Advertisement

Adobe After Effects Help
Using Help
|
Contents
About vectors (PB only)
In Motion Math, vectors contain values for properties that require two or more dimen-
sions. For example, the Position property requires two dimensions: one for the x-
coordinate and one for the y-coordinate. A vector for the Position property contains values
for both dimensions, and is represented by the following format:
{x, y}
The x-coordinate specifies the number of pixels on the horizontal axis, and the y-
coordinate specifies the number of pixels on the vertical axis.
Likewise, a vector for a property involving color requires four dimensions, one for R, G, B,
and the alpha channel, as shown in the following example:
{133, 102, 54, 133}
In Motion Math, the maximum number of dimensions vectors can use is four.
Vectors as single variables (PB only)
A single variable can contain all the values of a vector and is treated as a vector. In the
following example, the variable P1 is a vector with two dimensions, assigned the values of
12 and 35:
P1 = {12, 35};
When assigning values in a vector to a variable, you must separate the values with
commas and enclose them with braces.
Using functions with vectors (PB only)
Functions that obtain values from properties with two or more dimensions obtain those
values in a vector. Motion Math automatically creates a vector with the appropriate
number of dimensions for any property with more than one dimension. In the following
example, the value () function obtains a position vector for the layer named box1 and
assigns it to the variable P1, which contains two values:
P1 = value (box1, position);
Using an index (PB only)
Use an index to assign or obtain a value for a specific dimension of a vector. An index is a
number in brackets following a vector that specifies a certain dimension. Numbering
starts at 0, so the first dimension is specified by 0, the second is specified by 1, and so on.
By using an index, you can vary one dimension while keeping the others the same. In the
following example, the value 35 is assigned to the second dimension (or y-coordinate) of
the position vector in the Knob layer, creating a keyframe:
value (Knob, position) [1] = 35;
In another example, the current value of first dimension (or x-coordinate) of the Position
property in the boat layer is assigned to the variable M1:
M1 = value (boat, position) [0];
In this example, the variable M1 contains only a single value.
In addition to using numbers to specify an index, you can use x and y with a two-dimen-
sional vector, as shown in the following example:
Loc2 = value (car, position) [x];
Using Help
|
Contents
|
Index
|
Index
Using Motion Math (PB only)
Back
327
Back
327

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents