MetaFusion/scripts/utils/RenameBlendShapes.py

23 lines
630 B
Python
Raw Permalink Normal View History

2025-02-07 05:10:30 +08:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import maya.cmds as cmds
from scripts.utils.Core import GetMeshes, RenameBlendShape
def rename_blend_shapes():
"""
重命名所有网格的混合变形目标
遍历前50个网格为每个混合变形目标添加网格名称前缀
"""
# 遍历前50个网格
for j in range(50):
# 获取网格名称
mesh = GetMeshes(i=j)
blend_shape = f"{mesh}_blendShapes"
# 重命名混合变形目标
RenameBlendShape(mesh, blend_shape)
# 如果直接运行此脚本
if __name__ == '__main__':
rename_blend_shapes()