beautypg.com

Show expressions and the expression graph, Writing expressions for source text, Writing – Adobe After Effects CS4 User Manual

Page 657: Expressions for source text

background image

651

USING AFTER EFFECTS CS4

Expressions

Last updated 12/21/2009

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

8

From “

Property attributes and methods (expression reference)

” on page 677, 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.

More Help topics

The Graph Editor

” on page 211

Motion paths

” on page 223

Writing expressions for source text

The Source Text property of a text layer is interpreted by expressions as a JavaScript String. You can use the pick whip
to retrieve the source text from another text layer; however, only the style of the first character of the destination layer
is used.

For more information on the JavaScript String object, consult a JavaScript reference resource.

You can use

"\r"

in a string expression to start a new line of text. For example, to copy the original text from one layer

onto the same layer and repeat it in all uppercase characters on a new line, use the following expression:

text.sourceText + "\r" + text.sourceText.toUpperCase()

Adding a text layer to a composition and adding an expression to its Source Text property can be a great way to
examine the property values of other layers. For example, the following expression on a Source Text property reports
the name and value of the Opacity property for the next layer in the layer stacking order:

This manual is related to the following products: