The Best 10 After Effects Expressions

Really quick for those who are new to After Effects so what is an after effects expression ?
An After Effect expression is a programming Javascript language code that you insert in any “Time-Vary stop watch” by pressing Alt-Click. See below

After Effects Expressions

Over the years I have learn that after effects expressions can be very handy and powerful to make great motion graphics. It is amazing that with a few programming codes it can help make your animation moving organically. For those who have programmer brain which I don’t have 🙂 After effect Expression  can significantly improve your workflow when you create an animation and with complex codes you can
actually achieve amazing motion graphics.

So let’s get to the real stuff, I found most of those useful after effects expressions list below on the web, to me they are the most used expressions unfortunately I don’t remember the ae expression owners name but I am happy to add a name next to those fabulous expressions if you know the programmer please shoot me an email or add a comment.

Also please like & Share

The Bounce Expression
The bounce expression is very useful to make your animations and titles look dynamic with a nice elastic movement, just make 2 keyframes position and past the code below.

amp = .1;
freq = 2.0;
decay = 2.0;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}}
if (n == 0){ t = 0;
}else{
t = time - key(n).time;
}
if (n > 0 && t < 1){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}
After Effect Expression bounce
 Download the bounce after effect expression example here.

Automatic Fade
The automatic fade expression is useful when you don’t want to bother a create keyframes for a fade animation.

transition = 20;       
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); 
linear(time, inPoint, inPoint + tSecs, 0, 100)
 - linear(time, outPoint - tSecs, outPoint, 0, 100)
}else{
linear(time, inPoint, marker.key(1).time, 0, 100) 
- linear(time, marker.key(2).time, outPoint, 0, 100)
}
autofade


Download the autofade expression example here

Squash and Stretch
The squash and stretch expression should make your animation a bit more alive by adding a proportional squash and stretch scale to your shapes or images.

maxDev = 13; // max deviation in pixels
spd = 30; //speed of oscillation
decay = 1.0; //how fast it slows down

t = time - inPoint;
x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
y = scale[0]*scale[1]/x;
[x,y]
squash-stretch

Download The Squash and stretch expression example here
Ae Expression Source: http://motionscript.com/expressions-lab-ae65/squash-and-stretch.html

Loop
Loop expression is probably to most used after effects expression, it allows you to repeat your animation
forever, with code tweak you can also control the loop time and repetitions.

loopOut("cycle");
Loop

Download The Loop expression example here

Looping Wiggle (by Dan Ebberts)

The looping wiggle expression become handy when you want an object to move randomly in your composition. Looping wiggle should be seamless and you shouldn’t see a cut, this expression is also used for background animation.

freq = 1;
amp = 110;
loopTime = 3;
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)
Loop-wiggle

Download the Loop Wiggle expression example here.

Time

Time expression is good for constant animation, the higher the number next to “time” below the faster your animation will be.

time*150
time

Rotate Multiplication

Rotate Multiplication is my favorite expression, basically it allows you to rotate multiple shapes around a center point and define how many shape you want this  case below is 20 shapes layers until it make a circle. The rotate mutiplication is awesome to create circle burst animation. It is a bit complicated to explain how exactly how it work, so feel free to download my file after the animation below.

index*360/20
\Rotate-Multiplication

Download The rotate multiplication expression example here.

Move Object X Pixel per Second

If your tired of making key frames, you’ll like this expression it allows you to move an object on the x axis per second.

veloc = 150; //Move object 150 pixel on x axis per second
x = position[0] + (time - inPoint) *veloc;
y = position[1];
[x,y]
Move-Pixel

Download Move Object X Pixel per Second example here

Constant Rotation Per Second

Same here no key frames needed to make a simple 360 rotation

veloc = 360; //360 Degree Rotation per Second
r = rotation + (time - inPoint) *veloc;
[r]
Constant-Rotation

Download The Constant Rotation expression example here.

Motion Trail

As you can see below with the motion trail expression you can get some pretty interesting animation of an object with trail.

//Apply to position
delay = 5; //number of frames to delay

d = delay*thisComp.frameDuration*(index - 1);
thisComp.layer(1).position.valueAtTime(time - d)


//Apply to Opacity

opacityFactor = .75;
Math.pow(opacityFactor,index - 1)*100
motion-trail

Download the motion trail expression example here
Script source: Motionscript

2018-08-17T17:56:00+00:00

7 Comments

  1. johnnie 11/16/2016 at 8:55 am - Reply

    thx so much…..av looked for them for along time

  2. johnnie 11/29/2016 at 6:52 am - Reply

    bouncing expression?????????????? help me with one

    • Musadiq 01/11/2017 at 11:15 pm - Reply

      Just use Position or Scale element, and while clicking on the keyframe you need to hold alt in order to paste that Expression.

  3. Diego 03/08/2017 at 1:30 pm - Reply

    Cool. Thank you!

  4. norbert 04/24/2017 at 6:29 am - Reply

    thanks

  5. Rokas 03/17/2018 at 2:29 pm - Reply

    Hey, thanks a lot for this great info. Could you help me with squash effect? Keep getting an error.

  6. Jagan 09/29/2018 at 12:25 pm - Reply

    please make post on more rotate multiplication.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.