MAXON CINEMA 4D: Cinema 4D Forum Adobe After Effects Forum

Keyframe a property's speed over time

COW Forums : Maxon Cinema 4D

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jared FlynnKeyframe a property's speed over time
by on Sep 19, 2014 at 9:04:19 pm

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 Designer

Supermicro 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


Return to posts index


Brian JonesRe: Keyframe a property's speed over time
by on Sep 20, 2014 at 4:13:13 am

from what I'm reading this is what you are looking for - slider makes rotation faster or slower (in degrees per frame) - it resets to 0ยบ at frame zero (I assume you have a desired 'start point') if it loops or if you reset the playhead. Degree node is used as all rotations in xpresso are in radians so it translates the degrees from the slider to radians.
It? or not it?

8004_sliderrotspeedwithresetframezero.c4d.zip


Return to posts index

Jared FlynnRe: Keyframe a property's speed over time
by on Sep 22, 2014 at 2:32:21 pm

Hi there Brian,

This is exactly it! Thanks very much for posting this for me. So am I following correctly that the Time > Compare > Condition chain helps the rig reset to its original state? The rest of the setup is pretty similar to where I'd arrived originally, but of course yours actually works. :)

Thanks so much once again for taking the time!

Jared Flynn
Motion Designer

Supermicro 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


Return to posts index


Brian JonesRe: Keyframe a property's speed over time
by on Sep 22, 2014 at 3:25:20 pm

yeah the Compare receives the frame number and, if it's equal to zero, sends a boolean true (1) to the Condition node 'Switch' port. The Condition node then outputs a choice of whatever comes in from the left. It does the first port if it receives a '0' and the second one if it receives a '1' - so on frame 0 it resets to zero (because that's what's in the second spot inside the node - for clarity some people like to use a constant node feeding in so they can see what's going in rather than having to click on the node to see what value is in a non-connected port) and on all other frames it uses the first input and so the cog spins.


Return to posts index

Jared FlynnRe: Keyframe a property's speed over time
by on Sep 23, 2014 at 1:01:00 pm

Awesome, thanks so much for the insights! This really saved my bacon. :)

Cheers,

Jared Flynn
Motion Designer

Supermicro 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


Return to posts index

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