Maya type filter
Maya type filter
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
未经博主允许,禁止直接转载本博客任何内容(可以在文章中添加链接,禁止原文照搬),如需直接原文转载对应文章,请在该文章中留言联系博主,谢谢!!