[Closed] Setting a rotation in parent coords on Biped bone ?
Hi,
I have a question on Maxscript and Character Studio.
I have a rotation as a quaternion which is in parent coordinates.
Here is what I do to set it in world coordinates and set it on a bone, could you tell me if that’s wrong ?
As it doesn’t seem to work on all Biped bones, it works for some and doesn’t work on others…
[b]Code:[/b]
–Biped works in world coords only
–quat_rot is a rotation in parent coordinates
–bonenode is a Biped node from the biped hierarchy, it is the bone on which we are applying the rotation
parentrot = quat 0 0 0 1
if (bonenode.parent != undefined)then
(
parentrot = biped.gettransform (bonenode.parent) #rotation
)
quat_rot = quat_rot*parentrot
biped.settransform bonenode #rotation quat_rot true
I also have another question, there is another way to get the parent rotation of a Biped bone using :
[b]Code:[/b]
parentrot = biped.getparentnoderot bnipedbone
But this way don’t lead to the same result as using the code above with biped.gettransform, which one is good ?
I have tested :
[b]Code:[/b]
parentpos= [0,0,0]
parentrot = quat 0 0 0 1
sboneobj = $ –Get selected biped bone
if (sboneobj.parent != undefined)then
(
parentpos = biped.gettransform (sboneobj.parent) #pos
parentrot = biped.gettransform (sboneobj.parent) #rotation
)
messagebox (parentpos as string)
messagebox (parentrot as string)
parentpos = biped.getparentnodepos sboneobj
parentrot = biped.getparentnoderot sboneobj
messagebox (parentpos as string)
messagebox (parentrot as string)
And it gives the same result for the position…
Thank you.