29 lines
765 B
Python
29 lines
765 B
Python
|
#!/usr/bin/env python
|
|||
|
# -*- coding: utf-8 -*-
|
|||
|
|
|||
|
"""
|
|||
|
版权所有: 清泉时代科技有限公司
|
|||
|
联系方式: q.100@qq.com
|
|||
|
创建日期: 2024/02/23
|
|||
|
"""
|
|||
|
|
|||
|
import maya.cmds as cmds
|
|||
|
|
|||
|
def sg_delete_joint_for_lod(lod):
|
|||
|
"""
|
|||
|
删除指定LOD级别不需要的关节
|
|||
|
|
|||
|
参数:
|
|||
|
lod (int): LOD级别
|
|||
|
"""
|
|||
|
# 获取所有关节和指定LOD级别的关节
|
|||
|
joint_all = cmds.SGGetJoints(lod=0, type="string")
|
|||
|
joint_lod = cmds.SGGetJoints(lod=lod, type="string")
|
|||
|
|
|||
|
# 找出需要删除的关节(在所有关节中但不在指定LOD级别中的关节)
|
|||
|
joint_del = list(set(joint_all) - set(joint_lod))
|
|||
|
|
|||
|
# 删除不需要的关节
|
|||
|
for joint in joint_del:
|
|||
|
if cmds.objExists(joint):
|
|||
|
cmds.delete(joint)
|