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

28 lines
663 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import maya.cmds as cmds
def sg_rebuild_target(target_ids, blend_shape):
"""
重建混合变形目标
Args:
target_ids (list): 目标索引列表
blend_shape (str): 混合变形器名称
"""
# 清除选择
cmds.select(clear=True)
# 重建每个目标并选择
for target_id in target_ids:
rebuilt_target = cmds.sculptTarget(
blend_shape,
edit=True,
regenerate=True,
target=target_id
)
cmds.select(rebuilt_target, add=True)
# 如果直接运行此脚本
if __name__ == '__main__':
pass