Copy link to clipboard
Copied
I have a bounce expression that works when scaling up, but it doesn't work when I scale down. I need an expression that adds a bounce when scaling down.
Copy link to clipboard
Copied
What's the scale up expression? It should help to define the kind of motion you're looking for on scale down.
Copy link to clipboard
Copied
This is the expression I use.
amp = .03;
freq = 3.0;
decay = 5.0;
n = 0;
time_max = 4;
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 < time_max){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}
Numbers with Commas
var num = effect("Slider Control")("Slider")
num = Comma(num);
[num]
function Comma(number)
{
number = '' + Math.round(number);
if (number.length > 3)
{
var mod = number.length % 3;
var output = (mod > 0 ? (number.substring(0,mod)) : '');
for (i=0 ; i < Math.floor(number.length / 3); i++)
{
if ((mod == 0) && (i == 0))
output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
else
output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
}
return (output);
}
else return number;
}
Copy link to clipboard
Copied
It works for me, going in either direction (it even goes below zero if your last keyframe is close enough to zero). What's the particular issue you're seeing?
Copy link to clipboard
Copied
How's it's working for you? I am trying to get the bounce to scale up before scaling down.
Copy link to clipboard
Copied
The expession you posted is for inertial overshoot--it keeps going in the direction it's moving, goes past the stopping point, and then settles out. It sounds like you may be talking about bounce rather than overshoot. I go over the difference here:
http://www.motionscript.com/articles/bounce-and-overshoot.html