def uvcoordsNew(self, attrName): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) enabled = True if len(cmds.getAttr('%s.uvset' % attrName.split('.')[0])) > 0: enabled = False cmds.attrFieldGrp('aiImageUVCoords', label='UV Coords', enable=enabled, attribute=attrName) cmds.setUITemplate(popTemplate=True)
def __init__(self): self.uiCmd = AssignPsd_uiCmd( self ) if cmds.uiTemplate( 'worldBasePsdTemplate', exists=True ): cmds.deleteUI( 'worldBasePsdTemplate', uiTemplate=True ) template = cmds.uiTemplate( 'worldBasePsdTemplate' ) cmds.text( defineTemplate=template, l='' ) if cmds.window( "assignPsd_ui", ex=1 ): cmds.deleteUI( "assignPsd_ui" ) self.win = cmds.window( "assignPsd_ui", title="Assign UI" ) cmds.columnLayout() cmds.setUITemplate( template, pushTemplate=True ) cmds.rowColumnLayout( nc=3, cw=[(1,120),(2,120),(3,60)] ) cmds.text( l='Blend Shape Controler' ) self.txf = cmds.textField() cmds.popupMenu() cmds.menuItem( l='Load Selected', c=self.uiCmd.loadSel ) cmds.button( l='Select', c= self.uiCmd.selControlCmd ) cmds.setParent( '..' ) cmds.text(h=10) cmds.rowColumnLayout( nc=3, cw=[(1,50),(2,200),(3,50)] ) cmds.text() cmds.button( l="Assign BlendShape", c=self.uiCmd.assignCmd, h=25 ) cmds.text() cmds.setParent( '..' ) cmds.text() cmds.rowColumnLayout( nc=1, cw=(1,300) ) cmds.separator() cmds.setParent( '..' ) cmds.text() cmds.rowColumnLayout( nc=3, cw=[(1,50),(2,200),(3,50)] ) cmds.text() self.fixModeButton = cmds.button( l="", h=25 ) self.fixModeButton_condition() cmds.text() cmds.setParent( '..' ) cmds.text() ''' cmds.rowColumnLayout( nc=1, cw=( 1,300 ) ) self.scroll = cmds.textScrollList() ''' cmds.window( self.win, e=1, wh=( 305, 150 ) ) cmds.showWindow( self.win ) cmds.setUITemplate( template, popTemplate=True ) self.scriptJobSetting()
def _localiseLookdevWidget(self, loader): """ """ self.loader = loader cmds.setUITemplate('attributeEditorTemplate', pushTemplate=True) cmds.columnLayout(adjustableColumn=True) cmds.rowLayout(numberOfColumns=2, adjustableColumn2=1) if not cmds.getAttr("%sjsonFile" % self.loader) or not cmds.getAttr( "%sabcShaders" % self.loader): bg_color = RED enable = False else: bg_color = GREEN enable = True self.btn = cmds.button(label='Localise Lookdev', command=self._localiseLookdevImport, enableBackground=True, backgroundColor=bg_color, enable=enable) cmds.setParent('..') cmds.setUITemplate(popTemplate=True) cmds.setParent('..') self._localiseLookdevConnect(loader) cmds.select()
def SitoA_Scalar_Exponent_Create_Op(attr): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) cmds.attrEnumOptionMenuGrp("SitoA_Scalar_Exponent_Op", attribute=attr, label="Operation", enumeratedItem=[(0, "Exponent"), (1, "Logarithm") (2, "Bias") (3, "Gain")]) cmds.setUITemplate(popTemplate=True)
def indirectDiffuseCreate(self, attrName): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) isEnabled = not (cmds.getAttr("%s.aiMode" % (attrName.split(".")[0])) is 1) cmds.attrFieldSliderGrp("HairTemplateIndirectDiffuse", label="Indirect Diffuse", attribute=attrName, enable=isEnabled) cmds.setUITemplate(popTemplate=True)
def minPixelCreate(self, attrName): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) isEnabled = not (cmds.getAttr("%s.aiMode" % (attrName.split(".")[0])) is 1) cmds.attrFieldSliderGrp("NurbsCurveTemplateMinPixelWidth", label="Min Pixel Width", attribute=attrName, enable=isEnabled) cmds.setUITemplate(popTemplate=True)
def LatLongStereoCreateCameraMode(attr): cmds.setUITemplate("attributeEditorPresetsTemplate", pushTemplate=True) cmds.attrEnumOptionMenuGrp( "LatLongStereoCameraMode", attribute=attr, label="Camera", enumeratedItem=[(0, "Center"), (1, "Left"), (2, "Right")], ) cmds.setUITemplate(popTemplate=True)
def aiUtilityCreateColorMode(attr): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) cmds.attrEnumOptionMenuGrp('AIUtilityColorMode', attribute=attr, label="Color Mode", enumeratedItem=[(0, 'Color'), (3, 'Normal'), (1, 'Geometric Normal'), (2, 'Un-bumped Normal'), (22, 'Bump Difference'), (4, 'Barycentric Coords'), (5, 'UV Coords'), (6, 'U Coords'), (7, 'V Coords'), (8, 'U Surface Derivative (dPdu)'), (9, 'V Surface Derivative (dPdv)'), (10, 'Shading Point (Relative to BBox)'), (11, 'Primitive ID'), (12, 'Uniform ID'), (13, 'Triangle Wireframe'), (14, 'Polygon Wireframe'), (15, 'Object'), (16, 'Edge Length'), (17, 'Floatgrid'), (18, 'Reflection Lines'), (19, 'Bad UVs'), (20, 'Number of Lights'), (21, 'Object ID')]) cmds.setUITemplate(popTemplate=True)
def build(self): self.destroy() if mc.uiTemplate(self.Uit, q=True, ex=True): mc.deleteUI(self.Uit, uit=True) mc.uiTemplate(self.Uit) mc.button(dt=self.Uit, w=150, h=36) mc.text(dt=self.Uit, font='fixedWidthFont') self.Win = mc.window(self.Win, wh=self.widthHeight, title=self.Title) mc.setUITemplate(self.Uit, pushTemplate=True) mc.columnLayout() mc.button(l='Find Duplicated Texture', c=lambda x: findDuplicatedTexturePath.doIt()) mc.setParent('..') mc.setUITemplate(popTemplate=True)
def ArnoldGpuCacheTemplateNew(plugName) : AttrName = plugName.split('.')[-1] s1 = re.sub('(.)([A-Z][a-z]+)', r'\1 \2', AttrName) s2 = re.sub('(.)(file+)', r'\1 \2', s1) NiceName = re.sub('([a-z0-9])([A-Z])', r'\1 \2', s2).title() cmds.setUITemplate('attributeEditorTemplate',pst=True) cmds.rowLayout( numberOfColumns=3 ) cmds.text(label=NiceName) path = cmds.textField('GpuCache%sPath'%AttrName) # ,changeCommand=lambda *args: ArnoldGpuCacheEdit(plugName, *args) cmds.symbolButton('GpuCache%sPathButton'%AttrName, image='navButtonBrowse.png') cmds.setUITemplate(ppt=True) ArnoldGpuCacheTemplateReplace(plugName)
def createLightColorTemperatureUI(self, attrName): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) isEnabled = True isEnabled = cmds.getAttr(self.nodeAttr('aiUseColorTemperature')) aeUtils.attrBoolControlGrp(self.checkBoxName, attribute=self.nodeAttr('aiUseColorTemperature'), label='Use Color Temperature', changeCommand=self.updateUseColorTemperature) cmds.setParent('..') cmds.rowLayout(numberOfColumns=2, columnWidth2=(80,220), adjustableColumn=2, columnAttach=[(1, 'left', 0), (2, 'left', -10)]) cmds.canvas(self.canvasName, width=65, height=12) cmds.attrFieldSliderGrp(self.sliderName, label='Temperature', width=220, attribute=self.nodeAttr('aiColorTemperature'), enable=isEnabled, precision=0, columnWidth=[(1, 70), (2, 70), (3, 80)], changeCommand=self.updateColorTemperature) cmds.setParent('..') colorTemp = cmds.arnoldTemperatureToColor(cmds.getAttr(self.nodeAttr('aiColorTemperature'))) cmds.canvas(self.canvasName, edit=True, rgbValue=colorTemp) cmds.setUITemplate(popTemplate=True)
def pushOptionsUITemplate(): if not cmds.uiTemplate("oa_optionsTemplate", exists=True): cmds.uiTemplate("oa_optionsTemplate") cmds.frameLayout( defineTemplate="oa_optionsTemplate", collapsable=True, collapse=False, labelVisible=True, borderVisible=False, ) cmds.columnLayout(defineTemplate="oa_optionsTemplate", adjustableColumn=True) cmds.checkBoxGrp(defineTemplate="oa_optionsTemplate", columnWidth=[2, 240], numberOfCheckBoxes=1, label="") cmds.optionMenuGrp(defineTemplate="oa_optionsTemplate", columnAlign=[1, "right"], columnWidth=[2, 160]) cmds.setUITemplate("oa_optionsTemplate", pushTemplate=True)
def pushOptionsUITemplate(): '''Standardize the look of the options UI. Python translation of fileOptions.mel:pushOptionsUITemplate(), which is not a global proc. ''' if not cmds.uiTemplate('optionsTemplate', exists=True): cmds.uiTemplate('optionsTemplate') cmds.frameLayout(defineTemplate='optionsTemplate', collapsable=True, collapse=False, labelVisible=True, labelIndent=5, marginWidth=5, marginHeight=5) cmds.columnLayout(defineTemplate='optionsTemplate', adjustableColumn=True) cmds.setUITemplate('optionsTemplate', pushTemplate=True)
def _shadersWidget(self, shaders): """ Shaders Path widgets """ self.shaders = shaders cmds.setUITemplate('attributeEditorTemplate', pushTemplate=True) cmds.columnLayout(adjustableColumn=True) cmds.rowLayout(numberOfColumns=4, adjustableColumn4=2) cmds.text(label="Shaders Path") cmds.textField("shaderspathNameField", editable=False, enable=False, textChangedCommand=self._refresh) cmds.symbolButton(image="navButtonBrowse.png", width=15, height=15, command=self._shadersBrowser) cmds.setParent('..') cmds.setUITemplate(popTemplate=True) cmds.setParent('..') self._shadersConnect(shaders) cmds.select()
def main (): # GUI variables symBtnWidth = 36 btnHeight = 20 gridCols = 3 winWidth = symBtnWidth * gridCols # check main GUI element existence if cmds.window ('rigAid_window', exists = True): cmds.showWindow ('rigAid_window') else: # check template existences if cmds.uiTemplate ('template_window', exists = True): cmds.deleteUI ('template_window', uiTemplate = True) if cmds.uiTemplate ('template_column', exists = True): cmds.deleteUI ('template_column', uiTemplate = True) if cmds.uiTemplate ('template_frame', exists = True): cmds.deleteUI ('template_frame', uiTemplate = True) if cmds.uiTemplate ('template_button', exists = True): cmds.deleteUI ('template_button', uiTemplate = True) if cmds.uiTemplate ('template_radioBtn', exists = True): cmds.deleteUI ('template_radioBtn', uiTemplate = True) if cmds.uiTemplate ('template_row', exists = True): cmds.deleteUI ('template_row', uiTemplate = True) if cmds.uiTemplate ('template_grid', exists = True): cmds.deleteUI ('template_grid', uiTemplate = True) if cmds.uiTemplate ('template_symButton', exists = True): cmds.deleteUI ('template_symButton', uiTemplate = True) if cmds.uiTemplate ('template_separator', exists = True): cmds.deleteUI ('template_separator', uiTemplate = True) # create GUI templates cmds.uiTemplate ('template_window') cmds.uiTemplate ('template_column') cmds.uiTemplate ('template_frame') cmds.uiTemplate ('template_button') cmds.uiTemplate ('template_radioBtn') cmds.uiTemplate ('template_row') cmds.uiTemplate ('template_grid') cmds.uiTemplate ('template_symButton') cmds.uiTemplate ('template_separator') # define GUI templates cmds.window (defineTemplate = 'template_window', sizeable = False, toolbox = True, resizeToFitChildren = True) cmds.columnLayout (defineTemplate = 'template_column') cmds.frameLayout (defineTemplate = 'template_frame', borderVisible = True, borderStyle = 'etchedOut', collapsable = True, preCollapseCommand = 'cmds.window ( \'rigAid_window\', edit=1, height=1)') cmds.rowLayout (defineTemplate = 'template_row') cmds.gridLayout (defineTemplate = 'template_grid') cmds.symbolButton (defineTemplate = 'template_symButton', width = symBtnWidth, height = symBtnWidth, image = 'ford_riggingAid__shelf.xpm') cmds.button (defineTemplate = 'template_button', width = winWidth, height = btnHeight, align = 'left', actOnPress = True) cmds.radioButton (defineTemplate = 'template_radioBtn', align = 'left', recomputeSize = True) cmds.separator (defineTemplate = 'template_separator', width = winWidth, height = 2, style = 'in', horizontal = True) # GUI layout cmds.window ('rigAid_window', title = 'ford`s rigAid', useTemplate = 'template_window', retain = True) cmds.columnLayout ('master_column', useTemplate = 'template_column') cmds.frameLayout ('showHide_frame', label = 'showHide', borderVisible = False, useTemplate = 'template_frame') cmds.columnLayout ('main_column', useTemplate = 'template_column') cmds.frameLayout ('frame_creation', label = 'creation', useTemplate = 'template_frame') cmds.columnLayout ('column_creation', useTemplate = 'template_column') cmds.gridLayout ('grid_creation', useTemplate = 'template_grid', numberOfColumns = gridCols, cellWidthHeight = (symBtnWidth, symBtnWidth)) cmds.setParent ('main_column') cmds.frameLayout ('frame_orientation', label = 'orientation', useTemplate = 'template_frame') cmds.columnLayout ('column_orientation', useTemplate = 'template_column') cmds.gridLayout ('grid_orientButtons', useTemplate = 'template_grid', numberOfColumns = 2, cellWidthHeight = (winWidth / 2, symBtnWidth)) cmds.setParent ('column_orientation') cmds.gridLayout ('grid_selectAxis', useTemplate = 'template_grid', numberOfColumns = 3, cellWidthHeight = (winWidth / 3, 20)) cmds.setParent ('main_column') cmds.frameLayout ('frame_control', label = 'control', useTemplate = 'template_frame') cmds.columnLayout ('column_control', useTemplate = 'template_column') cmds.setParent ('main_column') cmds.frameLayout ('frame_setup', label = 'setup', useTemplate = 'template_frame') cmds.columnLayout ('column_setup', useTemplate = 'template_column') # >>> creation buttons <<< _______________________________________________________________________________________ cmds.separator (useTemplate = 'template_separator' ) cmds.setParent ('grid_creation' ) cmds.setUITemplate ('template_symButton', pushTemplate = True ) cmds.symbolButton (command ='fra.create2Arrowhead()', image = 'ford_riggingAid__create2Arrowhead.xpm' ) cmds.symbolButton (command ='fra.create4Arrowhead()', image = 'ford_riggingAid__create4Arrowhead.xpm' ) cmds.symbolButton (command ='fra.createSphere()', image = 'ford_riggingAid__createSphere.xpm' ) cmds.symbolButton (command ='fra.createNURBScube()', image = 'ford_riggingAid__createNURBScube.xpm' ) cmds.symbolButton (command ='fra.createCircle()', image = 'ford_riggingAid__createCircle.xpm' ) cmds.symbolButton (command ='fra.createSpherical4Arrowhead()', image = 'ford_riggingAid__createSpherical4Arrowhead.xpm') cmds.symbolButton (command ='fra.createNURBSlocator()', image = 'ford_riggingAid__createNURBSlocator.xpm') cmds.symbolButton (command ='fra.createLocator()', image = 'ford_riggingAid__createLocator.xpm' ) cmds.symbolButton (command ='fra.createPiramyd()', image = 'ford_riggingAid__createPiramyd.xpm' ) cmds.symbolButton (command ='fra.createCircle1Arrowhead()', image = 'ford_riggingAid__createCircle1Arrowhead.xpm') # cmds.setParent ( 'column_creation' ) cmds.setUITemplate ( 'template_button', pushTemplate = True ) cmds.separator ( useTemplate = 'template_separator' ) cmds.button ( label = ' convert2control', command = 'fra.convertToControl ()' ) cmds.separator ( useTemplate = 'template_separator' ) cmds.button ( label = ' command4curve', command = 'fra.createCurveCommand ()' ) # >>> orientation button / options <<< ________________________________________________________________________________ # cmds.setParent ( 'grid_orientButtons' ) cmds.setUITemplate ( 'template_symButton', pushTemplate = True ) cmds.symbolButton ( 'orientMinusButton', command = 'fra.smartOrient (\'minus\')', width = winWidth / 2, image = 'ford_riggingAid__orientXminus.xpm' ) cmds.symbolButton ( 'orientPlusButton', command = 'fra.smartOrient (\'plus\')', width = winWidth / 2, image = 'ford_riggingAid__orientXplus.xpm' ) # cmds.setParent ( 'grid_selectAxis' ) cmds.setUITemplate ( 'template_radioBtn', pushTemplate = True ) cmds.radioCollection( 'radioCollection_axis' ) cmds.radioButton ( 'X', label = 'X', select = True, onCommand = 'fra.setButtonIcon ()' ) cmds.radioButton ( 'Y', label = 'Y', onCommand = 'fra.setButtonIcon ()' ) cmds.radioButton ( 'Z', label = 'Z', onCommand = 'fra.setButtonIcon ()' ) # cmds.setParent ( 'column_orientation' ) cmds.separator ( useTemplate = 'template_separator' ) cmds.checkBox ( 'check_keepShape', label = 'keepShape', align = 'left', changeCommand = 'fra.setButtonIcon ()' ) # >>> control buttons <<< ________________________________________________________________________________________ cmds.setUITemplate ( 'template_button', pushTemplate = True ) cmds.setParent ( 'column_control' ) cmds.separator ( useTemplate = 'template_separator' ) cmds.intSlider ( 'boneNum', width = winWidth, minValue = 1, maxValue = 10, value = 1, dragCommand = '''cmds.button ( 'button_boneBreaker', edit = True, label = 'bone breaker #' + str ( cmds.intSlider ( 'boneNum', query=1, value=1) ), width = ''' + str ( winWidth ) + ''')''' ) cmds.button ( 'button_boneBreaker', label = ' bone breaker #' + str ( cmds.intSlider ('boneNum', query=1, value=1) ), command = 'fra.splitJoint ()' ) cmds.separator ( useTemplate = 'template_separator' ) cmds.button ( label = ' zero all', command = 'fra.resetControls ()' ) cmds.button ( label = ' select LRA', command = 'fra.selectLRA ()' ) cmds.button ( label = ' hide LRA', command = 'fra.hideLRA ()' ) # >>> control buttons <<< ________________________________________________________________________________________ cmds.setParent ( 'column_setup' ) cmds.separator ( useTemplate = 'template_separator' ) cmds.button ( label = ' ribbon', command = 'fra.setupRibbon ()' ) cmds.button ( label = ' strechy', command = 'fra.setupStrechy ()' ) # >>> show GUI <<< _______________________________________________________________________________________________ cmds.showWindow ( 'rigAid_window' )
def volumeNoiseCreate(self, attrName): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) cmds.attrNavigationControlGrp("FluidTemplateVolumeTexture", attribute=attrName, label="Texture") cmds.setUITemplate(popTemplate=True)
def __exit__(self, type, value, traceback): cmds.setUITemplate(popTemplate=True)
def __init__(self, *args): self.repairString = '' if cmds.window( 'dateAndPath_ui', ex=1 ): cmds.deleteUI( 'dateAndPath_ui', wnd=1 ) self.win = cmds.window( 'dateAndPath_ui', title='Confirm Text UI') if not cmds.uiTemplate( 'checkBoxTemp', ex=1 ): cmds.uiTemplate( 'checkBoxTemp' ) cmds.checkBox( dt='checkBoxTemp', h=20, onc=self.update, ofc=self.update ) cmds.setUITemplate( 'checkBoxTemp', pushTemplate=1 ) form = cmds.formLayout() assetCheck = cmds.frameLayout( l='Asset' ) self.assetCheck = cmds.rowColumnLayout( nc=5, co=(1,'left',10), cw=[(1,100),(2,100),(3,100),(4,100),(5,100)] ) cmds.checkBox( l='Modeling' ) cmds.checkBox( l='Blend Shape' ) cmds.checkBox( l='Scale' ) cmds.checkBox( l='Texture' ) cmds.text( l='' ) cmds.checkBox( l='Shader' ) cmds.checkBox( l='UV' ) cmds.checkBox( l='Cloth' ) cmds.checkBox( l='Hair' ) cmds.checkBox( l='Rigging' ) cmds.setParent( form ) layoutCheck = cmds.frameLayout( l='Layout' ) self.layoutCheck = cmds.rowColumnLayout( nc=5, co=(1,'left',10), cw=[(1,130),(2,140),(3,100),(4,100),(5,30)] ) cmds.checkBox( l='Camera' ) cmds.checkBox( l='Matte Camera' ) cmds.checkBox( l='BG' ) cmds.checkBox( l='Frame Length' ) cmds.text( l='' ) cmds.checkBox( l='Matte Painting' ) cmds.checkBox( l='Position' ) cmds.setParent( form ) productionCheck = cmds.frameLayout( l='Production' ) self.productionCheck = cmds.rowColumnLayout( nc=5, co=(1,'left',10), cw=[(1,130),(2,140),(3,100),(4,100),(5,30)] ) cmds.checkBox( l='Animation' ) cmds.checkBox( l='Facial Ani' ) cmds.checkBox( l='Hair Sim' ) cmds.checkBox( l='Cloth Sim' ) cmds.text( l='' ) cmds.checkBox( l='Cache' ) cmds.checkBox( l='Lighting' ) cmds.checkBox( l='FX' ) cmds.setParent( form ) scrollField = cmds.scrollField( editable=True, wordWrap=False, h=80 ) closeBt =cmds.button( l='Close', c= self.closeWindow, h=30 ) cmds.formLayout( form, e=1, af=[ (assetCheck,'left',5 ),(assetCheck,'top',5 ),(assetCheck,'right',5 ), (layoutCheck,'left',5 ),(layoutCheck,'top',75 ),(layoutCheck,'right',5 ), (productionCheck,'left',5 ),(productionCheck,'top',145 ),(productionCheck,'right',5 ), (scrollField, 'left', 5), (scrollField, 'right', 5), (scrollField, 'top', 215), (scrollField, 'bottom', 40 ), (closeBt, 'left', 5 ),(closeBt, 'right', 5 ),(closeBt, 'bottom', 5 )] ) cmds.window( self.win, e=1, wh=[515,357 ] ) cmds.showWindow( self.win ) self.scrollField = scrollField self.editFieldString() self.checkBoxs = cmds.lsUI( type='checkBox' )
def create_ui(self): print "Creating UI..." # Create template template = "moduleManagerTemplate" window = "moduleManagerWindow" if cmds.uiTemplate(template, exists=1): cmds.deleteUI(template, uiTemplate=True) cmds.uiTemplate(template) cmds.frameLayout(defineTemplate=template, borderVisible=True, labelVisible=True, collapse=False, marginWidth=2, marginHeight=2) cmds.columnLayout(adjustableColumn=True, defineTemplate=template, columnAttach=("both", 1)) cmds.button(defineTemplate=template, label="Default Text") # Create window if cmds.window(window, exists=1): cmds.deleteUI(window, window=True) cmds.window(window, title=self.title, menuBar=True) cmds.setUITemplate(template, pushTemplate=1) # Create the menu cmds.menu(tearOff=False, label="Update") cmds.menuItem(command=lambda *args: self.update_scripts(), label="Network") cmds.menu(tearOff=False, label="Windows") cmds.menuItem(command=lambda *args: cmds.GraphEditor(), label="Graph Editor") cmds.menuItem(command=lambda *args: cmds.HypershadeWindow(), label="Hypershade") cmds.menuItem(command=lambda *args: cmds.OutlinerWindow(), label="Outliner") cmds.menuItem(command=lambda *args: cmds.ReferenceEditor(), label="Reference Editor") cmds.menuItem(command=lambda *args: cmds.ScriptEditor(), label="Script Editor") cmds.menu(helpMenu=True, tearOff=False, label="Help") cmds.menuItem( command=lambda *args: cmds.launch(web="http://download.autodesk.com/global/docs/maya2014/en_us/Commands/"), label="MEL Commands") cmds.menuItem( command=lambda *args: cmds.launch( web="http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/"), label="PYTHON Commands") cmds.menuItem( command=lambda *args: cmds.launch(web="http://download.autodesk.com/global/docs/maya2014/en_us/Nodes/"), label="Nodes and Attributes") cmds.menuItem(divider=True) cmds.menuItem(command=self.openAboutWindow, label="About") # Create Version Frame cmds.frameLayout(label=(" Version " + str(self.version))) cmds.columnLayout(columnAttach=("both", 1)) cmds.rowColumnLayout(numberOfColumns=2) cmds.textField('dateFld', width=175, editable=False, text=("Last Save: N/A")) cmds.button(width=110, command=lambda *args: mel.incrementalSave(), label="Incremental Save") cmds.setParent('..') cmds.setParent('..') cmds.setParent('..') cmds.tabLayout('TabList') # Create tab UI for each module tabs = [] for module in self.modules: tabs.append(module.create_ui()) # Create Info Tab infoTab = self.create_info_tab() cmds.setParent('..') tabs.append((infoTab, "Info")) # Add Tabs / Show Window cmds.tabLayout('TabList', edit=1, tabLabel=tabs) cmds.showWindow(window) def dockWindow(window): dWindow = "moduleManagerDockedWindow" if cmds.dockControl(dWindow, exists=1): cmds.deleteUI(dWindow) formLayout = str(cmds.formLayout(parent=window)) cmds.dockControl(dWindow, allowedArea="all", content=formLayout, area="right", label=self.title) cmds.control(window, p=formLayout, e=1, w=310) cmds.setParent('..') dockWindow(window)
def popOptionsUITemplate(): cmds.setUITemplate(popTemplate=True)
def __enter__(self): cmds.setUITemplate(self._name, pushTemplate=True) return self
def main (): # GUI object variables _symBtnW = 36 _grdCols = 6 # check for window if cmds.window ('win_fmmu', exists = True): cmds.showWindow ('win_fmmu') else: # check for GUI templates if cmds.uiTemplate ('tpml_frml', exists = True): cmds.deleteUI ('tpml_frml') if cmds.uiTemplate ('tpml_grdl', exists = True): cmds.deleteUI ('tpml_grdl') if cmds.uiTemplate ('tmpl_symBtn', exists = True): cmds.deleteUI ('tmpl_symBtn') if cmds.uiTemplate ('tmpl_sprtr', exists = True): cmds.deleteUI ('tmpl_sprtr') if cmds.uiTemplate ('tmpl_flofld', exists = True): cmds.deleteUI ('tmpl_flofld') # create GUI templates cmds.uiTemplate ('tpml_frml') cmds.uiTemplate ('tpml_grdl') cmds.uiTemplate ('tmpl_symBtn') cmds.uiTemplate ('tmpl_sprtr') cmds.uiTemplate ('tmpl_flofld') # define GUI templates cmds.frameLayout (defineTemplate = 'tpml_frml', borderVisible = True, borderStyle = 'etchedOut', collapsable = True, preCollapseCommand = "cmds.window ('win_fmmu', edit = True, height = True)") cmds.gridLayout (defineTemplate = 'tpml_grdl', numberOfColumns = _grdCols, cellWidthHeight = (_symBtnW, _symBtnW)) cmds.symbolButton (defineTemplate = 'tmpl_symBtn', width = _symBtnW, height = _symBtnW) cmds.separator (defineTemplate = 'tmpl_sprtr') cmds.floatField (defineTemplate = 'tmpl_flofld', width = 50, height = 30, precision = 3, step = 0.05,) # create GUI cmds.window ('win_fmmu', sizeable = False, resizeToFitChildren = True, retain = True) cmds.columnLayout () cmds.frameLayout ('showHide_frml', useTemplate = 'tpml_frml', label = 'matchMove') # cmds.columnLayout ('main_clmnl') cmds.separator (useTemplate = 'tmpl_sprtr', width = cmds.frameLayout ('showHide_frml', query = True, width = True) ) cmds.gridLayout (useTemplate = 'tpml_grdl') cmds.setUITemplate ('tmpl_symBtn', pushTemplate = True) cmds.symbolButton ('button_stabilizer', image = 'ford_matchMoveUtilities__stabilize.xpm', command = 'fmmu.stabilizer()', annotation = 'stabilizer') cmds.symbolButton (image = 'ford_matchMoveUtilities__writeShakeTracker.xpm', command = 'fmmu.write_shake_track_node()', annotation = 'write track') cmds.symbolButton (image = 'ford_matchMoveUtilities__constrain_locator_to_vertex.xpm', command = 'fmmu.constrain_locator_to_vertex()', annotation = 'locator to vertex') cmds.symbolButton (image = 'ford_matchMoveUtilities__bakeTextureRange.xpm', command = 'fmmu.bake_texture_range(512)', annotation = 'bake 512') cmds.symbolButton (image = 'ford_matchMoveUtilities__bakeTextureRange.xpm', command = 'fmmu.bake_texture_range(1024)', annotation = 'bake 1024') cmds.symbolButton (image = 'ford_matchMoveUtilities__cones_to_locators.xpm', command = 'fmmu.add_cones_to_prediction_locators()', annotation = 'put cones to every locator') cmds.frameLayout ('adjustCam_frml', parent = 'main_clmnl', useTemplate = 'tpml_frml', visible = False) cmds.gridLayout (useTemplate = 'tpml_grdl') cmds.setUITemplate ('tmpl_flofld', pushTemplate = True) cmds.floatField ('field_overscan', value = 1, minValue = 0.1, maxValue = 2.5, changeCommand = 'fmmu.adjust_camera("overscan")', enterCommand = 'fmmu.adjust_camera("overscan")', dragCommand = 'fmmu.adjust_camera("overscan")') cmds.floatField ('field_screenPosX', value = 0.5, minValue = 0.1, maxValue = 2.5, changeCommand = 'fmmu.adjust_camera("x")', enterCommand = 'fmmu.adjust_camera("x")', dragCommand = 'fmmu.adjust_camera("x")') cmds.floatField ('field_screenPosY', value = 0.5, minValue = 0.1, maxValue = 2.5, changeCommand = 'fmmu.adjust_camera("y")', enterCommand = 'fmmu.adjust_camera("y")', dragCommand = 'fmmu.adjust_camera("y")') cmds.showWindow ('win_fmmu')
def DomemasterStereoCreateCameraMode(attr): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) cmds.attrEnumOptionMenuGrp('DomemasterStereoCameraMode', attribute=attr, label="Camera", enumeratedItem=[(0, 'Center'), (1, 'Left'), (2, 'Right')]) cmds.setUITemplate(popTemplate=True)
def SitoA_Scalar_Basic_Create_Op(attr): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) cmds.attrEnumOptionMenuGrp("SitoA_Scalar_Basic_Op", attribute=attr, label="Operation", enumeratedItem=enumOp) cmds.setUITemplate(popTemplate=True)
def rigAidGUI (): # >>> check main GUI element existence <<< ######################## if cmds.window ( 'rigAid_window', exists = True ): cmds.showWindow ( 'rigAid_window' ) # >>> check template existences <<< ############################## else: if cmds.uiTemplate ( 'template_window', exists = True ): cmds.deleteUI ( 'template_window', uiTemplate = True ) if cmds.uiTemplate ( 'template_column', exists = True ): cmds.deleteUI ( 'template_column', uiTemplate = True ) if cmds.uiTemplate ( 'template_frame', exists = True ): cmds.deleteUI ( 'template_frame', uiTemplate = True ) if cmds.uiTemplate ( 'template_button', exists = True ): cmds.deleteUI ( 'template_button', uiTemplate = True ) if cmds.uiTemplate ( 'template_radioBtn',exists = True ): cmds.deleteUI ( 'template_radioBtn', uiTemplate = True ) if cmds.uiTemplate ( 'template_row', exists = True ): cmds.deleteUI ( 'template_row', uiTemplate = True ) if cmds.uiTemplate ( 'template_sprtor', exists = True ): cmds.deleteUI ( 'template_sprtor', uiTemplate = True ) # >>> define GUI element templates <<< ############################## cmds.uiTemplate ( 'template_window' ) cmds.uiTemplate ( 'template_column' ) cmds.uiTemplate ( 'template_frame' ) cmds.uiTemplate ( 'template_button' ) cmds.uiTemplate ( 'template_radioBtn' ) cmds.uiTemplate ( 'template_row' ) cmds.uiTemplate ( 'template_sprtor' ) cmds.window ( defineTemplate = 'template_window', sizeable = False, toolbox = True, topLeftCorner = ( 200, 300 ), resizeToFitChildren = True ) cmds.columnLayout ( defineTemplate = 'template_column', ) cmds.frameLayout ( defineTemplate = 'template_frame', borderVisible = True, borderStyle = 'etchedOut', collapsable = True, preCollapseCommand = 'cmds.window ( \'rigAid_window\', edit=1, height=1)' ) cmds.rowLayout ( defineTemplate = 'template_row' ) cmds.button ( defineTemplate = 'template_button', width = 110, height = 20, align = 'left', actOnPress = True ) cmds.radioButton ( defineTemplate = 'template_radioBtn', align = 'left', recomputeSize = True ) cmds.separator ( defineTemplate = 'template_sprtor', width = 110, height = 2, style = 'in', horizontal = True ) # >>> GUI layout <<< #################################################### cmds.window ( 'rigAid_window', title = 'ford`s rigAid', useTemplate = 'template_window', retain = True ) cmds.columnLayout ( 'master_column', useTemplate = 'template_column' ) cmds.frameLayout ( 'showHide_frame', label = 'showHide', borderVisible = False, useTemplate = 'template_frame' ) cmds.columnLayout ( 'main_column', useTemplate = 'template_column' ) cmds.frameLayout ( 'frame_creation', label = 'creation', useTemplate = 'template_frame' ) cmds.columnLayout ( 'column_creation', useTemplate = 'template_column' ) cmds.setParent ( 'main_column' ) cmds.frameLayout ( 'frame_orientation', label = 'orientation', useTemplate = 'template_frame' ) cmds.columnLayout ( 'column_orientation', useTemplate = 'template_column' ) cmds.separator ( useTemplate = 'template_sprtor' ) cmds.rowLayout ( 'row_adjustOrient', numberOfColumns = 2, columnWidth = ( 1, 28 ), useTemplate = 'template_row' ) cmds.columnLayout ( 'column_selectAxis', useTemplate = 'template_column' ) cmds.setParent ( 'row_adjustOrient' ) cmds.columnLayout ( 'column_orientProperties', useTemplate = 'template_column' ) cmds.setParent ( 'main_column' ) cmds.frameLayout ( 'frame_control', label = 'control', useTemplate = 'template_frame' ) cmds.columnLayout ( 'column_control', useTemplate = 'template_column' ) # >>> creation buttons <<< ##################################################### cmds.setUITemplate ( 'template_button', pushTemplate = True ) cmds.setParent ( 'column_creation' ) cmds.separator ( useTemplate = 'template_sprtor' ) cmds.button ( label = 'arrow #2', command = 'fra.create2Arrowhead ()' ) cmds.button ( label = 'arrow #4', command = 'fra.create4Arrowhead ()' ) cmds.button ( label = 'sphere', command = 'fra.createSphere ()' ) cmds.button ( label = 'cube', command = 'fra.createNURBScube ()' ) cmds.button ( label = 'circle', command = 'fra.createCircle ()' ) cmds.button ( label = 'spheriaclArrow #4', command = 'fra.createSpherical4Arrowhead ()' ) cmds.button ( label = 'curveLocator', command = 'fra.createNURBSlocator ()' ) cmds.button ( label = 'Locator', command = 'fra.createLocator ()' ) cmds.button ( label = 'piramyd', command = 'fra.createPiramyd ()' ) cmds.button ( label = 'circleArrow #1', command = 'fra.createCircle1Arrowhead ()' ) cmds.separator ( useTemplate = 'template_sprtor' ) cmds.button ( label = 'convert2control', command = 'fra.convertToControl ()' ) cmds.separator ( useTemplate = 'template_sprtor' ) cmds.button ( label = 'command4curve', command = 'fra.createCurveCommand ()' ) # >>> orientation button / options <<< ##################################################### cmds.setUITemplate ( 'template_radioBtn', pushTemplate = True ) cmds.setParent ( 'column_selectAxis' ) cmds.radioCollection ( 'radioCollection_axis' ) cmds.radioButton ( 'axisX', label = 'x', select = True ) cmds.radioButton ( 'axisY', label = 'y' ) cmds.radioButton ( 'axisZ', label = 'z' ) cmds.setParent ( 'column_orientProperties' ) cmds.checkBox ( 'check_keepShape', label = 'keepShape', align = 'left' ) cmds.separator ( useTemplate = 'template_sprtor', width = 70 ) cmds.radioCollection ( 'radioCollection_direction' ) cmds.radioButton ( 'plus', label = '+', select = True ) cmds.radioButton ( 'minus', label = '-' ) cmds.setUITemplate ( 'template_button', pushTemplate = True ) cmds.setParent ( 'column_orientation' ) cmds.separator ( useTemplate = 'template_sprtor' ) cmds.button ( label = 'do orient', command = 'fra.smartOrient ()' ) # >>> control buttons <<< ##################################################### cmds.setUITemplate ( 'template_button', pushTemplate = True ) cmds.setParent ( 'column_control' ) cmds.separator ( useTemplate = 'template_sprtor' ) cmds.intSlider ( 'boneNum', width = 110, minValue = 1, maxValue = 10, value = 1, dragCommand = '''cmds.button ( 'button_boneBreaker', edit = True, label = 'bone breaker #' + str ( cmds.intSlider ('boneNum', query=1, value=1) ), width = 110)''') cmds.button ( 'button_boneBreaker', label = 'bone breaker #' + str ( cmds.intSlider ('boneNum', query=1, value=1) ), command = 'fra.splitJoint ()' ) cmds.separator ( useTemplate = 'template_sprtor' ) cmds.button ( label = 'zero all', command = 'fra.resetControls ()' ) cmds.button ( label = 'select LRA', command = 'fra.selectLRA ()' ) cmds.button ( label = 'hide LRA', command = 'fra.hideLRA ()' ) # >>> show GUI <<< ######################################################### cmds.showWindow ( 'rigAid_window' )
def __enter__(self): cmds.setUITemplate('attributeEditorTemplate', pushTemplate=True)
def shaderCreate(self, attrName): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) cmds.attrNavigationControlGrp("HairSystemTemplateShader", attribute=attrName, label="Hair Shader") cmds.setUITemplate(popTemplate=True)
def uvsetNew(self, attrName): cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True) aeUtils.attrTextFieldGrp('aiImageUVSet', label='UV Set', attribute=attrName, changeCommand=AEaiImageTemplate.editUVSet) cmds.setUITemplate(popTemplate=True)