Wow, thanks for this, it’s exactly what I needed, I owe you one my friend!
As I said, I know jack about working with all but the simplest expressions, this is the one I found online and used. It basically made my character bounce all the way down, instead of plummet then bounce:
// Ease and Wizz 2.0.1 : inOutBounce : All keyframes
// Ian Haigh (https://ianhaigh.com/easeandwizz/)
// Last built: 2010-10-09T13:35:40+11:00
// some defaults
var p = 0.8; // period for elastic
var a = 50; // amplitude for elastic
var s = 1.70158; // overshoot amount for “back”
function inOutBounce(t, b, c, d, a, p) {
function easeOut (t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
}
function easeIn(t, b, c, d) {
return c – easeOut (d-t, 0, c, d) + b;
}
if (t < d/2) return easeIn (t*2, 0, c, d) * .5 + b;
else return easeOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
}
function easeAndWizz() {
var n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) { n– }
}
try {
var key1 = key(n);
var key2 = key(n+1);
} catch(e) {
return null;
}
// determine how many dimensions the keyframes need
var dim = 1; // It’s gotta have at least ONE dimension
try {
key(1)[1];
dim = 2;
key(1)[2];
dim = 3;
} catch(e) {}
t = time – key1.time;
d = key2.time – key1.time;
sX = key1[0];
eX = key2[0] – key1[0];
if (dim >= 2) {
sY = key1[1];
eY = key2[1] – key1[1];
if (dim >= 3) {
sZ = key1[2];
eZ = key2[2] – key1[2];
}
}
if ((time < key1.time) || (time > key2.time)) {
return value;
} else {
val1 = inOutBounce(t, sX, eX, d, a, p, s);
switch (dim) {
case 1:
return val1;
break;
case 2:
val2 = inOutBounce(t, sY, eY, d, a, p, s);
return [val1, val2];
break;
case 3:
val2 = inOutBounce(t, sY, eY, d, a, p, s);
val3 = inOutBounce(t, sZ, eZ, d, a, p, s);
return [val1, val2, val3];
break;
default:
return null;
}
}
}
(easeAndWizz() || value);