删除空的reference


import pymel.core as pm
ref_nodes = pm.ls(references=True)
for ref_node in ref_nodes:
    try :
        ref_path = pm.referenceQuery(ref_node, filename=True)
    except :
        ref_node.unlock()
        pm.delete(ref_node, ref_node.listConnections())

评论
  目录