beautypg.com

Show expressions and the expression graph – Adobe After Effects CS3 User Manual

Page 557

background image

AFTER EFFECTS CS3

User Guide

552

5

The element

thisComp

is a global attribute whose value is a Comp object representing the current composition.

To determine what can follow

thisComp

in your expression, look up the return value for

thisComp

under “Global

objects” on page 560.

Note that

thisComp

returns a Comp. Next, look at “Comp attributes and methods” on page 567 to see which

attributes and methods you can use with a Comp. One option is

layer(index)

. The index, or number, inside the

parentheses specifies the layer that you want to use. For this example, we assume that Solid 1 is the first layer in your
composition. To retrieve values from the first layer in the active composition, type

.layer(1)

at the end of the

expression, to get the following:

thisComp.layer(1)

6

Again, look at the expression elements reference to see that

layer(index)

returns a Layer. Look at “Layer

General attributes and methods” on page 570, and find the element you want to use. For example, if you want to
access the Position property’s values for the layer, type

.position

at the end of the expression to get the following:

thisComp.layer(1).position

7

From “Layer General attributes and methods” on page 570, you can see that the

position

attribute returns a

property. Look up “Property attributes and methods” on page 576 and notice that you can add a time factor to the
expression. To add a specific time, such as current time plus 2 seconds, type

.valueAtTime(time+2)

at the end of

the expression to get the following:

thisComp.layer(1).position.valueAtTime(time+2)

8

From “Property attributes and methods” on page 576, notice that the

valueAtTime

method returns a number or

Array. When an expression returns a Number, Array, or Boolean (true or false), you cannot add further attributes or
methods to the expression (if you want, however, you can add arithmetic operators, such as

+

,

-

,

*

, and

/

).

See also

“Using the expression elements reference” on page 559

Show expressions and the expression graph

In Graph Editor mode, the single expression field appears as a resizable text box at the bottom of the Graph Editor
and shows only the expression for the selected property. To show multiple expression fields simultaneously, the
Timeline panel must be in layer bar mode.

To toggle between layer bar mode and Graph Editor mode, press Shift+F3.

To show only properties with expressions, select one or more layers, and then press EE.

To show the expression field in the Graph Editor, choose Show Expression Editor from the Choose Graph Type
And Options

menu at the bottom of the Graph Editor. When you add a new expression to a property, the

expression editor is shown, regardless of this setting.

To resize the expression field, drag its bottom edge up or down.

To see how an expression changes the value or velocity graph, click the Show Post-Expression Graph button
while showing the value or velocity graph in the Graph Editor.

The dimly colored graph displays the value or velocity before the expression is applied, and the brightly colored graph
displays the value or velocity after the expression is applied. Turning on the graph overlay for the Position property
also changes the motion path display in the Composition panel so that you can see the expression-affected path.