def buildTreeA(self,*args):
if self.selShot and self.selScript:
tree=''
if self.bottomTab.currentIndex()==0:
tree=self.RendersInTreeA
if self.bottomTab.currentIndex()==1:
tree=self.RendersOutTreeA
if self.bottomTab.currentIndex()<2:
tree.clear()
projectPath=self.template_nukeScriptPath.replace("shotNum",self.selShot)
nukeFile=projectPath+"/"+self.selScript
seqs=getNukeScriptSeqs(nukeFile,self.searchDir3D)
#remove incoming from paths
pathsOnly=[]
for seq in seqs:
#only list beauty files
#if "beauty" in seq:
pathsOnly.append(filterPath(seq,self.searchDir3D))
pathTree=buildTreeFromPaths(pathsOnly)
#build Tree
dicts=[[pathTree,tree]]
for dict,parent in dicts:
for k in dict.keys():
item=QtGui.QTreeWidgetItem()
item.setText(0,k)
if type(parent) is QtGui.QTreeWidget:
if not item.text(0)=='<files>':
tree.insertTopLevelItem(0,item)
if type(parent) is QtGui.QTreeWidgetItem:
if not item.text(0)=='<files>':
parent.addChild(item)
if type(dict[k]) is collections.defaultdict:
dicts.append([dict[k],item])
#print "found dict",k
if type(dict[k]) is list and type(parent) is not QtGui.QTreeWidget:
for i in dict[k]:
item=QtGui.QTreeWidgetItem()
item.setText(0,i)
parent.addChild(item)
tree.sortItems(0,QtCore.Qt.AscendingOrder)
评论列表
文章目录