rotation script controller Help

This information will be useful in the future: I started scripting 4 weeks ago

So here´s my problem... Im using a rotation script controller replacing the Euler XYZ for a DummyA in order to make it rotate reacting to the difference between two other dummies (B and C)
I use something like this in the scriptcontroller:

dependsOn $DummyB $DummyC
$DummyB.rotation - $DummyC.rotation

and it works like a champ... but when i try to apply some math to that value it doesn´t seem to be working at all, like

($DummyB.rotation - $DummyC.rotation) * 0.5

which i tried in order to make it rotate half of that value
My problem is that I need to use that rotation and paste it to other Dummies so they rotate half the speed and less like "* 0.8" or "* 0.2"
If I do this with wire parameters it works perfectly even if i rotate the master (DummyC) more than 180 degrees. This was not possible with orientation constraints.
My problem is that I can´t use wire parameters since this dummies are inside and parented to different objects in the scene and i´m trying to avoind solving it with one extra slider in my rig.

What am I doing wrong?
I found the slerp function for quaternions but when i try to use it inside of my controller it doesn´t seem to work
Please Help

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
MKlejnowski's picture

"it is what i was looking for

"it is what i was looking for in terms of how the values work but I´m still taking the value from the absolute x euler of the control... "

The values in a controller will always be in parent space if that help.

" I´t can´t be impossible to keep the last bone of that rig aligned to the control and the rest averaging to that rotation"

True but you need to depend on euler angles if this is what you want to achieve (there for you need to pull information from an object using a EulerXYZ for its rotation controller). So look at and orientation constraints wont help in this matter since they calculate using quat. 90% of the rotation in 3ds max depend and work with quat. Your gonna have to get creative in some way.

The program has no way of knowing your object rotated past 180 or -180 when using quat rotation. There for you need a Euler reference in this case. Wish i could help more but your gonna have to do something similar to what I showed you in the file to achieve what you want.

barigazy's picture

Look at this topic in MXS

Look at this topic in MXS HELP http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=fil...
U can use for quat conversations theses functions

quatToEuler2 <quat>
--example
rot = quatToEuler2 (in coordsys otherObj curObj.rotation)
--or
quatToEuler <quat> order:<eulertype_integer>

barigazy

lexloopor's picture

Well

I saw a few tutorials and also riggs for characters which have the same problem with the forearm... --i also saw very complex Riggs using an extra control for the rotation of the hand and and one control for the position of the ik solver.
I suppose that what i was looking for is either impossible or very difficult to achieve but anyways... with the learned stuff i am developping an autorig for arms and legs.... probably not the shortest way for the code regarding my script acknowledge but it´s working and it wires a huge amount of stretchy bones automatically... will post the code here when Im done... Thanks Again for your help with this Guys!

lexloopor's picture

almost there

I discovered that if I ask for rotinparent on any object it will give me the absolute value but if i apply an orientation constraint to it then i get valuez under 180°
Even after deleting the constraint the value was under 180° so I guess that when you apply a list controller something changes....

lexloopor's picture

values

barigazy: with those methods i always get values under 360 degrees... am i doing something wrong or there is just no way of getting the same values as the ones you get using the method "$.rotInParent"?

lexloopor's picture

BRB

Guys... thanks for your time...Im away from my PC till wednesday but if I solve the rig Ill share the files here next week... Will keep you up to date!

lexloopor's picture

another thing

when i try to use slerp on objects outside of this system it works but it jumps to other rotations when I move the master over 180 degrees

Basically I want to know if I can do with script controllers the same I do with wire parameters when I ask that one object´s rotation is another object rotation multiplied by 0.x. Making it work with angles above 180 and 360

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.