MetaFusion/scripts/utils/ResetBlendShapes.py
2025-02-07 05:10:30 +08:00

24 lines
671 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import maya.cmds as cmds
from scripts.utils.Core import GetMeshes, GetBlendShape, ResetBlendShape
def reset_blend_shapes():
"""
重置所有网格的混合变形目标名称
移除混合变形目标名称中的网格名称前缀
"""
# 遍历前50个网格
for j in range(50):
# 获取网格名称
mesh = GetMeshes(i=j)
blend_shape = f"{mesh}_blendShapes"
# 重置混合变形目标名称
if cmds.objExists(blend_shape):
ResetBlendShape(mesh, blend_shape)
# 如果直接运行此脚本
if __name__ == '__main__':
reset_blend_shapes()