5 INSANE After Effects Expressions
Tired of spending hours setting keyframes in After Effects? What if you could automate those repetitive tasks with just a few simple expressions? While coding might not be your favorite thing, trust us—these expressions are super easy to use and can transform your animation process. We’ll walk you through five essential After Effects expressions that will save you time and let you focus on what you do best: creating stunning visuals.
1. The Random Expression: Controlled Chaos for Your Animations
The random()
expression is your go-to tool for generating randomness in After Effects. It adds an element of unpredictability to your work, perfect for creating dynamic background animations or other effects that benefit from a touch of chaos.
Here’s how it works:
- The
random()
expression generates a random value for each frame. - Want more control? Use
random(minValue, maxValue)
to define a range. For example, if you want values between 0 and 30, you can specify it within the parentheses. - Need a static random value? Enter the
seedRandom()
expression. By settingtimeless = true
, you can ensure your values remain static across frames. For even more fun, try applying this to scale properties and watch your elements take on varied shapes without lifting a finger!
2. Measuring Speed and Velocity: Adding Depth to Your Movements
Measuring speed and velocity in After Effects has some practical uses, especially when it comes to exaggerating movement. The velocityAtTime()
and speedAtTime()
expressions allow you to connect speed to other properties for more dynamic effects.
For example:
- A simple sliding text animation can be given a dramatic slant tied to its speed.
- In more complex cases, like animating a 3D pointer, you can tie the rotation of the pointer to its movement for a more synchronized effect.
You can even use these expressions to create a more complex animation involving multiple layers, making it possible to achieve intricate effects with just a few keyframes.
3. Animating Numbers: From Boring to Engaging
Let’s be honest—dynamic numbers are much more interesting than static ones. Thankfully, there’s a simple way to animate numbers like percentages, money, or decimals.
The magic happens with a combination of a slider control
and num = effect("Slider control")("slider").value.toFixed(0)
to animate from one value to another. For instance:
- Animate a number from 0 to 10,000 with just a few steps.
- Control the number of decimal places with the
toFixed()
method. Want two decimal spots? Just writetoFixed(2)
. - Need to add symbols like percentage or a dollar sign? Simply concatenate them to the expression (
+ “%”
or+ "$"
).
4. Linear and Ease Expressions: Effortlessly Smooth Animations
When working with sliders or controllers, you’ll often need a way to remap values from one range to another. That’s where the linear()
and ease()
expressions come into play. These are especially useful for creating smooth, controlled animations with a bit of elegance.
For example:
- Let’s say you want a line to follow a triangle’s rotation. The
linear(r,0,360,0,100)
expression allows you to map the triangle’s rotation (from 0 to 360 degrees) - If you want the motion to ease in and out, you can switch to the
ease()
expression for a smoother start and finish. - One common issue arises when rotations go beyond 360 degrees or below zero, but fear not! The
clamp()
expression solves this by restricting values within a specific range, keeping your animations in check.
5. The Wiggle Expression: Adding Controlled Jitter to Your Animations
We all love the wiggle()
expression for its ability to add a touch of random movement to layers. But what if you need more control? By combining the wiggle()
expression with clamp()
, you can limit the movement within a specific area.
For instance:
- You could have an object move freely inside a rectangle without ever escaping its boundaries.
- By adjusting the
wiggle()
parameters, you can control both the frequency and magnitude of the jitter, making it perfect for a variety of effects.
Bonus: Look At Expression – A 3D Twist
Want to have one or more layers always “look at” another layer? The lookAt()
expression is your solution. While this only works with 3D layers, it’s a powerful tool for orienting multiple layers toward a target layer.
The tricky part comes with setting up your scene in 3D, but once you’ve done that, the lookAt()
expression automates the orientation of layers, saving you time. By tweaking the proper axes, you can achieve a smooth, dynamic interaction between layers.