[Closed] Separate parent and local coordsys's?
I’m trying to generate a character rig. I want the parent-space rotations of every bone to be set to zero. I have done this, and offset the bone geometry back to make it look purty, but now my local-space rotations match the parent space ones. Can I have the local space rotations stay as they were when the bones were created but still initialize the parent-space rotations to all zeros?
I’m using Max 5.
Here’s a sample of the code:
b2 = BoneSys.createBone RankleLoc.pos RheelLoc.pos [0,-1,0]; --Create Right Ankle Bone
b2.width = 0.05;
b2.height = 0.05;
b2.parent = b1;
RankleOffsetRot = eulerAngles 0 0 0;
RankleOffsetRot.x = b2.rotation.x_rotation in coordsys parent;
RankleOffsetRot.y = b2.rotation.y_rotation in coordsys parent;
RankleOffsetRot.z = b2.rotation.z_rotation in coordsys parent; --find offset rotation values
in coordsys parent b2.rotation.x_rotation = 0; --align Ankle Rotation to parent
in coordsys parent b2.rotation.y_rotation = 0;
in coordsys parent b2.rotation.z_rotation = 0;
b2.objectOffsetRot = eulerToQuat RankleOffsetRot; --align to child using offset rotation values
Any thoughts would help… Thanks!
The most common way of zeroing out rotations using the UI is “Freeze Rotations/Transforms” found in the animation quad menu (alt+right click), not sure if this exists in max5 though
What this does is create a rotation list controller, With slot 1 containing your old rotation values, slot 2 contains a euler_xyz controller that is all zero’d out
Implementing this in maxscript should be pretty straight forward
the script could look something like this:
b2 = BoneSys.createBone RankleLoc.pos RheelLoc.pos [0,-1,0]
b2.width = 0.05;
b2.height = 0.05;
b2.parent = b1;
b2[3][2].controller = rotation_list() -- assign list controller to rotation
b2[3][2][2].controller = Euler_XYZ() -- assign euler controller to slot 2
b2[3][2].controller.active = 2 -- set second controller active
b2[3][2].controller.setname 1 "Inital Pose"
b2[3][2].controller.setname 2 "Keyframe"
Hey thanks, Aearon. Checking up on me, eh? As this is a pretty old thread, I’ve already solved that problem on my own (different way), but thanks for the tip!
oops didn’t even notice it was this old
hehe sort of, just noticed on your website that you’re using both max and maya, i’m thinking about trying to teach myself some maya, so that got me interested