-
Movement affecting scale
Hi everybody,
I try to use the following expression to affect scale when animating the position:
amp = .1;
freq = 2.0;
decay = 2.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}
I apply this expression on an expression control position (named Bounce), and I paste on it the same animation keyframes than the position parameter.
Then I use the following expression on the scale parameter:
bounce=transform.position-effect("Bounce")("Point");
value+bounce*100
It works but I am sure that there is a simpler and better way to make the position animation affecting the size, without having to duplicate keyframes.
Any ideas ?