After Effects timesaving: Expressions 02

Over the last couple of years of learning After Effects, I have found some pretty useful expressions which can help speed up your work process and create more seamless and smooth animations.

Here are some of my favourites.

Bounce Keyframes

Place on the position keyframes to create a bouncing motion. 

// Inertial Bounce (moves settle into place after bouncing around a little)
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
if (n == 0){
t = 0;
t = time - key(n).time;

if (n > 0 && t < 10){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .05;
freq = 4.0;
decay = 2.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);


loopOut("pingpong")  // ABCD(CBABCDCBA)

loopOut("continue") // ABCD(EFGHIJKL)

loopOut("Cycle")  // ABCD(ABCDABCD)

Position one layer between two others

Place this expression on the 3rd layer (of three) to create the middle place.

(thisComp.layer(1).position + thisComp.layer(2).position)/2

Make a 3D layer invisible when turned away from the camera

Place on the opacity value of the 3D layer

if (toCompVec([0, 0, 1])[2] > 0 ) value else 0


Constant animation over time

Useful for rotation animations, fractal noise etc 



See our first selection of expressions here

Hope these are helpful! let us know if you have any others...

By: Lisa
Posted: Thu 29th Jan 2015

Tags: Afx, After Effects, Afx, expressions, handy, learn, quick, timesaving, tips


Related Posts

Live feed


Motional on Twitter


Time to think about next year?
2 months ago · reply · retweet · favorite

Drive-in Jesus, perfect for today
2 months ago · reply · retweet · favorite

Holidays are not over yet, catch the Sparrrk
2 months ago · reply · retweet · favorite

Join the conversation

Welcome to Motional

Sharing good design, beautiful film and inspiring animation. Developed by the creative team at First Image.

If you would like to contribute an outstanding piece of work please send us a link here.

Contact us at here regarding articles, interviews or any other enquiries.

Follow Motional with Bloglovin

Follow Motional on Google+