The Expression Language - Adobe AFTER EFFECTS CS3 PROFESSIONAL User Manual

Hide thumbs Also See for AFTER EFFECTS CS3 PROFESSIONAL:
Table of Contents

Advertisement

Using Expression Controls effects
Use Expression Controls effects to add a control that you can use to manipulate one or many properties' values by
linking the property to the control using expressions. A single control can affect several properties at once.
You can apply Expression Controls effects to any layer; however, it is useful to apply them to a null layer, which you
can simply use as a controlling layer. You then add expressions to properties on other layers to take input from that
control.
For example, you can add the Slider Control effect to a null layer (Null 1), and then apply this expression to the
Position properties of multiple layers:
position+[0,10*(index-1)*thisComp.layer("Null 1").effect("Slider Control")("Slider")]
In this example, as you drag the slider, each layer with this expression will move. The layers with greater index
numbers (layers toward the bottom in the Timeline panel) will be shifted more than the layers with lower index
numbers, at 10-pixel intervals. You can set keyframes for the slider on the null layer, and all of the other layers will
animate accordingly.
You apply Expression Controls effects to a layer in the same ways that you apply other effects, such as dragging the
effect onto the layer from the Effects & Presets panel.
See also
"Create a null object" on page 162
"Apply an effect or animation preset" on page 350
Convert an expression to keyframes
In some situations, it may be useful to convert an expression to keyframes. For example, if you want to freeze the
values in an expression, you can convert the expression to keyframes and then adjust the keyframes accordingly; or,
if an expression takes a long time to evaluate, you can convert it to keyframes so that it renders more quickly. When
you convert an expression to keyframes, After Effects evaluates the expression, creating a keyframe at every frame,
and then disables the expression.
In the Timeline panel, select the property on which the expression is written and choose Animation > Keyframe
Assistant > Convert Expression To Keyframes.

The expression language

About the expression language
The After Effects expression language is based on JavaScript 1.2, with an extended set of built-in objects. After Effects
uses only the core standard JavaScript 1.2 language, not the web browser–specific extensions. After Effects contains
its own set of extension objects—such as Layer, Comp, Footage, and Camera—that you can use to access most of the
values in an After Effects project.
For more information about JavaScript, see a JavaScript reference manual.
When creating expressions, keep the following in mind:
• JavaScript is case-sensitive.
• Semicolons are required to separate statements or lines.
AFTER EFFECTS CS3
551
User Guide

Advertisement

Table of Contents
loading

Table of Contents