This one comes in handy a lot.
When you go to orient a group of joints, it never correctly orients the end joint in the chain. That frustrated me, so I decided to write a quick script that does it for you.
All it does is orient the selected and set the jointOrients of the last relative of the selected joint in the chain to zero. Obviously this doesn’t work in every situation, but I found it works great in small joint chain situations like FK feet.
If anything, it might save me some time from manually setting joint orientations. The more I can do that, the better 😛
import maya.cmds as cmds # orient joint chain # Orients the joints in a chain to normal attributes then nulls the orients # of the last joint def orientJointChain(): sel = cmds.ls(sl=1,o=1,type="joint") cmds.OrientJoint() jointChildren = cmds.listRelatives(sel,ad=1) endJoint = jointChildren cmds.setAttr(endJoint + ".jointOrientX",0) cmds.setAttr(endJoint + ".jointOrientY",0) cmds.setAttr(endJoint + ".jointOrientZ",0) orientJointChain()