- #This function will return the side of the body the passed joint is on
- #note, it assumes that the character is oriented down the Z axis with the joint's X transform being to either side of the character
- #assumes no nulls or intermediate joints exist above the joint being passed
- import maya.cmds as cmds
- def detectSideOfBody(jointToCalculate):
- transformPosition = cmds.xform(jointToCalculate, query = True, translation = True)
- '''The following decides whether the selected joint is on the right or left hand side of the body acording to its position in X
- Note! this assumes that the skeleton was setup with the standard facing down the Z axis with Y being world up and
- X as the midline(saggital) axis.
- global globalSideOfBody
- if(transformPosition > 0):
- sideOfBody = 'Lft'
- sideOfBody = 'Rt'
- return sideOfBody