ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Is there a way to calculate the maximum velocity between two keyframes?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tim Harwell
Is there a way to calculate the maximum velocity between two keyframes?
on Apr 1, 2020 at 6:08:34 pm

Hello,

I'm wanting to calculate the maximum speed between the most recent two keyframes and then use that value to initiate an exponentially decaying sine wave.

This is about as far as I've gotten:

thisComp.layer("Shape Layer 1").position.speed.toFixed(2);



I've seen code for calculating the maximum value of keyframes, but not speed.

Any help would be greatly appreciated!

Thanks in advance,

Tim

myProp = transform.opacity;
if (myProp.numKeys > 0){
myMin = 9999;
myMax = -9999;
for (i = 1; i &lt;= myProp.numKeys; i++){
myMin = Math.min(myMin,myProp.key(i).value);
myMax = Math.max(myMax,myProp.key(i).value);
}
}else{
myMin = myMax = myProp.value;
}


Return to posts index

Darby Edelen
Re: Is there a way to calculate the maximum velocity between two keyframes?
on Apr 4, 2020 at 9:55:31 pm

When you say 'between the most recent two keyframes' do you mean the maximum speed that is reached at any point in between those keyframes or the maximum speed at one of those two keyframes?

Darby Edelen


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]