def __init__(self): import pymel.core as pm pm.runtime.DisplayShaded() # Setup the scene the Turbine way utils.sceneSetup(self) # Find all the available characters characters = turbineUtils.findAllRigFiles("GEPPETTO/Rig") # Warning if no characters exist if len(characters)==0: cmds.confirmDialog(title="Character Install", message="No published characters found, aborting install", button=["Accept"], defaultButton="Accept") return self.UIElements = {} if cmds.window("installCharacter_UI_window", exists=True): cmds.deleteUI("installCharacter_UI_window") windowWidth = 320 windowHeight = 190 self.UIElements["window"] = cmds.window("installCharacter_UI_window", width=windowWidth, height=windowHeight, title="Install Character", sizeable=False) self.UIElements["topColumn"] = cmds.columnLayout(adj=True, columnOffset=["both", 5], rs=3) self.UIElements["characterList"] = cmds.textScrollList(numberOfRows=9, allowMultiSelection=False, append=characters, selectIndexedItem=1) cmds.separator() self.UIElements["newCharacterButton"] = cmds.button(label="Create New Character", c=self.installCharacter) cmds.separator() cmds.showWindow(self.UIElements["window"])
def __init__(self): # Setup the scene the Turbine way utils.sceneSetup(self) """ Dict for UIElements """ self.UIElements = {} self.rigFiles = {} self.rigs = {} self.setupFile = {} self.rigFile = {} self.characterNamespace = {} self.setupDir = {} self.characterName = {} refUtils = referenceUtils.Reference_Utils() self.rigFiles['rigFiles'] = refUtils.findRigs()[0] self.rigs['rigs'] = refUtils.findRigs()[1] print self.rigFiles['rigFiles'] print self.rigs['rigs'] print self.rigs['rigs'] """ If the window exists, delete it. """ if cmds.window("charRefWindow", exists=True): cmds.deleteUI("charRefWindow") self.windowWidth = 420 self.windowHeight = 300 fieldWidth = (self.windowWidth - 10) fieldHeight = (self.windowHeight - 60) self.buttonWidth = fieldWidth columnOffset = 5 buttonColumnWidth = self.buttonWidth + (2*columnOffset) textScrollWidth = (self.windowWidth - buttonColumnWidth) # Create the main window mainWindow = self.UIElements["window"] = cmds.window("charRefWindow", width=self.windowWidth, height=self.windowHeight, s=True) # Create a couple flow layouts to hold the UI Elements for setup tools self.UIElements["buttonColumnLayout"] = cmds.flowLayout(h=self.windowHeight, v=True) self.UIElements["rigList"] = cmds.textScrollList(numberOfRows=20, allowMultiSelection=False, append=self.rigs['rigs'], width=fieldWidth, h=fieldHeight, fn="boldLabelFont", dcc=self.getFileForReference) cmds.separator( height=5, style='in' ) self.UIElements['button'] = cmds.button( label='Reference Character', width=self.buttonWidth, c=self.setupPicker_UI) cmds.setParent(self.UIElements["buttonColumnLayout"]) cmds.showWindow(self.UIElements["window"])
def __init__(self): import pymel.core as pm pm.runtime.DisplayShaded() # Setup the scene the Turbine way utils.sceneSetup(self) # Find all the available characters characters = turbineUtils.findAllRigFiles("GEPPETTO/Rig") # Warning if no characters exist if len(characters) == 0: cmds.confirmDialog( title="Character Install", message="No published characters found, aborting install", button=["Accept"], defaultButton="Accept") return self.UIElements = {} if cmds.window("installCharacter_UI_window", exists=True): cmds.deleteUI("installCharacter_UI_window") windowWidth = 320 windowHeight = 190 self.UIElements["window"] = cmds.window("installCharacter_UI_window", width=windowWidth, height=windowHeight, title="Install Character", sizeable=False) self.UIElements["topColumn"] = cmds.columnLayout( adj=True, columnOffset=["both", 5], rs=3) self.UIElements["characterList"] = cmds.textScrollList( numberOfRows=9, allowMultiSelection=False, append=characters, selectIndexedItem=1) cmds.separator() self.UIElements["newCharacterButton"] = cmds.button( label="Create New Character", c=self.installCharacter) cmds.separator() cmds.showWindow(self.UIElements["window"])
def __init__(self): # Setup the scene the Turbine way utils.sceneSetup(self) self.previousBlueprintListEntry = None self.previousBlueprintModule = None self.previousAnimationModule = None baseIconsDir = os.environ["GEPPETTO"] + "/Icons/" self.selectedCharacter = self.findSelectedCharacter() if self.selectedCharacter == None: return self.characterName = self.selectedCharacter.partition("__")[2] self.windowName = self.characterName + "_window" self.UIElements = {} if cmds.window(self.windowName, exists=True): cmds.deleteUI(self.windowName) self.windowWidth = 420 self.windowHeight = 730 self.UIElements["window"] = cmds.window(self.windowName, width=self.windowWidth, height=self.windowHeight, title = "Animation UI: " + self.characterName, sizeable=False) self.UIElements["topColumnLayout"] = cmds.columnLayout(adj=True, rs=3) buttonWidth = 32 columnOffset = 5 buttonColumnWidth = buttonWidth + (2*columnOffset) textScrollWidth = (self.windowWidth - buttonColumnWidth - 8) /2 self.UIElements["listBoxRowLayout"] = cmds.rowLayout(nc=3, columnWidth3=[textScrollWidth, textScrollWidth, buttonColumnWidth], columnAttach=([1, "both", columnOffset], [2, "both", columnOffset], [3, "both", columnOffset])) self.UIElements["blueprintModule_textScroll"] = cmds.textScrollList(numberOfRows=12, allowMultiSelection=False, selectCommand=self.refreshAnimationModuleList) self.initialiseBlueprintModuleList() self.UIElements["animationModule_textScroll"] = cmds.textScrollList(numberOfRows=12, allowMultiSelection=False, selectCommand=self.setupModuleSpecificControls) self.UIElements["buttonColumnLayout"] = cmds.columnLayout() #self.UIElements["pinButton"] = cmds.symbolCheckBox(onImage=baseIconsDir+"_pinned.bmp", offImage=baseIconsDir+"_unpinned.bmp", width=buttonWidth, height=buttonWidth, onCommand=self.deleteScriptJob, offCommand=self.setupScriptJob) self.UIElements["zeroModulesButton"] = cmds.symbolButton(image=baseIconsDir+"_zeroPose.bmp", width=buttonWidth, height=buttonWidth, enable=False, annotation='Set all Animation Controls %100 to the Creation Pose', c=self.zeroModWeightsA) #if cmds.objExists(self.selectedCharacter+":non_blueprint_grp"): #value = cmds.getAttr(self.selectedCharacter+":non_blueprint_grp.display") #self.UIElements["nonBlueprintVisibility"] = cmds.symbolCheckBox(image=baseIconsDir+"_geoVis.bmp", width=buttonWidth, height=buttonWidth, onCommand=self.toggleNonBlueprintVisibility, offCommand=self.toggleNonBlueprintVisibility) value = cmds.getAttr(self.selectedCharacter + ":character_grp.animationControlVisibility") self.UIElements["animControlVisibility"] = cmds.symbolCheckBox(image=baseIconsDir+"_ctrlVis.bmp", width=buttonWidth, height=buttonWidth, onCommand=self.toggleAnimControlVisibility, annotation='Hide all Animation Controls', offCommand=self.toggleAnimControlVisibility) self.UIElements["deleteModuleButton"] = cmds.symbolButton(image=baseIconsDir+"_shelf_delete.bmp", width=buttonWidth, height=buttonWidth, enable=False, annotation='Delete an Animation Module', c=self.deleteSelectedModule) self.UIElements["duplicateModuleButton"] = cmds.symbolButton(image=baseIconsDir+"_duplicate.bmp", width=buttonWidth, height=buttonWidth, enable=False, annotation='Duplicate an Animation Module', c=self.duplicateSelectedModule) cmds.setParent(self.UIElements["topColumnLayout"]) cmds.separator() # 159 > self.UIElements["activeModuleColumn"] = cmds.columnLayout(adj=True) self.setupActiveModuleControls() cmds.setParent(self.UIElements["topColumnLayout"]) cmds.separator() self.UIElements["matchingButton"] = cmds.button(label="Match Controls to Result", annotation='This is the FK/IK Switch', enable=False) cmds.separator() # < 159 # 175 > # Setup space switching UI self.UIElements["spaceSwitchingColumn"] = cmds.columnLayout(adj=True) self.setupSpaceSwitchingControls() cmds.setParent(self.UIElements["topColumnLayout"]) cmds.separator() # < 175 cmds.rowColumnLayout(nr=1, rowAttach=[1, "both", 0], rowHeight=[1, self.windowHeight-395]) self.UIElements["moduleSpecificControlsScroll"] = cmds.scrollLayout(hst=0) scrollWidth = cmds.scrollLayout(self.UIElements["moduleSpecificControlsScroll"], q=True, scrollAreaWidth=True) self.UIElements["moduleSpecificControlsColumn"] = cmds.columnLayout(columnWidth=scrollWidth+300, columnAttach=["both", 5]) self.refreshAnimationModuleList() self.setupScriptJob() # Shows a new window for each character. Tab these? #cmds.showWindow (self.UIElements["window"]) #pane1 = cmds.paneLayout( configuration='single', parent=self.UIElements["window"]) #allowedAreas = ['right', 'left'] #cmds.dockControl( area='left', content=self.UIElements["window"], allowedArea=allowedAreas, l="AnimationUI") cmds.showWindow(self.windowName) self.selectionChanged()
def __init__(self): # Setup the scene the Turbine way utils.sceneSetup(self) """ Dict for UIElements """ self.UIElements = {} self.rigFiles = {} self.rigs = {} self.setupFile = {} self.rigFile = {} self.characterNamespace = {} self.setupDir = {} self.characterName = {} refUtils = referenceUtils.Reference_Utils() self.rigFiles['rigFiles'] = refUtils.findRigs()[0] self.rigs['rigs'] = refUtils.findRigs()[1] print self.rigFiles['rigFiles'] print self.rigs['rigs'] print self.rigs['rigs'] """ If the window exists, delete it. """ if cmds.window("charRefWindow", exists=True): cmds.deleteUI("charRefWindow") self.windowWidth = 420 self.windowHeight = 300 fieldWidth = (self.windowWidth - 10) fieldHeight = (self.windowHeight - 60) self.buttonWidth = fieldWidth columnOffset = 5 buttonColumnWidth = self.buttonWidth + (2 * columnOffset) textScrollWidth = (self.windowWidth - buttonColumnWidth) # Create the main window mainWindow = self.UIElements["window"] = cmds.window( "charRefWindow", width=self.windowWidth, height=self.windowHeight, s=True) # Create a couple flow layouts to hold the UI Elements for setup tools self.UIElements["buttonColumnLayout"] = cmds.flowLayout( h=self.windowHeight, v=True) self.UIElements["rigList"] = cmds.textScrollList( numberOfRows=20, allowMultiSelection=False, append=self.rigs['rigs'], width=fieldWidth, h=fieldHeight, fn="boldLabelFont", dcc=self.getFileForReference) cmds.separator(height=5, style='in') self.UIElements['button'] = cmds.button(label='Reference Character', width=self.buttonWidth, c=self.setupPicker_UI) cmds.setParent(self.UIElements["buttonColumnLayout"]) cmds.showWindow(self.UIElements["window"])