As you might have realized, managing a bunch of keyframes can get tedious and complex quickly, especially for more dynamic animations. That's where expressions come in. Ditch the keyframe clutter and check out the 20 BEST After Effects expressions which you can just copy and paste straight into After Effects!
Expressions in Adobe After Effects serve as a critical tool in enhancing the depth and dynamism of your animations. Once you're familiar with the fundamentals of After Effects, namely layers, keyframes, and straightforward animations, the next aspect to delve into is mastering expressions.
Expressions, in the context of After Effects, are JavaScript-based instructions that provide a more profound control over layer properties compared to conventional keyframes. By employing expressions, users can automate, orchestrate, and connect layer properties in an intricate manner, thereby delivering complex animations with relative ease.
Drawing from personal experience, I found the utility of expressions distinctly transformative in a project that involved animating a starry night sky. The requirement was to animate individual stars, creating a unique flicker for each to mimic the natural randomness in a night sky.
A traditional approach to this task would involve the individual keyframing of each star, which is time-consuming and counterintuitive. However, through the use of expressions, I was able to manipulate the 'Opacity' property of the star layers.
I implemented the expression 'wiggle(5,50)' on the 'Opacity' property of a star layer. The 'wiggle' function, in After Effects terminology, generates a random value at a set frequency. Consequently, this function caused the star's opacity to fluctuate five times per second by up to 50%, thereby presenting an effect of twinkling.
To streamline this process across all star layers, I used the pick whip tool to link the 'Opacity' property of all other star layers to the initial one, which had the expression attached. Subsequently, I integrated a small, random time delay into each star's expression. This process resulted in each star twinkling at slightly varying rates, effectively capturing the randomness and dynamism of a starry night sky.
The convenience of this approach lies in the ease of modifying the twinkling speed and intensity. Changes made to the expression of the initial star layer are reflected in all linked star layers. The realization of such an intricate animation without the necessity of hundreds of individual keyframes is a testament to the power of expressions.
As you delve deeper into the world of expressions, remember that the goal is to understand the objective of your animation and find or create an expression that caters to this requirement. Although mastering expressions may seem daunting initially, proficiency in expressions will undoubtedly enhance the quality and efficiency of your animation workflow.
Browse Graphics, Mockups, Brushes & More!
Search
So as I mentioned above, expressions in After Effects are just a form of programming code that allows you to automate complex actions. When you add an expression to a property, the existing property value, whether static or keyframed, serves as an input to generate new, modified values. The language used in expressions is JavaScript, but don't let that deter you if you're not familiar with coding. Basic expressions are often simple, and numerous resources are available to help you get started, regardless of your coding proficiency.
For instance, consider a situation where you apply an expression like "value+90" to the Rotation property of a layer. This expression adds 90 degrees to the existing value of the Rotation property, supplementing the keyframed motion. This functionality demonstrates how expressions can modify the behavior of a layer beyond the limitations of simple keyframing.
Before we embark on our journey with expressions, it is important to set up the necessary elements. Begin by creating a new composition in After Effects. Next, add a solid layer to the composition by selecting Layer > New > Solid from the menu.
Now, with the layer selected, press 'S' on your keyboard to reveal the scale property in the Timeline panel. This is where our expedition into expressions begins.
To add an expression to a property, navigate to the timeline panel, and Alt+Click (Windows) or Opt+Click (Mac) the stopwatch icon next to the property, in this case, the Position property. Upon doing this, After Effects assigns a default expression to the selected property, which can be altered later to suit your needs.
Upon creating the expression, you'll notice certain changes in the user interface. The Scale property's value (displayed as 100,100) changes its color from blue to red, indicating the activation of an expression.
Next to the stopwatch icon, a twirl-down arrow appears. Click on it to reveal the expression controls.
To the right of these four buttons, you will find the default expression, which in this case is transform.position.
If you wish to modify the expression, click on the expression text in the Timeline panel to activate the expression editor field. This field functions just like a typical text field; you can copy, paste, select, or drag text within it. Pressing Enter creates a new line, and you can adjust the field's height as per your preference.
For instance, if you want your solid layer to have a wiggling motion, you can replace the default expression with wiggle(3,50). This expression will cause the Position of the layer to wiggle along both axes.
To unlock the full potential of expressions in After Effects, it's essential to understand how mathematical operations come into play. These operations enable you to manipulate properties in diverse ways, leading to more complex and captivating animations.
Just as in any programming language, basic math operators such as addition (+), subtraction (-), multiplication (*), and division (/) can be used in expressions.
Let's consider an example where you want a layer's Opacity to be half of its Scale. If you add an expression to the Opacity property, you could write it as thisLayer.scale[0]/2. Here, the expression takes the Scale property of the layer (only the X value, since scale is an array), divides it by 2, and applies that resulting value to the layer's Opacity.
Expressions in After Effects support more complex mathematical functions such as sine (Math.sin()), cosine (Math.cos()), and others. These functions can generate interesting effects, especially when dealing with properties that involve motion or repetition.
For instance, you could use the Math.sin() function to create a pendulum-like swing animation. By applying an expression to the Rotation property of a layer, you could write it as Math.sin(time) * 30. This expression uses the sine of the current time to generate a value for the Rotation property, effectively creating a smooth, back-and-forth swinging motion.
Another extremely useful math function in After Effect expressions is the random() function. As the name suggests, this function generates random values, which can be great for creating organic, unpredictable effects.
For example, if you wanted a layer's Position to randomly wiggle around, you could apply an expression like position + [random(-50, 50), random(-50, 50)]. This expression adds a random value between -50 and 50 to both the X and Y position of the layer, causing it to jump to different positions randomly.
Time is a built-in variable in After Effects expressions, and it can be used in conjunction with mathematical operations to create animations that change over time without the need for keyframes.
Consider an instance where you want a layer's Scale property to gradually increase over time. An expression for this could be value + (time * 10). This expression adds the current time, multiplied by 10, to the layer's Scale property, resulting in a steady increase in scale as time progresses.
Here's what you're looking for: the After Effects expressions list of the most helpful and versatile expressions for editing anything in AE! This table is sorted in order of difficulty, so I'd recommend starting by learning the top ones first (and also the transform position expression since it's very basic).
As you can tell, most of these are custom combinations.
Scripts and expressions both use JavaScript, but they play different roles. Scripts tell After Effects to do something to your entire project, like creating layers, changing values, or executing complex functions. On the other hand, expressions tell a single property of a single layer to behave a certain way. Think of AE expressions like a mini-program for individual properties.
The time expression in After Effects represents the current composition time in seconds. It's a handy tool to animate properties based on time. For instance, if you want a property to continually change over time, you could use an expression like value + time; This will increment the property's value based on the current time.
The bounce effect expression simulates a bouncing movement, often used to add life to animations. For instance, if an object falls, it will not simply stop when it hits the ground but will instead bounce a few times, diminishing with each bounce. There are various expressions available online to create this effect, and they can be quite complex as they need to simulate physics!
Loop and bounce effects are both methods of creating dynamic and living animations. Looping makes an animation repeat itself over and over, giving the illusion of continuous motion. Bouncing, on the other hand, creates a dynamic change within a property, imitating the physics of a bouncing ball.
The looping expression in After Effects is a powerful tool that allows you to repeat certain animations. The most commonly used loop expressions are loopOut(), loopIn(), loopInDuration(), and loopOutDuration(). For example, loopOut("cycle") will make your animation loop from the end back to the beginning, creating a seamless cycle.
A bounce scale expression is a specific use case of the bounce expression where the scale property of a layer is manipulated to give the impression of bouncing. This can be handy for making text or objects pop on screen in a playful way, imitating a physical bounce.
The linear expression in After Effects is used to map an input range to an output range. It can be used to smoothly transition values, create relationships between properties, or animate properties based on other variable inputs. For example, linear(time, 0, 10, 0, 100) would map the time from 0 to 10 seconds to a range of 0 to 100 on the chosen property.
To control expressions in After Effects, you can use the expression language menu, which provides a host of built-in expressions. You can also utilize the pick whip tool to link properties and create relationships between them. And don't forget about expression controls effects like sliders, checkboxes, and color controls that can help you manage values within your expressions. Just remember, while expressions can be quite powerful, they can also be processor-intensive, so use them judiciously!
You can apply expressions to multiple layers in After Effects at once! Instantly link separate layers together while still keeping their individual properties, as well as use an array of easing/velocity functions for unique motion like never before. A situation like this would have taken hours if not days before to achieve; with expression it's now easy and fast!
To add expressions to multiple layers in After Effects, simply follow these steps:
Now to finish off this post, here's a good video I recommend you watch to get a good understanding about expressions.