beautypg.com

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

Page 676

background image

To the top

3. Select the Position property for Solid 2 and choose Animation > Add Expression or Alt-click (Windows) or Option-click the stopwatch

button for the property. The following expression appears by default:

transform.position

4. Type the following directly over transform.position:

thisComp

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, attributes, and methods (expression

reference).

Note that thisComp returns a Comp object. Next, look at Comp attributes and methods (expression reference) to see which attributes and

methods you can use with a Comp object. 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 object. Look at Layer General attributes and

methods (expression reference), and find the element you want to use. For example, if you want to get the values of the Position property 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 (expression reference), you can see that the position attribute returns a property. Look up

Property attributes and methods (expression reference) 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 (expression reference), 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 /).

Show expressions and the expression graph

In Graph Editor mode, the single expression field appears as a resizable 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.

You can use the search field in the Timeline panel to search expressions as well as other components of a property. If the search string
appears in an expression, the property and its containing property groups and layer are shown in the filtered set of search results.

672

This manual is related to the following products: