34 lines
750 B
Python
34 lines
750 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
版权所有: 深圳时光科技有限公司
|
|
联系方式: q.100@qq.com
|
|
创建日期: 2023/08/08
|
|
"""
|
|
|
|
import maya.cmds as cmds
|
|
|
|
def sg_set_body_neutral_joint_translation():
|
|
"""
|
|
设置身体模型的关节中性位置
|
|
"""
|
|
# 获取身体模型
|
|
body_mesh = cmds.SGGetMeshes(m=50)
|
|
|
|
# 如果身体模型不存在,直接返回
|
|
if not cmds.objExists(body_mesh):
|
|
return
|
|
|
|
# 执行身体关节定位
|
|
cmds.SGBodyJointsLocator()
|
|
|
|
# 执行主要轴向修正
|
|
cmds.SGMainAmendAxis()
|
|
|
|
# 执行蒙皮轴向修正
|
|
cmds.SGSkinAmendAxis()
|
|
|
|
# 如果直接运行此脚本
|
|
if __name__ == '__main__':
|
|
sg_set_body_neutral_joint_translation() |