
ADOBE AFTER EFFECTS 7.0
User Guide
565
The default global object for any expression is the layer on which the expression is written. For example, if you add
an expression to the Scale property of Layer A and you want the expression to return Layer A’s Position property’s
values, you can use any of the following expressions, as they are equivalent:
t h i s C omp. l aye r ( " L aye r A " ) . p o s it i on
t h i s L aye r. p o s it i on
p o s it i on
To retrieve values from an object other than the layer containing the expression, insert the object in the expression.
For example, if you write an expression on Layer A and you want to retrieve position values from Layer B, use the
following expression:
t h i s C omp. l aye r ( " L aye r B " ) . p o s it i on
See also
“About animation and layer properties” on page 188
Arrays
An
Array
is a type of object that stores an ordered set of numbers. An Array is represented as a list of numbers
separated by commas and surrounded by brackets, as in this example:
[ 1 0 , 2 3 ]
You can assign an Array to a variable, making it easy to refer to Array values in other areas of the expression. For
example:
my A r r ay = [ 1 0 , 2 3 ]
The
dimension
of an Array is the number of elements in the Array. The dimension of
my A r r ay
is 2. Different
properties in After Effects have different dimensions depending on the number of value parameters they have. In the
expression language, properties’ values are either single values (Numbers) or Arrays.
The following table provides examples of some properties and their dimensions:
You can access the individual elements of an Array by using brackets and an
index
number to indicate which element
you want. The elements in an Array are indexed starting from 0. Using the previous example,
my A r r ay [ 0 ]
is
1 0
and
my A r r ay [ 1 ]
is
2 3
.
The following two expressions are equivalent:
Value type
Value dimensions
1D
Rotation ˚
Opacity %
2D
Scale [x=width, y=height]
Position [x, y]
Anchor Point [x, y]
3D
Scale [width, height, depth]
Position [x, y, z]
Anchor Point [x, y, z]
4D
Color [red, green, blue, alpha]
Summary of Contents for AFTER EFFECTS 7.0
Page 1: ...Chapter 1 User Guide...