Extending After Effects with Expressions

Expressions really open up After Effects to another level, and there’s just some things that you couldn’t do otherwise without a little bit of code to help out.

Below is a list of our favourite expressions in not particular order that we have found online at some point or another.

Large Number Counter with Prefix and Suffix Support

The Slider Control in After Effects will only go so high (1,000,000), so in comes the Angle Control to save the day.

All you need on your text layer is an “Angle Control”, and you’ll be keyframing the full rotation number. In the expression itself, you can add to the textBefore and the textAfter variables to include any text you like.

Looping a Path Property

The classic loopOut expressions sadly don’t work on Path properties, thankfully we have the expression below to help us out.

Looping Wiggle Expression

If you want your wiggle to be a touch more predictable and loop after a set amount of seconds, then below is for you!

Maintain Scale when Parented

Thanks to Ben Marriott for this one, this expression when applied to the Scale property, maintains the layer’s original scale even while it’s parent’s scale changes. Check out Ben’s video here for a great example on how to use it.

Maintain Stroke Width

Putting this on your stroke width property means that regardless of the layer’s scale, the stroke will maintain the same thickness. Thanks to Ben Marriott and Adam Plouff for this code!

Animating Frequency in a Wiggle

Oh boy, this one is a life saver. If you’ve tried to animate the frequency of a wiggle before, you’ll find out that After Effects likes to flip the table. MotionScript has an amazing writeup that I found when I was hunting a solution that really breaks down everything there is to the Wiggle function.

To use this, you’ll need a Slider Control (which represents your frequency amount) and apply this expression below to the property you wish to wiggle. Keyframe the slider to your heart’s desire and everything will function as expected.

Loop In and Out Continuously

Thanks to QuickLoop for this expression, it allows your property to loop both before and after your keyframes.

Wiggle on One Axis

Dan Ebbert has a sweet little write up regarding this, and it essentially boils down that when you use the wiggle expression, it returns an array of values dependent on the property. For rotation, it’ll return one value, but when it comes to scale or position, it’ll return two, affecting both axises.

To affect just one axis, we have to split it open and apply it to the specific axis we want. Below is an example for just affecting the X-axis.

To affect just one axis, we have to split it open and apply it to the specific axis we want. Below is an example for just affecting the X-axis.

When it comes to 3D position and scale, it introduces a third array entry. Here’s an example of affecting just the Z-axis.

Overshoot

A classic expression. Apply this to a property for automatic, math driven overshoot. Adjust the Amplitude (amp), Frequency (freq), and Decay to achieve the desired results.

Motion Design Resources

The internet is exploding with beautiful resources and tools.
Access our curated collection of our favourite motion design tools, links, resources, inspiration and communities.

A Chunk of our work

Ranging from explainer animations to full narrative pieces, from fully Chunk to videos that we were brought on by an agency or production house to help animate, there's a little bit of everything.

Find us on social media

and discover a little bit of everything we love to do creatively

Contact

Open:
Monday - Friday: 9:00AM - 5:00PM

Happy Hour:
Monday - Friday: 4:00PM - 5:00PM

hello@chunkmotion.design
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.