/
mncToolsAssetBlindDataDeleter.py
83 lines (72 loc) · 2.72 KB
/
mncToolsAssetBlindDataDeleter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
__author__ = 'andrew.willis'
#import module
import maya.cmds as cmds
#License Parsing==========================================================================================
import licenseParsing
licenseParsing.licParse()
class assetNodeDeleter:
def __init__(self):
if cmds.window('assetNodeDeleter', exists=True):
cmds.deleteUI('assetNodeDeleter', window=True)
if cmds.window('progressBarWindow', exists=True):
cmds.deleteUI('progressBarWindow', window=True)
cmds.window('assetNodeDeleter',t='Asset Node Deleter',s=False,w=200)
cmas=cmds.columnLayout(adj=True)
cmds.button(l='DELETE blindDataTemplate',c=lambda*args:self.deleteMode(0),w=300)
cmds.button(l='DELETE polyBlindData',c=lambda*args:self.deleteMode(1))
cmds.button(l='DELETE hyperView',c=lambda*args:self.deleteMode(2))
cmds.showWindow()
return
def deleteMode(self,mode):
if mode==0:
tempLis=[]
for chk in cmds.ls(type='blindDataTemplate'):
tempLis.append(chk)
cmds.window('progressBarWindow',s=False)
cmds.columnLayout(adj=True)
cmds.progressBar('progressBar',maxValue=len(tempLis),w=500)
cmds.showWindow()
cnt=0
for chk in tempLis:
try:
cmds.delete(chk)
except:
pass
cnt+=1
cmds.progressBar('progressBar',e=True,pr=cnt)
elif mode==1:
tempLis=[]
for chk in cmds.ls(type='polyBlindData'):
tempLis.append(chk)
cmds.window('progressBarWindow',s=False)
cmds.columnLayout(adj=True)
cmds.progressBar('progressBar',maxValue=len(tempLis),w=500)
cmds.showWindow()
cnt=0
for chk in tempLis:
try:
cmds.delete(chk)
except:
pass
cnt+=1
cmds.progressBar('progressBar',e=True,pr=cnt)
elif mode==2:
tempLis=[]
for chk in cmds.ls():
if chk.find('hyperView')!=-1:
tempLis.append(chk)
cmds.window('progressBarWindow',s=False)
cmds.columnLayout(adj=True)
cmds.progressBar('progressBar',maxValue=len(tempLis),w=500)
cmds.showWindow()
cnt=0
for chk in tempLis:
try:
cmds.delete(chk)
except:
pass
cnt+=1
cmds.progressBar('progressBar',e=True,pr=cnt)
cmds.deleteUI('progressBarWindow', window=True)
return
assetNodeDeleter()