def make_planar(joints):
for joint in joints:
parent = cmds.listRelatives(joint, parent=True, path=True)
if not parent:
log.warning('Cannot make %s planar because it does not have a parent.', joint)
continue
children = _unparent_children(joint)
if not children:
log.warning('Cannot make %s planar because it does not have any children.', joint)
continue
cmds.delete(cmds.aimConstraint(children[0], joint, aim=(1, 0, 0), u=(0, 1, 0), worldUpType='object', worldUpObject=parent[0]))
cmds.makeIdentity(joint, apply=True)
_reparent_children(joint, children)
if joints:
cmds.select(joints)
评论列表
文章目录