def orientJointChain(*args):
#---------------- this doens't actually work. dot doesn't represent the relationship btw orients
cmds.joint(jnts[0], e=True, oj="xyz", secondaryAxisOrient="ydown", ch=True, zso=True)
#print cmds.getAttr("{}.jointOrient".format(cmds.ls(sl=True)[0]))
for y in range(1, len(jnts)):
v1 = cmds.getAttr("{}.jointOrient".format(jnts[0]))[0]
v2 = cmds.getAttr("{}.jointOrient".format(jnts[y]))[0]
dotN = mth.dotN(v1, v2) # figure out how to reverse joint orientation
if dotN < 0:
print jnts[y], "dot neg"
# reorient (inverse secondary axis)
# for jnt in jnts:
# print mth.dotN(cmds.getAttr("{}.jointOrient".format(jnts[0]))[0], cmds.getAttr("{}.jointOrient".format(jnt))[0])
评论列表
文章目录