-
Intertial Bounce combined with squash and stretch
Hi,
I’m sure this has been answered before, but I’m struggling to find the solution either here on on google.
I’m using Dan Ebbert’s/ Harry Frank’s “inertial bounce” expression on the scale property of my keyframed layer, but I’d like to modify it so that the layer “squashes and stretches” as it settles.
I know Dan has a “squash and stretch” expression, but does anyone know how can I combine the two expressions to allow me squash and stretch on a key framed property?
I’ve tried the expression below, but I get a “second argument to div() must be scalar” error, which clearly means I’m doing it wrong!!
Thanks for any help
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){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
x = scale[0] + + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
y = scale[0]*scale[1]/x;
[x,y]
}else{value}