def is_mesh(obj):
    isMesh = False
    obj_str = str(obj)
    if cmds.objExists(obj_str):
        meshType = 'mesh'
        
        if cmds.nodeType(obj_str) == meshType:
            return True
        
        shapeNodes = cmds.listRelatives(obj_str, shapes=True)
        if shapeNodes:
            isMesh = True
            for shapeNode in shapeNodes:
                nodeType = cmds.nodeType(shapeNode)
                if nodeType != meshType:
                    isMesh = False
                    break
    return isMesh

 

def is_group(groupName):
    try:
        children = cmds.listRelatives(groupName, children=True)
        for child in children:
            if not cmds.ls(child, transforms = True):
                return False
        return True
    except:
        return False

相关文章:

  • 2021-07-08
  • 2021-11-29
  • 2021-09-04
  • 2021-08-19
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-04-08
  • 2022-12-23
  • 2021-11-25
  • 2021-11-18
相关资源
相似解决方案