Muting Keyframes


How many times have I heard someone wish for the ability to temporarily disable keyframes in After Effects? You can do this with just about the simplest expression it is possible to write. Not only is disabling keyframes useful when working with an element that is meant to be barely or only occasionally visible (say, one with a keyframed Opacity level below 10%), but you can also use this trick for any property that will let you set an expression. This method of applying expressions is so elementary, there is no excuse for anyone not to use it.

Consider the opacity example: You have an element that is flickering at low opacity, that is blinking, or that for some other reason has Opacity keyframes assigned. You don't want to lose these keyframes, but they prevent you from properly seeing the layer for setup.

The expressions solution for this is trivially easy, and it doesn't require an understanding of JavaScript. It might even help you understand something basic about expressions, especially if you've ever tried to decipher one and wondered where the value is held.

The After Effects expressions language is based on JavaScript, a scripting language that was originally devised for Web browsers. Many functions that are fundamental to JavaScript, such as the ability to perform mathematical operations, work identically with expressions. Of course, many other functions from JavaScript are specific to the Web and interactivity, and have no application in After Effects. Likewise, After Effects adds its own keywords, functions, and attributes; these use the same basic syntax and rules of JavaScript but would not be recognized by it.


With keyframes already set to the Opacity of a layer, set an expression for Opacity. There are several ways to do this once you've selected the property to receive the expression. For example, you can use the Animation menu or a keyboard shortcut (Alt+Shift+=/Option+Shift+=), but it's usually done by Alt-clicking (Option-clicking) on the stopwatch of the property (in this case, Opacity).

Before solving the example's problem, take a quick look at what occurs when you set an expression (Figure 10.1). Note the equals sign toggle that appears next to the stopwatch; you can use this to turn the expression on and off. Also, note that After Effects adds a new line below the property. This line contains text that is automatically highlighted directly after you apply the expression. In this case, the text reads opacity, and the cursor blinks to indicate that the text is live. This is useful, because the first thing you want to do is usually to replace or augment this text.

Figure 10.1. With the default expression activated for the Opacity channel, the opacity value of 100% turns red and a new cursor with an equals sign appears next to the stopwatch; this toggles the expression on and off. The following line, revealed by the twirly arrow, contains the expression itself along with icons for the graph, pickwhip, and keywords.


That one word, "opacity," is an expression. It tells After Effects to look at the layer's Opacity channel for its value, which is, of course, what happens under normal circumstances. Nothing about the functionality has changed. If you moved opacity over to an expression on the Rotation property, however, then Rotation would get its value from the layer's Opacity value, including any keyframes and expressions, as well. But I'm getting ahead of myself.

Replace opacity with 100 and either press Enter (not Return) or just click outside the text area. Now, instead of looking back at its own keyframe data, Opacity looks at this one value, 100, on every frame of the composition (Figure 10.2). The keyframes have effectively been "muted," replaced with a constant value.

Figure 10.2. If Opacity (or any property) has keyframes set, a number in the expressions field overrides them and sets it to that value. The flat red line in the graph shows you what's going on.


Toggle the Expressions button (the equals sign next to the stopwatch) to enable/disable the keyframes. The only danger here is that you'll forget to turn this expression off when you're done with it, but that's not really the fault of expressions, now is it? You can optionally delete the expression instead, the same way that you set itby Alt/Option-clicking on the stopwatch.

Things work a little differently with properties that contain more than one value, such as Position. These are called arrays and are detailed in the next section.



Adobe After Effects 6. 5 Studio Techniques
Adobe After Effects 6.5 Studio Techniques
ISBN: 0321316207
EAN: 2147483647
Year: 2006
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net