def __init__(self, parentRef=None, mmmmToolsRef=None): self.mmmmTools = mmmmToolsRef self.parentRef = parentRef self.scriptFileRunner = MmmmScriptFileRunner( parentRef=self, mmmmToolsRef=self.mmmmTools) self.scriptFileRunner.findScripts() self.win = pm.window("Script File Runner") self.ddMenuEntires = [] with self.win: self.col = pm.columnLayout() with self.col: self.textPath = pm.text("Path to scripts:") self.textFieldPath = pm.textField( text=self.scriptFileRunner.searchPath, width=400, changeCommand=lambda x: self.onTextPathChangeCommand()) self.btnRefresh = pm.button("Refresh Scripts", command=lambda x: self.buildMenu()) self.text = pm.text("Script File To Run:") self.ddMenu = pm.optionMenu(changeCommand=self.onDdMenuChange) self.buildMenu() ## self.textFieldScript = pm.textField( width=500 ) self.btnRunScript = pm.button( "Run Script", command=lambda x: self.scriptFileRunner.runScript( self.chosenScript)) self.win.show()
def changePresetPreComp(self): if not self.bashMode: value = pm.optionMenu(self.UI.preCompNuke_CB, query=True, value=True) pm.setAttr('vraySettings.deeXVrayFastLastPresetPreComp', value, type='string') self.actualPresetPrecomp = value else: pm.setAttr('vraySettings.deeXVrayFastLastPresetPreComp', self.actualPresetPrecomp, type='string') self.preCompInit() self.refresh()
def __init__(self): self.win=pm.window() with self.win: self.col = pm.columnLayout() with self.col: self.label1 = pm.text( "Attribute Group Name (To Be Added)" ) self.dropdown = pm.optionMenu( "menu", changeCommand = self.onDropDownChange ) with self.dropdown: for i,v in enumerate(addableAttrList): pm.menuItem( v ) self.attrNameField = pm.textField( ) self.addAttrButton = pm.button( "Add Attribtutes!", command = lambda x: self.addAttributeGroup( self.attrNameField.getText() ) ) self.win.show()
def __init__(self, parentRef, parentWidget=None, mmmm=None ): self.parentRef = parentRef self.buttons = [] self.widgets = {} self.mmmm = mmmm if parentWidget==None: parentWidget = self.widgets['parentWidget'] = pm.Window( sizeable = True, title = "Mmmm Hotkeys Manager", titleBar=True ) else: self.widgets['parentWidget'] = parentWidget with parentWidget: self.layout = pm.columnLayout() with self.layout: self.widgets['editorBtn'] = pm.button( "Maya Hotkey Editor Window...", annotation= "Open the Maya's default builtin hotkey editor window. " + " There is nothing MmmmTools specific about this, it's just a shortcut.", command='pm.mel.eval("HotkeyPreferencesWindow;")', ) self.widgets['infoText'] = pm.text("\nInstructions (read tooltip, hover here)\n", annotation = "Note that users should avoid editing the hotkey sets \n" + "starting with Mmmm. If you wish to modify them, \n" + "you should duplicate the Mmmm keyset you want to modify, \n" + "rename, so it does not start with Mmmm, and make change to your own copy. \n\n" + "Changing the Mmmm keySets themselves requires writing/altering python code. \n" + "Our recommendation is that for your own hotkeys, you make your own hotkey sets, \n" + "and switch to them as necessary. (See other button tooltips for more info.)" ) self.widgets['nextKeySetBtn'] = pm.button( "Next Hotkey Set", command = lambda x: self.parentRef.nextKeySet(), annotation="Go to the next keyset, in alphabetical order. \n\n " + "In case you want to add it to a shelf/button: \n" + "The mel command to do this is: MmmmCmds__Hotkeys__NextKeySet", ) self.widgets['prevKeySetBtn'] = pm.button( "Prev Hotkey Set", command = lambda x: self.parentRef.prevKeySet(), annotation="Go to the previous keyset, in alphabetical order. \n\n " + "In case you want to add it to a shelf/button: \n" + "The mel command to do this is: MmmmCmds__Hotkeys__PrevKeySet", ) #self.widgets['refreshListBtn'] = pm.button( "Refresh Hotkey Set Dropdown List" ) self.widgets['dropdownLabel'] = pm.text("\n Choose active hotkey set:", annotation="You may need to either click the refresh button, " +"or if that is unavailable, close and reopen this window, to refresh the list." ) self.widgets['dropdown'] = pm.optionMenu( "MmmmKeySetDropdownMenu", changeCommand = self.onDropDownChange, ) keySets = pm.hotkeySet( query=True, hotkeySetArray=True) keySets.sort() for keySet in keySets : pm.menuItem( keySet )
class ScriptFileRunnerUi(object): def __init__(self, parentRef=None, mmmmToolsRef=None): self.mmmmTools = mmmmToolsRef self.parentRef = parentRef self.scriptFileRunner = MmmmScriptFileRunner( parentRef = self, mmmmToolsRef=self.mmmmTools ) self.scriptFileRunner.findScripts() self.win = pm.window("Script File Runner") self.ddMenuEntires = [ ] with self.win: self.col = pm.columnLayout() with self.col: self.textPath = pm.text( "Path to scripts:" ) self.textFieldPath = pm.textField( text=self.scriptFileRunner.searchPath, width=400, changeCommand= lambda x : self.onTextPathChangeCommand() ) self.btnRefresh = pm.button( "Refresh Scripts", command = lambda x: self.buildMenu( )