-
keyframe overshoot based on another layer’s movement
Hi all
I’m trying to give a puppet tool pin inertial bounce when the tubby pig character moves. I was using the fantastic expression from Dan Ebbert’s moitionscript.com (again!!!, it’s a brilliant site – nice one Dan) and thought if I changed the line:
n = nearestKey(time).index;
to
n =transform.position.nearestKey(time).index;
it would work, but it tells me:
this property has no keyframe number 2even though it does have two keyframes.
I then tried driving it with a null:
n=thisComp.layer(“Null4”).transform.position.nearestKey(time).index;and got the same error.
What am I doing wrong?
thanks
Matt
freq = 3;
decay = 5;n = 0;
if (numKeys > 0){
n =transform.position.nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
amp = velocityAtTime(key(n).time - .001);
w = freq*Math.PI*2;
value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}else
valueVisual tinkerer and easily distracted admirer of all things shiny! – writer – animator – digital artist