MetaFusion/scripts/Reference/SGRebuildTarget.py
2025-01-17 02:30:36 +08:00

34 lines
769 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
版权所有: 深圳时光科技有限公司
联系方式: q.100@qq.com
创建日期: 2023/08/08
"""
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