beautypg.com

Adobe After Effects CS4 User Manual

Page 655

background image

649

USING AFTER EFFECTS CS4

Expressions

Last updated 12/21/2009

Drag the pick whip to a property to create a link to the value of the property.

You can drag the pick whip to the name or value of a property. If you drag to the name of a property, the resulting
expression displays all the values as one. For example, if you drag the pick whip to the name of the Position property,
an expression like the following appears:

thisComp.layer("Layer 1").transform.position

If you drag the pick whip to one of the component values of the Position property (such as the y value), an expression
like the following appears, in which both the x and y coordinates of the property are linked to the y value of the Position
property:

temp = thisComp.layer("Layer 1").transform.position[1];
[temp, temp]

If the layer, mask, or effect that you drag the pick whip to does not have a unique name in its local context, After Effects
renames it. For example, if you have two or more masks named “Mask” on the same layer, and you drag the pick whip
to one of them, After Effects renames it “Mask 2”.

The format of expressions created by the pick whip is determined by the Expression Pick Whip Writes Compact
English preference (Edit > Preferences

> General (Windows) or After Effects

> Preferences

> General (Mac OS)). By

default, the pick whip creates compact English expressions, which use the names for properties as they appear in the
Timeline panel for the properties within an expression. Because these names are coded into the application and never
change, these expressions can work when After Effects is running in another language. Any property names that you
can change are enclosed in double quotation marks and remain the same in any language. If you don’t plan on sharing
your projects across languages, you can deselect this preference. This preference does not affect effect names or effect
properties.

Here is an example in compact English:

thisComp.layer("Layer 1").transform.position

Here is the same expression, not in compact English:

thisComp.layer("Layer 1")("Transform")("Position")

Note: Because the default is to use compact English, this document uses compact English in most examples and
illustrations.

1

Drag the pick whip to another property in the Timeline panel or Effect Controls panel.

2

Optionally, modify the default expression in the expression field.

Note: If you use the pick whip to create an expression to refer to a layer, and that layer has the same name as another
layer in the same composition, then the targeted layer’s name changes. The new layer name is the old layer name with a
numeral at the end. This change is necessary to ensure that the expression unambiguously refers to a single layer in the
composition.

This manual is related to the following products: