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

23 lines
630 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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()