Expression examples, Expression example: rotate the hands of a clock – Adobe After Effects CS4 User Manual
Page 689
683
USING AFTER EFFECTS CS4
Expressions
Last updated 12/21/2009
Expression examples
Many of the examples in this section are based on expressions provided by Dan Ebberts. Dan Ebberts also has an
excellent collection of example expressions and tutorials for learning how to work with expressions on his
.
that show how to use expressions to make one layer
repel others in a natural-seeming manner.
The AE Enhancers forum provides many examples and much useful information about expressions, as well as scripts
, Paul Tuersley provides a tutorial and example project
that show how to use expressions to animate several layers in a swarm.
that demonstrates rolling a square object along a floor so that the sides
stay in contact with the floor plane.
parenting to relate the rotation of a set of wheels to the horizontal movement of a vehicle.
Marcus Geduld provides some examples from his book, After Effects Expressions, on the Focal Press website. In the
property of a layer. He even shows how to use an array of strings so that a layer's Source Text property can be set to a
bounces, jiggles, and collision detection.
for automatically arranging still images or videos into a grid
(like a video wall). You can easily adjust position and spacing with sliders that are connected to a system of expressions.
There are three compositions in the project—one for stills, one for videos, and one to create an auto-storyboard in
which a video is sampled at user-defined intervals and aligned into a grid.
Rhys Enniks provides a video tutorial on
in which he uses expressions and multiple text animators and
range selectors to animate text as if it is being typed onto a computer screen.
Expression example: Make a layer revolve in a circle
You can create an expression without using properties from other layers. For example, you can make a layer revolve
in a perfect circle.
1
Select a layer, press P to reveal its Position property in the Timeline panel, and Alt-click (Windows) or Option-click
(Mac OS) the stopwatch to the left of the property name.
2
Enter the following in the expression field:
[(thisComp.width/2), (thisComp.height/2)] + [Math.sin(time)*50, -Math.cos(time)*50]
Expression example: Rotate the hands of a clock
You can use the pick whip to link rotation values between layers to animate the hands on a clock—as the hour hand
moves from hour to hour, the minute hand rotates the full circumference of the clock face. This type of animation
would take a long time to create if you had to set each keyframe for both hand layers, but with the pick whip, you can
do it in a matter of minutes.
1
Import or create two long, narrow solid-color layers: an hour hand and a minute hand. (See “