There are two keys to an understanding of expressions:
Expressions do only one thing: translate data values. Granted, that's a little bit like saying your computer's hard drive only has ones and zeros on it, but fundamentally, there are three types of data on which expressions do their work:
Expressions can either
Numerical and logic data can come from almost anywhere in the world of After Effects. They can derive from
Essentially every piece of numerical or Boolean data that exists in your After Effects project is accessible to expressions and can be used to create animations.
Notes
The After Effects expressions language is based on JavaScript (or, more precisely, ECMAscript, the standardized version), a scripting language that was originally devised for Web browsers at Netscape. Many functions that are fundamental to JavaScript, such as the ability to perform mathematical operations, work identically in After Effects. Of course, many other functions from JavaScript are specific to the Web and interactivity. 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.
What Can't Expressions Do?
Expressions cannot natively evaluate certain types of data:
Nor can they handle certain complex effects data, such as effects channels that can be keyframed but whose keyframe values are not made up of four or fewer numerical values. For example, expressions work with RGBA datared, green, blue, and alpha channel values normalized between 0 and 1but they can't handle the Channel Range color control in Hue/Saturation.
Therefore although you can change the pixel values and audio levels of a layer using expressions, you can't sample a given pixel's RGB values, the decibel level of a soundtrack, or the position of a mask point.
Expressions are also only ever aware of conditions at the current point in time. You can create expressions that create a progression over time, but every frame up to the current one has to be recalculated from scratch on each frame, causing the expression to run more and more slowly over time. This can make physical simulations (such as the motion of a spring or the progression of a pattern) impractical.
Muting Keyframes |
Section I. Working Foundations
The 7.0 Workflow
The Timeline
Selections: The Key to Compositing
Optimizing Your Projects
Section II. Effects Compositing Essentials
Color Correction
Color Keying
Rotoscoping and Paint
Effective Motion Tracking
Virtual Cinematography
Expressions
Film, HDR, and 32 Bit Compositing
Section III. Creative Explorations
Working with Light
Climate: Air, Water, Smoke, Clouds
Pyrotechnics: Fire, Explosions, Energy Phenomena
Learning to See
Index