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

684
USING AFTER EFFECTS CS4
Expressions
Last updated 12/21/2009
2
Set the anchor points at the ends of the layers. (See “
3
Move the layers so that the anchor points are at the center of the composition. (See “
page 145.)
4
Set Rotation keyframes for the hour hand. (See “
5
Select the Rotation property for the minute hand and choose Animation
> Add Expression.
6
Drag the pick whip to the Rotation property for the hour hand. The following expression appears:
thisComp.layer("hour hand").rotation
7
To make the minute hand rotate 12 times as fast as the hour hand, add
*12
at the end of the expression as follows:
thisComp.layer("hour hand").rotation*12
on the Adobe website that takes this idea further,
connecting the rotation of the minute hand and hour hand of a clock to the rotation of the second hand.
Harry Frank provides a clock project on his
to an Expression Controls (Angle Control) effect on a null layer that controls the time. (See “
Expression example: Position one layer between two others
This example expression positions and maintains one layer at a balanced distance between two other layers.
1
Start with three layers. (See “
2
Animate the positions of the first two layers in the Timeline panel. (See “
3
Select the third 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(1).position + thisComp.layer(2).position)/2
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 “
modify a solid-color layer or footage item
2
Animate the position of the first layer. (See “
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