I can think of 2 ways off the top of my head.
you can use Math.exp() to generate exponential curves. Say you have a slider (“Slider Control 2” in this example) with two keyframes, then you could calculate an exponential curve between the two values with something like this:
slider = effect(“Slider Control 2”)(“Slider”) ;
decay = 5.0;
if (slider.numKeys < 2){
slider.value
}else{
t = slider.key(1).time;
v1 = slider.key(1).value;
v2 = slider.key(2).value;
if (time < t){
slider.valueAtTime(time);
}else{
v2 + (v1-v2)/Math.exp(decay*(time-t));
}
}
You would set the steepness of the curve with the variable “decay” (or tie it to a slider).
//Or…
//
Inertial Bounce is like making your moves “rubbery.” Layers will overextend, then settle into place on position and rotation keyframes.
// 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){
n–;
}
}
if (n == 0){
t = 0;
}else{
t = time – key(n).time;
}
if (n > 0){
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);
}else{
value;
}
https://technicolorsoftware.hostzi.com/