def orient_to_world(joints):
"""Orients the given joints with the world.
@param joints: Joints to orient.
"""
for joint in joints:
children = _unparent_children(joint)
print children
parent = cmds.listRelatives(joint, parent=True, path=True)
orig_joint = joint.split('|')[-1]
if parent:
joint = cmds.parent(joint, world=True)[0]
cmds.joint(joint, e=True, oj='none', zso=True)
if parent:
joint = cmds.parent(joint, parent)[0]
print 'Renaming {0} to {1}'.format(joint, orig_joint)
joint = cmds.rename(joint, orig_joint)
_reparent_children(joint, children)
if joints:
cmds.select(joints)
评论列表
文章目录