31 lines
711 B
Python
31 lines
711 B
Python
|
#!/usr/bin/env python
|
|||
|
# -*- coding: utf-8 -*-
|
|||
|
|
|||
|
"""
|
|||
|
版权所有: 清泉时代科技有限公司
|
|||
|
联系方式: q.100@qq.com
|
|||
|
创建日期: 2023/08/08
|
|||
|
"""
|
|||
|
|
|||
|
import maya.cmds as cmds
|
|||
|
|
|||
|
def sg_get_blend_shape(mesh):
|
|||
|
"""
|
|||
|
获取指定网格的混合变形节点
|
|||
|
|
|||
|
参数:
|
|||
|
mesh (str): 网格名称
|
|||
|
|
|||
|
返回:
|
|||
|
str: 混合变形节点名称,如果没有找到则返回空字符串
|
|||
|
"""
|
|||
|
# 获取网格的历史记录
|
|||
|
history = cmds.listHistory(mesh) or []
|
|||
|
|
|||
|
# 遍历历史记录查找混合变形节点
|
|||
|
for node in history:
|
|||
|
if cmds.objectType(node) == "blendShape":
|
|||
|
return node
|
|||
|
|
|||
|
# 如果没有找到则返回空字符串
|
|||
|
return ""
|