24 lines
647 B
Python
24 lines
647 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import maya.cmds as cmds
|
|
from scripts.utils.Core import GetJoints, SetNeutralJointTranslations
|
|
|
|
def refresh_neutral_joint_translation():
|
|
"""
|
|
刷新关节的中性位置平移值
|
|
"""
|
|
# 获取所有关节
|
|
joints = GetJoints()
|
|
|
|
# 遍历每个关节
|
|
for i, joint in enumerate(joints):
|
|
# 获取关节的平移值
|
|
pos = cmds.getAttr(f"{joint}.t")[0]
|
|
|
|
# 设置关节的中性位置
|
|
SetNeutralJointTranslations(i, pos[0], pos[1], pos[2])
|
|
|
|
# 如果直接运行此脚本
|
|
if __name__ == '__main__':
|
|
refresh_neutral_joint_translation() |