'ChainFixer by David Gallagher dave@cineframe.com
'This script removes all rotation values from the first
'joint of a chain and puts that rotation into the chain
'root. That makes the rest pose of the first joint equal
'to zero.
'Select the first joint of a chain then run the script.
'
currSelection = GetValue( "SelectionList" )
boneZAngle = GetValue ( currSelection & ".kine.local.rotz")
boneYAngle = GetValue ( currSelection & ".kine.local.roty")
boneXAngle = GetValue ( currSelection & ".kine.local.rotx")
SelectNeighborObj currSelection, 0, "NODE", False
Rotate , 0, 0, boneZAngle, siRelative, siLocal, siObj, siXYZ
Rotate , 0, boneYAngle, 0, siRelative, siLocal, siObj, siXYZ
Rotate , boneXAngle, 0, 0, siRelative, siLocal, siObj, siXYZ
SelectObj currSelection
Rotate , 0, 0, 0, siAbsolute, siParent, siObj, siZ
Rotate , 0, 0, 0, siAbsolute, siParent, siObj, siY
Rotate , 0, 0, 0, siAbsolute, siParent, siObj, siX