(Page 2 of 2 pages for this article < 1 2)
Sunday, July 08, 2001
Expressive Animation
One of the most significant features in After Effects is an easy-to-use scripting language called Expressions.
Slightly More Advanced
Expressions are a great help for coordinating animations. However, they are also very useful for coordinating effects or creating other types of master/slave relationships.
We like to use Expressions to set up master colors for a design. The trick is defining the color of a layer by using an effect that has a color swatch you can animate – for example, Fill, Path Text, Stroke, or Tint. You can then create Expressions to link one color swatch to another, using exactly the same technique as for Rotation above. The master parameter for an Expression can be a layer that appears in the final render, or a dummy layer such as a Null Object or Solid. Expressions can even bridge across comps, so you can set up one “master color” composition and link layers in all your working comps back to it.
A particularly powerful option is to use a special set of effects called Expression Controls with expressions. Expression Controls don’t alter an image by themselves; they provide user interface elements such as sliders and dials that you can then pickwhip expressions to. This makes it easy to see what’s going on. You can also keyframe these controls, allowing you to animate the parameters inside an expression.
A common technique to organize complex compositions is to apply Expression Controls to a null object layer, and to pick whip parameters from other layers (such as effects applied to those layers) to follow these Expression Controls. That way, you can edit parameters on one master layer, and a bunch of slave layers will follow. This is especially useful for tweaking a color palette for a design.
Expressions can be linked between dissimilar parameters. For example, a popular text trick is to animate the tracking of a line of type to adjust how far apart the characters are spaced, and to make them blurrier as this space increases. This would normally require coordinating two sets of keyframes: one set for tracking, and one for blur. However, you can instead link an Expression for the blur amount to follow the tracking amount. If you want a tracking value of 10 to correspond to a blur value of 1, simply tack / 10 onto the end of the script to divide by ten.
Expressions themselves are just text files – you can copy and paste them to a word processor or scrapbook utility, or email them to others. Another great trick is to select a parameter or effect with an expression applied, and use Animation > Save Animation Preset to store away an expression for later use. Indeed, many of the Animation Presets provided by Adobe make clever use of expressions.
How can you tell if an expression has been applied to a layer? Select it and type EE (two Es in quick succession) to reveal them. Selecting a layer and typing U will also reveal all expressions as well as keyframes applied to a layer.
If you want to dive deeper into Expressions, the manual and online help does an good job explaining them. We wrote a pair of extensive chapters on expressions in our book Creating Motion Graphics with After Effects. There are also some excellent web sites out there which explain expressions, such as MotionScript and AEnhancers. As you get deeper into writing your own expressions, you may eventually want to get a JavaScript book such as Javascript - A Beginner’s Guide by John Pollock (that’s the one we use).
After Effect also has a few tools to make life easier, such as a popup menu (to the right of the pickwhip) with the most common Expression components already spelled out for you (shown below).
There are a few gotchas with Expressions. The biggest one is they are very sensitive to precise layer names. If you copy and paste expressions between layers, or change a master layer’s name, you’re going to have to edit the Expression to fix it. Another is that they only apply to one parameter at a time; if you want to make all the parameters of one effect follow another, you have to link up an Expression for every parameter that differs from the default value. However, the time spent creating them will be more than repaid during the course of a project.
(Page 2 of 2 pages for this article < 1 2)
Mark Spencer | 06/09- 01:15 PM
Chris and Trish Meyer | 11/05- 05:52 PM
Chris and Trish Meyer | 10/03- 04:51 PM
Chris and Trish Meyer | 06/04- 08:43 PM
|