# controlling a propeller's rotation speed?

hi. this have been asked many times, but i just don't seem to get the right answer.
here's the deal:
I have a circle spline that works as my control object. it has an attribute holder with custom attributes on it, a spinner, that will control my propeller's rotation speed.
then i have a point helper, positioned in the rotation axis, wich is this point helper's zero euler Z axis. then my rotor blade objects attached to the point helper, wich doesnt matter right now.

what i'm trying to achieve, is to make my propeller rotate whenever i set the spinner to something different than 0, if its like 1, it starts rotating, its -1 it rotates backwards. it doesnt really have to rotate backwards, but i believe thats the way it works. the only thing i need to have is the option to keyframe spinner values, meaning that rotation speed can be changed in realtime. so if anyone knows how to help me to achieve this, i'd be really glad.

## Comment viewing options

### thats right! thats what i

thats right!

thats what i wanted, mate!
now you got it :)

its not exactly that the rotation is controlled by the time slider, but it plays while i slide the time slider, like you did.

theres only one problem.
im only able to animate the rotor accelerating (going from rested state, to full speed rotation) if i keyframe my spinner value. if i simply increase the spinner value in realtime, while my animation is playing, the rotation will "bump" like it always was that speed, you know?

### hmm, ok yes i know... as we

hmm, ok yes i know...

the rotation 360 of degree is one-time spin into 360 frames

when increase the speed value into 2
the rotation 360 of degree is Double-spin into 360 frames.
so if we want smooth animation , we must add key of speed into frame 180 (like result of 360/2 )

when increase the speed value into 3
the rotation 360 of degree is three times a spin into 360 frames.
so if we want smooth animation, we must add key of speed into frame 120 (like result of 360/3 )

and etc ...

actually, I can not resolved about that for instantly right now,
I didn't promise you to soon but if I found a solution or something like it, I'll be back for this case.

maybe the other guys can help this out

### theres no need mate, im

theres no need mate, im totally satisfied with the current result.
ive seen people made it work somewhere, but that involved storing the old rotation, and increasing the value from that, but that would create automatic keyframes, rotate forward even if you scrub the timeline backwards, and bug a lot, so im totally happy with the current result :)
thank you so much

### ok, you'r welcome :)

ok, you'r welcome :)

### Assign speed via Expression scripts

a simply script, like :

`spin*speed`

This is a simple tutorial to assign speed value via Expression scripts of the object rotation controller.

1. create/select object (circle or cylinder) with custom attributes including spinner for rotation.
(do not need assign wire parameter)
2. go to motion panel, select rotation controller then assign 'Rotation Script'
3. on a dialog script rotation controller, create variable with name "spin" then select "spin"
4. click 'Assign Track' buttons, then pick your target spinner
5. put this script into a listbox of Expression

```speed = 1 -- put any number, the greater the value means that the faster, and 0 value means it does'nt move

angle = spin*speed -- combine

quat angle [0,0,1] -- example for z rotation```

6. next click 'evaluate' buttons ... done.
7. now you can check rotation of the object by your spinner

About speed, You can change speed value by put any number you want.

Or you can create new spinner for speed into custom attributes.
create variable again in second call name is "speed" then click 'assign track' again to choose 'speed' spinners.

in old script you just delete `'speed = 1'` text, results like this:

```angle = spin*speed -- combine

quat angle [0,0,1] -- example for z rotation```

### thanks bud! result isnt

thanks bud!
result isnt exactly what i wanted, but that can be a start
the problem is that with this expression, my spinner simply controls the angle. when i change my spinner value, the object rotates, instead of rotating when i hit play, at a speed given by the spinner.
any ideas?

thanks again for helping me out :)

### sorry if I misunderstanding

sorry if I misunderstanding :)

hmm, did you mean the object rotation should be controlled by time slider ?
and wich mean should 'speed' be controlled by spinner ?

if that what is in my mind and that's what you mean, perhaps in bellow is just for a clue.

After selected circle and created new spinner for speed into custom attributes.
1. create variable call name is "need4speed" in 'Rotation Script' controller
2. click 'Assign Track' buttons, then pick your target is speed spinners
3. put this script into a listbox of Expression

```spintime = currenttime -- The Time slider as spin angle controller

angle = spintime*need4speed -- combine

quat angle [0,0,1] -- example for z rotation```

4. next click 'evaluate' buttons ... done.
5. now you can check automatic rotation of the object by moving time slider or by hit play animation buttons.
so about speed you can change speed value by spinner.

if the result still is'nt exactly what you wanted, can you give me your scene progess or image screenshot ? just for sure

thx

### Great! Thank You! My first

Great! Thank You! My first steps in scripting done thanks to You.

bump...