beautypg.com

Expression example: create a trail of images – Adobe After Effects User Manual

Page 707

background image

To the top

To the top

To the top

Expression example: Create a trail of images

This example expression instructs a layer to be at the same position as the next higher layer in the Timeline panel, but delayed by a specified
amount of time (in this case, 0.5 seconds). You can set similar expressions for the other geometric properties.

1. Start with two solid-color layers that are scaled to approximately 30% of the composition size. (See Solid-color layers and solid-color footage

items.)

2. Animate the position of the first layer. (See Motion paths.)

3. Select the second layer, press P to reveal the Position property, and Alt-click (Windows) or Option-click (Mac OS) the stopwatch button to

the left of the property name.

4. Enter the following in the expression field:

thisComp.layer(thisLayer, -1).position.valueAtTime(time - .5)

5. Duplicate the last layer five times by selecting it and pressing Ctrl+D (Windows) or Command+D (Mac OS) five times.

All layers follow the same path, and each is delayed 0.5 seconds from the previous.

Dan Ebberts provides more examples and techniques for creating trails of images on his

MotionScript website

.

Expression example: Create a bulge between two layers

This example expression synchronizes the Bulge Center argument of the Bulge effect in one layer with the position of another layer. For example,
you can create an effect that looks like a magnifying glass moving over a layer, with the contents under the magnifying glass bulging as the lens
(that is, the overlying layer) moves. This expression uses the fromWorld method, which makes the expression work correctly regardless of

whether you move the magnifying glass layer or the underlying layer. You can rotate or scale the underlying layer, and the expression stays intact.

You can also use other effects, such as Ripple, with this expression.

1. Start with two layers. Make one layer a magnifying glass or similar object with a hole in the middle and name it Magnifier. (See Creating

layers.)

2. Animate the position of the magnifying glass layer. (See Motion paths.)

3. Apply the Bulge effect to the other layer. (See Apply an effect or animation preset.)

4. Select the Bulge Center property of the Bulge effect in the Timeline panel and choose Animation > Add Expression, or Alt-click (Windows) or

Option-click (Mac OS) the stopwatch button for the property.

5. Select the default expression text and type the following:

fromWorld(thisComp.layer("Magnifier").position)

Expression example: Fade opacity of a 3D layer based on distance from camera

Apply the following expression to the Opacity property of a 3D layer:

703

This manual is related to the following products: