def align_with_child(joints):
"""Aligns the up axis of the given joints with their respective child joint.
@param joints: List of joints to orient.
"""
for joint in joints:
children = _unparent_children(joint)
if children:
cmds.delete(cmds.aimConstraint(children[0], joint, aim=(1, 0, 0), upVector=(0, 1, 0),
worldUpType="objectrotation", worldUpVector=(0, 1, 0),
worldUpObject=children[0]))
cmds.makeIdentity(joint, apply=True)
_reparent_children(joint, children)
if joints:
cmds.select(joints)
评论列表
文章目录