def cmb001(self): #recent projects index = self.ui.cmb001.currentIndex( ) #get current index before refreshing list files = (list( reversed(mel.eval("optionVar -query RecentProjectsList;")))) func.comboBox(self.ui.cmb001, files, "Recent Projects") if index != 0: maxEval('setProject "' + files[index] + '"') self.ui.cmb001.setCurrentIndex(0)
def cmb003(self): #import index = self.ui.cmb003.currentIndex( ) #get current index before refreshing list func.comboBox(self.ui.cmb003, ["Import file", "Import Options"], "Import") if index != 0: #hide hotbox then perform operation self.hotBox.hbHide() if index == 1: #Import maxEval('Import;') if index == 2: #Import options maxEval('ImportOptions;') self.ui.cmb003.setCurrentIndex(0)
def cmb002(self): #recent autosave index = self.ui.cmb002.currentIndex( ) #get current index before refreshing list files = [ file_ for file_ in ( list(reversed(mel.eval("optionVar -query RecentFilesList;")))) if "Autosave" in file_ ] func.comboBox(self.ui.cmb002, files, "Recent Autosave") if index != 0: force = True force if str( mel.eval("file -query -sceneName -shortName;") ) else not force #if sceneName prompt user to save; else force open pm.openFile(files[index], open=1, force=force) self.ui.cmb002.setCurrentIndex(0)
def cmb001(self): #currently selected objects index = self.ui.cmb001.currentIndex( ) #get current index before refreshing list items = func.comboBox(self.ui.cmb001, [str(s) for s in pm.ls(selection=1, flatten=1)], "Currently Selected") if index != 0: pm.select(items[index]) self.ui.cmb001.setCurrentIndex(0)
def cmb000(self): #List selection sets index = self.ui.cmb000.currentIndex( ) #get current index before refreshing list sets = func.comboBox( self.ui.cmb000, [str(set_) for set_ in pm.ls(et="objectSet", flatten=1)], "Sets") if index != 0: pm.select(sets[index]) self.ui.cmb000.setCurrentIndex(0)
def cmb000(self): #existing materials index = self.ui.cmb000.currentIndex( ) #get current index before refreshing list materials = func.comboBox(self.ui.cmb000, [str(mat) for mat in pm.ls(materials=1)], "Existing Materials") if index != 0: print materials[index] # shader = pm.shadingNode (mat, asShader=1) #asShader, asTexture, asLight pm.hyperShade(assign=materials[index]) self.ui.cmb000.setCurrentIndex(0)
def cmb004(self): #export index = self.ui.cmb004.currentIndex( ) #get current index before refreshing list func.comboBox( self.ui.cmb004, ["Export Selection", "Export Options", "Unreal", "Unity", "GoZ"], "Export") if index != 0: #hide hotbox then perform operation self.hotBox.hbHide() if index == 1: #Export selection maxEval('ExportSelection;') if index == 2: #Export options maxEval('ExportSelectionOptions;') if index == 3: #Unreal maxEval('SendToUnrealSelection;') if index == 4: #Unity maxEval('SendToUnitySelection;') if index == 5: #GoZ maxEval( 'print("GoZ"); source"C:/Users/Public/Pixologic/GoZApps/Maya/GoZBrushFromMaya.mel"; source "C:/Users/Public/Pixologic/GoZApps/Maya/GoZScript.mel";' ) self.ui.cmb004.setCurrentIndex(0)
def b034(self): #add selected components to cmb000 func.comboBox(self.ui.cmb000, pm.ls(selection=1, flatten=1))