Notifications
Clear all

[Closed] spinner to control

Hi again,

recently i asked about scripting a spinner to control the rotation of an object. It worked.
but there is problem.
I basically wanted that to be controled, finger rotations (finger bones in y axis) of a hand.

but when I set those bones to zero (Alt + right crick) by pressing free transform, after that when I run the script it didn’t work. makes errors. How do i solve it.
the script to rotate the box,

[left]bxrol = newrolloutfloater “My dialog” 200 100[/left]

rollout myroll “Box rotate”
(
spinner sp1 “box rotate” range:[0,360,0] type:#float scale:1
on sp1 changed val do
(
$boxrot[size=2].rotation.controller.Z_Rotation = val[/size]
[size=2])[/size]
)
addrollout myroll bxrol

1 Reply

Hi ModelViz,

When you Zero Out in such a way an object, the controllers for position, rotation are replaced with a position_list, rotation_list, so your new script should be:


[left]bxrol = newrolloutfloater "My dialog" 200 100[/left]
 
rollout myroll "Box rotate"
(
spinner sp1 "box rotate" range:[0,360,0] type:#float scale:1
on sp1 changed val do
(
$boxrot[size=2][size=1][size=2].rotation.controller.Zero_Euler_XYZ.controller.Y_Rotation [/size]= val[/size][/size]
[size=2])[/size]
)
addrollout myroll bxrol

You can check this hierarchy by going into the Motion panel (the turning wheel next to the hierarchy panel) and expand the assign controller rollout and looking at the objects controller structure. Alternatively, you can check this in the curve editor.

Hope this helps,
Rafael Polit Jr.
Quito, Ecuador.