Notifications
Clear all

[Closed] Additive rotations – possible?

Hi there,

I have a problem I can’t find solution to. I need to rotate a wheel (a propeller) but based on a multiplier so that it accelerates – rotates at full throttle – deccelerates – and stops.

If I try to wire it, script it or whatever I always end up with a propeller that accelerates but as soon as the multiplier number decreases the propeller stops and then rotates back to 0.0

I need a gradual animation that stops where it deccelerated and not return back to it’s original orientation.

I thought of adding up to the propellers rotation value with every frame the animation proceeds, but I have no idea how.

If you know of any better way or any hints, tips, tricks, I’d very much appretiate it!

Thank you in advance!

16 Replies

hey dude check the attached file. I’m not sure why the spinning seems to slow down when the multiplyer stops accelerating but its a start at least!

Heya, Gravey, thanks a lot for your input man.

However, this is exactly what I end up with no matter what approach I choose (Wiring, Scripting, Constraining…) 🙁

Thtat’s why I’m searching for some sort of additive rotational increments.

In your example, if you decrease the multiplier, the propeller stops and then rotates backwards until it stops completely at its original orientation 🙁

ah yes i didnt actually try animating it backwards. that is weird! its beyond me why that would happen. maybe someone who’s good at math could solve the problem…

 rdg

Hi loocas,

this is my version for this issue:


 global oldrot
 if oldrot == undefined then (
 	global oldrot = me_start
 )
 if F <= 0.1 then (
 	oldrot = newrot = me_start
 	
 )else(
 	newrot = oldrot + me_speed
 	oldrot = newrot
 )
 newrot

It works like this:

The old rotation is stored in a global variable ‘oldrot’.
On frame 1 the rotation is set to a start value, controlled by a custum attribute.
On any other frame the ‘speed’ is added to the old rotation and the new rotation is stored in old rotation.

Speed isn’t the right term – it is more a increment. But the higher the faster the rotation.

I must admit that I don’t like the use of a global variable but all my tries to store the old rotation value into a custom attribute didn’t work.

If someone knows a workaround to store the old value, I’d be glad to hear.

This is the standard flash approach of moving stuff around.

Georg

PS: I loved your nokia tutorial.

 rdg

But my setup got issues with the start rotation as well …

Guess thats why I never used it

maybe I can find a way to fix this.

Georg

 eek

Use a sawtooth wave and control its phase offset by bezier curve with (FA/T) – This will allow for total animator control. If i get time today, i’ll try and explain more.

RDG,

The old value could be stored in a struct variable call by a fn, or even refTransform node variable. Eg. $box.refNode.node.‘ca’.attribute… dont know if thats possible. Storing a reference to a node custom attribute value.

 rdg

I had a typo in my script-controller.
Also it looks like:
when playing the animation in loop mode max sometimes skips frame 1.
If I stop and goto frame 1 manually everything look ok.

eek:
if you find the time to add some sentences – it would be great – currently I read that there is a easy and professional way but I understand :argh:.
<- I am referring to the sawtooth thing.


I stored the oldrot in a #floattab attached to a CA of the propeller.
It updated and if I added a print statement to the script controller it showed the ‘right/changing’ values but it didn’t use it for animation.
I guess there is a lack of very basic knowledge … but I will fight it down!

Georg

 rdg

ok. now I know that a floatTab isn’t somekind of fancy ‘solve it all’ float. its just a array of floats and useless for this.

In the attached file I store the oldrotation value in a custom-attribute.

It only plays in the viewport if the proprties of the scriptcontroller are closed. That’s why it didn’t work last time I tried.

The oldrotation as a spinner is somewhat diffucult.
If you are trying to animate the increment with auto key the oldrot spinner sets keys also.
The only way to animate the increment is in the trackview -> bad bad bad.

Also the rotation now changed to radians.
0 = 0°. pi/2 = 90° and so on.

Georg

 eek

sawtooth – this is just the top off my head (so im in ideas mode) we derive a sawtooth wgoing from 0 to 180, the phase shift is tied to two frame values, a start and an end frame. We use a fn to check if the slidertime or frame is before the first value to start the phase of the wave -before it we set the value to 0. The end value references an updating variable in a struct that the function calls. If the slidertime/f is past the end value we use this updated struct variable – essentially cutting off the rotors mid revolution albeit slowed down.

We could tie in a squared sin wave after this end frame using the struct variable – this would add the little springing part when the rotors stop.

Something like that.

Page 1 / 2