def deleteInstances(cls):
"""
Delete existing instances of this window
"""
result = False
# close and delete an existing workspace control
if cmds.workspaceControl(cls.getWorkspaceControlName(), q=True, ex=True):
cmds.workspaceControl(cls.getWorkspaceControlName(), e=True, close=True)
result = True
if cmds.workspaceControl(cls.getWorkspaceControlName(), q=True, ex=True):
cmds.deleteUI(cls.getWorkspaceControlName(), control=True)
result = True
if cmds.window(cls.OBJECT_NAME, q=True, ex=True):
cmds.deleteUI(cls.OBJECT_NAME, window=True)
result = True
return result
评论列表
文章目录