orientjoints.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:cmt 作者: chadmv 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号