Inertia

02 Feb 2014 //

Tags: After Effects Expressions

Copy and paste this into the stopwatches expressions function. It works with many of the properties such as rotation, scale, position etc.

var amplitude = .05; //adjust this to affect the amount of overshoot.
var frequency = 1.0; //adjust this variable to affect the amount of times
var decay = 4.0; //adjust this variable to affect how quick the effect rolls off
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){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amplitude*Math.sin(frequency*t*2*Math.PI)/Math.exp(decay*t);
}else{value}
comments powered by Disqus