-
Keyframe a property’s speed over time
Hello folks!
I come bearing an Xpresso question. I need to finely control the speed of an object’s rotation in my scene. Basically my goal is to have a User Data property called something like “Rotation Speed,” such that a value of 0 means the object isn’t moving, and increasing values result in a faster rotation. That way, I’ll be able to animate the acceleration and deceleration of my object, while ensuring that its speed remains constant in between.
In After Effects I’ve been using the following expression in a Rotation property (along with a Slider control) to achieve this:
sp = thisComp.layer("myRotationControlLayer").effect("Rotation Speed")("Slider");fr = timeToFrames( time );
rot = value;
for ( i = 0; i < fr ; i ++){
t = framesToTime(i);
rot += sp.valueAtTime( t ) * thisComp.frameDuration;
}rot
I’m fairly comfortable in Xpresso but I just can’t seem to crack into this one. I’ve tried tapping into my object’s “Previous Rotation” port in order to iterate its value from one frame to the next– this seems to do the trick in theory but in practice it’s buggy as hell since the Previous Rotation value doesn’t reset to its original state when I reset my playhead to frame 0. Here’s the setup I’m currently working with:
I really appreciate any advice y’all may have. Cheers!
Jared Flynn
Motion DesignerSupermicro SuperWorkstation 7047A-T
Dual 8-core Xeon E5-2670 @ 2.6GHz
64GB DDR3-1600 ECC/REG RAM
PNY nVidia Quadro 4000
Windows 7 Pro 64bit SP1
