def __init__(self): respresets = [4096, 2048, 1024, 512, 256, 128, 64, 32] with pm.frameLayout(l='Options', cll=True, cl=False, bs='out'): with pm.columnLayout(): pm.text('Map Size:') pm.separator(st='in', width=160, height=8) with pm.rowColumnLayout(nc=3, cw=[20, 60]): pm.text(l='Width:') self.width = pm.intField(v=1024, width=42) with pm.optionMenu(): for i in respresets: pm.menuItem(l=i) pm.text(l='Height:') self.height = pm.intField(v=1024, width=42) with pm.optionMenu(): for i in respresets: pm.menuItem(l=i) pm.button(l='Get Map Size') pm.separator(st='in', width=160, height=8) with pm.columnLayout(): self.compSpace = pm.checkBox(l='Retain Component Spaceing', cc=lambda *args: pm.texMoveContext('texMoveContext', e=True, scr=self.compSpace.getValue()), v=pm.texMoveContext('texMoveContext', q=True, scr=True)) self.pixelUnits = pm.checkBox(l='Transform In Pixels')
def lcBake_convert_lightmap(bakeSetListDropdown, cameraListDropdown, *args, **kwargs): ''' ''' numItems = bakeSetListDropdown.getNumberOfItems() if numItems > 0: currentBakeSet = bakeSetListDropdown.getValue() if currentBakeSet: currentCamera = cameraListDropdown.getValue() outputDirectory = pm.textField(prefix+'_textField_texture_path', query=True, text=True) if os.path.exists(outputDirectory): shadows = pm.checkBox(prefix+'_checkBox_shadows', query=True, value=True) if pm.control('bakeWindow', exists = True): pm.deleteUI('bakeWindow') bakeWindow = pm.window('bakeWindow', t='Batch Bake', widthHeight=[100, 100], rtf=True, mnb=False, mxb=False, s=False) pm.columnLayout() pm.text(l='') pm.text(l='') pm.text(l=' Bake In Progress ') pm.text(l=' ...... ') pm.text(l='') pm.text(l='') bakeWindow.show() pm.refresh() #pm.pause(seconds=10) convertString = bake.convertLightmap(currentBakeSet, currentCamera, outputDirectory, shadows) print('Convert Command: {0}'.format(convertString) ) pm.deleteUI('bakeWindow') pm.select(clear=True) else: pm.warning('Path not found: {0}'.format(outputDirectory) )
def __init__(self, template): self.template = template self.win = "arnold_filter_list_win" if pm.window(self.win, exists=True): pm.deleteUI(self.win) pm.window(self.win, title="Add Light Filter", sizeable=False, resizeToFitChildren=True) #pm.windowPref(removeAll=True) pm.columnLayout(adjustableColumn=True, columnOffset=("both", 10), #columnAttach=('both',1), rowSpacing=10) self.scrollList = pm.textScrollList('alf_filter_list', nr=4, ams=False) pm.textScrollList(self.scrollList, e=True, doubleClickCommand=Callback(self.addFilterAndHide)) for label, nodeType in self.filters(): pm.textScrollList(self.scrollList, edit=True, append=label) pm.rowLayout(numberOfColumns=2, columnAlign2=("center", "center")) pm.button(width=100, label="Add", command=Callback(self.addFilterAndHide)) pm.button(width=100, label="Cancel", command=Callback(pm.deleteUI, self.win, window=True)) pm.setParent('..') pm.setParent('..') pm.showWindow(self.win)
def __init__(self): if pm.window('optionVarEditor', exists=True): pm.deleteUI('optionVarEditor') with pm.window(title='optionVarEditor', widthHeight=(502, 552), s=False) as window: with pm.columnLayout(): with pm.rowColumnLayout(nc=2, cw=[(1, 250), (2, 250)]): # List Column with pm.columnLayout(): self.search = pm.textField(width=248, cc=self.refresh, ec=self.refresh) self.scrollList = pm.textScrollList(height=500, width=250, selectCommand=self._select, ams=True) # Attr Column with pm.columnLayout(): pm.text(l='optionVar Name:') self.name = pm.textField(tx='Name', ed=False, width=248) pm.text(l='optionVar Value:') self.value = pm.textField(tx='value', width=248) # Buttons with pm.rowColumnLayout(nc=3, cw=[(1, 166), (2, 166), (3, 166)]): pm.button(label='Create', c=self._create) pm.button(label='Edit', c=self._edit) pm.button(label='Delete', c=self._delete) self.refresh() # Render Window window.show()
def __init__(self): title = 'pbRenderableCurve' version = 1.02 if pm.window('pbRCurve', exists=True): pm.deleteUI('pbRCurve') with pm.window('pbRCurve', title='{0} | {1}'.format(title, version), s=False) as window: with pm.columnLayout(): with pm.frameLayout(l='Selection:', cll=True, bs='out'): with pm.columnLayout(): self.selField = pm.textFieldGrp(text='No Curves Selected', ed=False, l='Curve:', cw2=[72, 192]) with pm.rowLayout(nc=2): self.bRenderable = pm.checkBox(l='Renderable', cc=self.bcRenderable) with pm.frameLayout(l='Mesh Settings:', cll=True, bs='out') as self.meshUI: with pm.columnLayout(): with pm.rowLayout(nc=4): self.useNormal = pm.checkBox(l='Use Normal', cc=self.bcUseNormal) self.normalVector = [pm.intField(width=62, en=False, value=0, cc=self.setNormal), pm.intField(width=62, en=False, value=1, cc=self.setNormal), pm.intField(width=62, en=False, value=0, cc=self.setNormal)] self.meshAttrs = [AttrSlider(maxValue=128, name='Thickness', obj=getCurves, type_='float', fmn=0.0001), AttrSlider(value=3, minValue=3, maxValue=64, name='Sides', obj=getCurves, fmn=3, fmx=100), AttrSlider(minValue=1, maxValue=32, name='Samples', obj=getCurves, fmn=1, fmx=128)] with pm.frameLayout('Shell Settings:', cll=True, bs='out') as self.shellUI: with pm.columnLayout(): self.bShell = pm.checkBox(l='Enable Shell', cc=self.bcShell) self.shellAttrs = [AttrSlider(value=1, minValue=-64, maxValue=64, name='ShellThickness', obj=getCurves, type_='float'), AttrSlider(value=1, minValue=1, maxValue=64, name='ShellDivisions', obj=getCurves, fmn=1, fmx=32)] window.show() pm.scriptJob(event=['SelectionChanged', self.refresh], protected=True, p=window) self.refresh()
def createTrail(): if pm.window('trailUI',ex=1): pm.deleteUI('trailUI') pm.window('trailUI') pm.columnLayout(adj=1) fsSample = pm.floatSliderGrp('sampleSlider', label='Sample by', cw=(1,70), adj=1, en=1,minValue=0.01, maxValue=100, fieldMinValue=0.01, fieldMaxValue=100,pre=2, field=1, v=1) pm.separator (height=4,style="in") startFrame = pm.playbackOptions(q=1,min=1) currentFrame = pm.currentTime(q=1) if currentFrame > startFrame: startFrame = currentFrame pm.intSliderGrp('startFrameSlider', label='Start frame', cw=(1,70), adj=1, en=1,minValue=0, maxValue=100, fieldMinValue=0, fieldMaxValue=10000, field=1, v=startFrame) pm.popupMenu(button=3,pmc = functools.partial(setTime,'start')) pm.intSliderGrp('endFrameSlider', label='End frame', cw=(1,70), adj=1, en=1,minValue=0, maxValue=100, fieldMinValue=0, fieldMaxValue=10000, field=1, v=startFrame+30) pm.popupMenu(button=3,pmc = functools.partial(setTime,'end')) pm.intSliderGrp('trailDivisions', label='Trail divisions', cw=(1,70), adj=1, en=1,minValue=1, maxValue=100, fieldMinValue=1, fieldMaxValue=10000, field=1, v=40) pm.separator (height=4,style="in") cbUvDistorted = pm.checkBox('cbUV',l='UV distorted',v=1) pm.separator (height=4,style="in") rowBtn = pm.rowColumnLayout(numberOfRows=1) pm.button(l='Create Trail',command=functools.partial(createTrailMesh)) pm.button(l='Rebuil uvs',c=functools.partial(createTrailUv,'')) pm.button(l='ELP !!!',c=openHelpPage) pm.showWindow('trailUI')
def GUI(self): self._win = pmc.window(self.WINDOW_NAME, title=self.WINDOW_TITLE) pmc.columnLayout(adjustableColumn=True) self._slider = pmc.intSliderGrp(label='Segments', field=True, min=2, max=100, value=2) pmc.button(label='Okay', c=pmc.Callback(self._callback)) pmc.button(label='Cancel', c=pmc.Callback(pmc.deleteUI, self._win)) self._win.show()
def __init__(self, debug=0): title="TransferBlendShapes" if(pm.windowPref(title, q=True, ex=True)): pm.windowPref(title, remove=True) if(pm.window(title, q=True, ex=True)): pm.deleteUI(title) self.win = pm.window(title, title="Transfer BlendShapes Tool") self.rowColumnLayoutA = pm.rowColumnLayout() self.intro = pm.text( label='complete the following steps in order' ) self.frameLayoutA = pm.frameLayout(parent=self.rowColumnLayoutA, cl=True, cll=True, label='Step 1 Load Target Mesh', borderStyle='in' ) self.columnlayoutA = pm.columnLayout() self.frameLayoutB = pm.frameLayout(parent=self.rowColumnLayoutA, cl=True, cll=True, label='Step 2 Import Mask', borderStyle='in' ) self.columnlayoutA = pm.columnLayout() self.frameLayoutC = pm.frameLayout(parent=self.rowColumnLayoutA, cl=True, cll=True, label='Step 3 Manipulate Match Mesh', borderStyle='in' ) self.columnlayoutB = pm.columnLayout() self.frameLayoutD = pm.frameLayout(parent=self.rowColumnLayoutA, cl=True, cll=True, label='Step 4 Transfer Blends', borderStyle='in' ) self.columnlayoutC = pm.columnLayout() #self.dockControl = pm.dockControl(label=title, area='right', content=title, allowedArea=['right', 'left'], sizeable=True) # fameA content self.names = {'Target':None} # Generating x number of fields based on dictionary keys of self.names for name in self.names: self.names[name] = pm.textFieldButtonGrp(cw = ((1, 76), (2, 176)), parent=self.frameLayoutA, label = name, placeholderText = 'Enter Name Here or >>>> ', buttonLabel = 'load selected', tcc= self.prepTargetMeshOn, buttonCommand = pm.Callback(self.nameField_load, name)) self.btn_prepTgt = pm.button(parent=self.frameLayoutA, enable=False, w=40, h=20, label="Prep Target", command=self.prepTargetMesh) self.fA_fillText = pm.text(parent=self.frameLayoutA, label=' ' ) # fameB content self.importText = pm.text(parent=self.frameLayoutB, label='Import the desired facial mask' ) self.manipulateText = pm.text(parent=self.frameLayoutB, label='Use the avalable controls to manipulate the mask' ) self.fitText = pm.text(parent=self.frameLayoutB, label='Roughly fit the mask to the target mesh' ) self.btn_trueHuman = pm.button(parent=self.frameLayoutB, enable=True, w=40, h=20, label="Human Anatomy", command=self.humanAnatomyImport) self.btn_trueMuzzle = pm.button(parent=self.frameLayoutB, enable=False, w=40, h=20, label="Muzzle Anatomy", command=self.muzzleAnatomyImport) self.btn_toonHuman = pm.button(parent=self.frameLayoutB, enable=False, w=40, h=20, label="Human Toon", command=self.humanToonImport) self.btn_toonMuzzle = pm.button(parent=self.frameLayoutB, enable=False, w=40, h=20, label="Muzzle Toon", command=self.muzzleToonImport) self.fB_fillText = pm.text(parent=self.frameLayoutB, label=' ' ) # fameC content self.matchMeshText = pm.text(parent=self.frameLayoutC, label='activate match mesh and refine your geometry to better match the target' ) self.btn_trueHuman = pm.button(parent=self.frameLayoutC, enable=True, w=40, h=20, label="Activate Match Mesh", command=self.matchMesh) self.btn_templateHuman = pm.button(parent=self.frameLayoutC, enable=True, w=40, h=20, label="template Target Mesh", command=self.tempTgt) self.btn_referenceHuman = pm.button(parent=self.frameLayoutC, enable=True, w=40, h=20, label="reference Target Mesh", command=self.refTgt) self.sldr_smooth = pm.intSliderGrp(parent=self.frameLayoutC, field=True, label='Match Mesh Divisions', minValue=-0, maxValue=4, fieldMinValue=-0, fieldMaxValue=4, value=0, cc=self.div_Slider_change) self.fC_fillText = pm.text(parent=self.frameLayoutC, label=' ' ) # fameD content self.btn_go = pm.button(parent=self.frameLayoutD, enable=True, w=40, h=20, label="Transfer Shapes", command=self.execute) self.btn_no = pm.button(parent=self.frameLayoutD, enable=True, w=40, h=20, label="NO DONT DO IT!", command=self.close) self.fE_fillText = pm.text(parent=self.frameLayoutD, label=' ' ) self.win.show() if debug: test = ['mask_blendPipe_GEO', 'mask_hiRes_GEO'] for name, test_val in zip(self.names, test): self.names[name].setText(test_val)
def __init__(self, questions_file): self.file = open(questions_file, 'r') self.questions = self.file.readlines() self.file.close() self.main_layout = pm.columnLayout() self.name_field = pm.textFieldGrp(label= 'Quiz Name') self.layout = pm.rowColumnLayout(numberOfColumns= 2, columnWidth= ([1, 75], [2, 475])) pm.columnLayout() pm.text(label= 'Questions') self.question_scroll_list = pm.textScrollList(width= 60, height= 400, selectCommand= pm.Callback(self.read_questions), allowMultiSelection= True) pm.setParent(self.layout) pm.columnLayout() pm.text(label= 'Questions Info') self.question_scroll_field = pm.scrollField(wordWrap= True, height= 400, width= 475) pm.setParent(self.main_layout) pm.button(label= 'Create Quiz', command= pm.Callback(self.create_quiz), width= 550, height= 50) self.list_questions()
def layersReplace(self, attribute): if attribute is not "none": self.thisNode = pm.PyNode(attribute).node() log.debug("layersReplace {0}".format(attribute)) pm.setUITemplate("attributeEditorTemplate", pushTemplate=True) materialEntries = self.thisNode.materialEntryMtl.numElements() #print "layersReplace: node has ", self.thisNode.materialEntryMtl.numElements(), "layers" if self.layersUi is not None and pm.columnLayout(self.layersUi, q=True, exists=True): pm.deleteUI(self.layersUi) with pm.columnLayout(adj=True, parent=self.uiParent) as self.layersUi: for layerNumber in range(materialEntries): layerIndex = self.thisNode.materialEntryMtl.elementByPhysicalIndex(layerNumber).index() with pm.frameLayout(label="Layer {0}".format(layerNumber), collapsable=True, collapse=False, bv=True) as fl: log.debug("create layers UI {0}".format(self.thisNode.materialEntryMtl[layerIndex])) with pm.columnLayout(adj=True): attribute = self.thisNode.materialEntryMtl[layerIndex] if attribute.isConnected(): pm.frameLayout(fl, edit=True, label=attribute.inputs(p=1)[0]) pm.attrColorSliderGrp(label="Material", at=attribute) attribute = self.thisNode.materialEntryMsk[layerIndex] pm.attrFieldSliderGrp(label="Mask", at=attribute) attribute = self.thisNode.materialEntryMode[layerIndex] pm.attrEnumOptionMenuGrp(label="Mode", at=attribute) with pm.columnLayout(adj=True): pm.button(label="Remove Layer", c=pm.Callback(self.removeLayer, layerIndex), height=18) pm.button(label="Layer Up", c=pm.Callback(self.moveLayerUp, layerIndex), height=18) pm.button(label="Layer Down", c=pm.Callback(self.moveLayerDown, layerIndex), height=18) pm.setUITemplate("attributeEditorTemplate", popTemplate=True)
def __init__(self, baseUi, parent): BaseUi.__init__(self, parent) self.uiparent = parent self.baseUi = baseUi self.tmpJnts = [] self.defaultAxis = 'y' #ui try: pm.deleteUI(self.rigCol) except: pass with pm.columnLayout(adj=True, rs=3, parent=self.uiparent) as self.rigCol: with pm.rowColumnLayout(nc=2, co=[(1, 'left', 155), (2, 'left', 5)]): pm.text(l='axis') with pm.optionMenu(w=60) as self.axisMenu: pm.menuItem(l='x') pm.menuItem(l='y') pm.menuItem(l='z') with pm.columnLayout(adj=True, rs=2, co=['left', 165]): self.ribbonChkBox = pm.checkBox(l='Ribbon Lo/Hi', v=False) with pm.rowColumnLayout(nc=3, co=[(1, 'left', 30), (2, 'left', 5), (3, 'left', 5)]): pm.text(l='tmpJnts') self.tmpJntsTxtFld = pm.textField(w=230, ed=False) self.loadTmpJntButt = pm.button(l='<<', c=pm.Callback(self.loadTmpJnts)) self.axisMenu.setValue(self.defaultAxis) self.baseUi.clearElemSideTxtFld()
def multi_polyQuad(): args,counter = pm.ls(sl=True),1 w=400 window = pm.window(w=w,h=40) pm.columnLayout() progressMessage=pm.text(l='Running through Objects...',w=w) argName=pm.text(l='',w=w) progressControl = pm.progressBar(isInterruptable=True, beginProgress=True, maxValue=len(args), width=w) window.show() for arg in args: if pm.progressBar(progressControl, query=True, isCancelled=True ) : break progressMessage.setLabel('Cleaning up then Quadding object '+str(counter)+'/'+str(len(args))+':') argName.setLabel(arg) pm.select(arg,r=True) #cleanup mesh mel.eval('polyCleanupArgList 3 { "0","1","0","0","0","0","0","0","0","1e-05","0","1e-05","0","1e-05","0","1","0" };') #quad all polies pm.polyQuad(arg, a=30, kgb=False, ktb=False,khe=False,ws=True,ch=False) #merge all verts pm.polyMergeVertex((arg+'.vtx[0:'+str(pm.polyEvaluate(arg,v=True))+']'), d=.001,am=True,ch=0) pm.polyNormalPerVertex(arg,ufn=True) pm.polySoftEdge(arg,angle=68, ch=0) pm.progressBar(progressControl, edit=True, step=1) counter+=1 pm.progressBar(progressControl, edit=True, endProgress=True) pm.select(args, r=True) pm.selectMode(o=True) window.delete()
def createUI(): global m2uwin if m2uwin is not None: pm.deleteUI(m2uwin, window=True) v = m2u.getVersion() m2uwin = pm.window( title="m2u "+v+" (maya)", iconName='m2u', widthHeight=(150, 300) ) pm.columnLayout() pm.rowLayout(numberOfColumns = 2) pm.button( label='Connect', c=cbConnect ) pm.button( label='Setup Cameras', c=cbSetupCamera ) pm.setParent('..') pm.checkBox( label='Sync Camera', onc = cbSyncCamera, ofc = cbSyncCameraOff, v = False) pm.checkBox( label='Sync Objects', onc = cbSyncObjects, ofc = cbSyncObjectsOff, v = False) pm.checkBox( label='Sync Visibility', onc = cbSyncVisibility, ofc = cbSyncVisibilityOff, v = False) pm.separator() pm.button( label='Fetch Selected', c = cbFetchSelected) pm.button( label='Send Selected To Editor', c = cbSendSelectedToEd) #pm.button( label='Import Content Test', c = cbUDKImportContent) pm.setParent( '..' ) pm.showWindow( m2uwin )
def createRadioBtnObj( self ): """ creates a RadioButton Element """ if mel.scrollLayout(self._scrollField, ex=True): mel.setParent( self._ActionCol) mel.separator(h=10,style="none") ObjUIpath = mel.frameLayout(mw=10,l="Radio Buttons") mel.columnLayout('sampleCol') mel.separator(h=10,style="none") mel.radioButtonGrp('rbg',nrb=3, l="Big Options", select=self.gSampleState['rbg'], la3=("Option 1", "Option 2", "Option 3")) mel.radioButtonGrp('rbg2',nrb=3, l="Little Options", select=self.gSampleState['rbg'], la3=("Option 4", "Option 5", "Option 6")) mel.separator(h=10,style="none") return ObjUIpath
def ui(): columnWidth1st = 120 if pm.window('AlembicMasterUI', q=True, exists=True) : pm.deleteUI('AlembicMasterUI') with pm.window('AlembicMasterUI',menuBar=True, s=True): with pm.columnLayout(adj=True): with pm.frameLayout( label='Export Alembic', mw=3, mh=3,cll=True, bs='etchedIn'): with pm.columnLayout(adj=True): with pm.rowLayout(nc=3, adj=2): pm.text(label='file :', w=columnWidth1st, align='right') pm.textField('path_TFG', text="D:/") pm.symbolButton( image='navButtonBrowse.png', c=pm.Callback( browseIt, 'path_TFG', 0, 'Alembic (*.abc)' ) ) with pm.rowLayout(nc=2, adj=2 ): startFrame=pm.animation.playbackOptions(q=1, minTime=1) EndFrame=pm.animation.playbackOptions(q=1, maxTime=1) with pm.rowLayout(nc=2, adj=2): pm.text(l='',w=columnWidth1st) pm.button(l='Export',bgc=(0.19,0.29,0.19),c=pm.Callback(exportScene)) pm.radioButtonGrp( 'timeRange_RBG', label='Time range :', labelArray3=['Camera Setting','Time Slider', 'Start/End'], numberOfRadioButtons=3, select=1, cw = [1,columnWidth1st], on1=pm.Callback( callback_timerangeSelect, 1), on2=pm.Callback( callback_timerangeSelect, 2), on3=pm.Callback( callback_timerangeSelect, 3), ) pm.floatFieldGrp( 'timeRange_FFG', label='Start / End : ', value1=1, value2=24, numberOfFields=2, cw = [1,117], en=False) with pm.frameLayout( label='Rebuild Scene', mw=3, mh=3,cll=True, bs='etchedIn'): with pm.columnLayout(adj=True): with pm.rowLayout(nc=2, adj=2): pm.text(l='',w=columnWidth1st) pm.button(l='New Scene', bgc=(0.24,0.49,0.24), c=pm.Callback(buildscene)) with pm.frameLayout( label='Import Alembic', mw=3, mh=3,cll=True, bs='etchedIn'): with pm.columnLayout(adj=True): with pm.rowLayout(nc=3, adj=2): pm.text(label='file :', w=columnWidth1st, align='right') pm.textField('path_ABC2', text="D:/") pm.symbolButton( image='navButtonBrowse.png', c=pm.Callback( browseIt, 'path_ABC2', 1, 'Alembic (*.abc)' ) ) with pm.rowLayout(nc=2, adj=2): pm.text(l='',w=columnWidth1st) pm.button(l='Import', bgc=(0.19,0.19,0.28), c=pm.Callback(importAbcFile)) with pm.frameLayout( label='Save Scene', mw=3, mh=3,cll=True, bs='etchedIn'): with pm.columnLayout(adj=True): with pm.rowLayout(nc=3, adj=2): pm.text(label='file :', w=columnWidth1st, align='right') pm.textField('path_TFG2', text="D:/") pm.symbolButton( image='navButtonBrowse.png', c=pm.Callback( browseIt, 'path_TFG2', 0 ) ) with pm.rowLayout(nc=2, adj=2): pm.text(l='',w=columnWidth1st) pm.button(l='Save Scene', w=64, bgc=(0.22,0.23,0.43), c=pm.Callback(saveScene))
def initUI(self): pm.setUITemplate("DefaultTemplate", pushTemplate=True) form = pm.formLayout() versionData = pm.mayatoCorona(version=True) license = versionData[7].split("\r\n") with pm.columnLayout('AboutLayout') as StandinLayout: with pm.rowColumnLayout('AboutColumnLayout', nc=2, columnWidth=((1, 160), (2, 220)), co=(2, "left", 10)): pm.text(label="mayaToCorona:", align="right") pm.text(label=versionData[0], align="left") pm.text(label="Corna version:", align="right") pm.text(label=versionData[1], align="left") pm.text(label="OIIO:", align="right") pm.text(label=versionData[2], align="left") pm.text(label="OSL:", align="right") pm.text(label=versionData[3], align="left") pm.text(label="BOOST:", align="right") pm.text(label=versionData[4], align="left") pm.text(label="OpenEXR:", align="right") pm.text(label=versionData[5], align="left") pm.text(label="License type:", align="right") pm.text(label=license[0], align="left") pm.text(label="Valid until:", align="right") pm.text(label=license[1].replace("Activated until: ", ""), align="left") pm.separator() with pm.columnLayout(): pm.text(label="Corona Renderer\n(c) Render Legion s.r.o., 2014-2015", align="center") #pm.textField(text="Corona Renderer (c) Render Legion s.r.o., 2014-2015") pm.formLayout(form, edit=True, attachForm=[(StandinLayout, 'top', 5), (StandinLayout, 'bottom', 5), (StandinLayout, 'right', 5), (StandinLayout, 'left', 5)]) pm.setUITemplate("DefaultTemplate", popTemplate=True)
def ui(): if pm.window(win, q=True, exists=True ): pm.deleteUI(win) with pm.window(win, wh=[300,600], t=title): with pm.frameLayout( lv=False, cll=False, mw=1, mh=1): with pm.columnLayout(adj=True): with pm.tabLayout(tv=False): with pm.frameLayout(lv=False, cll=False, mw=2, mh=2, bv=False): with pm.rowLayout(nc=3, adj=2): pm.image( image = shelfIcon ) pm.text(l=' %s'%title, fn='boldLabelFont', align='left') pm.image( image = alfredIcon ) pm.separator( h=8, style='in') with pm.frameLayout(lv=False, cll=False, mw=0, mh=0, bv=False): with pm.frameLayout(lv=False, cll=False, mw=3, mh=3, bv=False): # Scene ----------------------- with pm.frameLayout(l='Scene', cll=True, mw=3, mh=3 ): with pm.columnLayout(adj=True): with pm.rowLayout( nc=10 ): pm.text(label='Reference Editor 2 : ', align='right', w=150) pm.button(label='Open UI...', w=180, en=False ) with pm.rowLayout( nc=10 ): pm.text(label='File Traveler : ', align='right', w=150) pm.button(label='Open UI...', w=180, en=False ) # Camera ----------------------- with pm.frameLayout(l='Camera', cll=True, mw=3, mh=3 ): with pm.columnLayout(adj=True): with pm.rowLayout( nc=10 ): pm.text(label='Create Camera : ', align='right', w=150) with pm.columnLayout(): pm.button(label='Create Turntable Camera', w=180, en=False ) pm.button(label='Create Frustum Camera', w=180, en=False ) pm.button(label='Create Stereo Camera', w=180, en=False ) with pm.rowLayout( nc=10 ): pm.text(label='Set Camera Playback Range : ', align='right', w=150) pm.button(label='set', c=pm.Callback( sm.setCamPlaybackRange ), w=180 ) with pm.rowLayout( nc=10 ): pm.text(label='HUD : ', align='right', w=150) pm.button(label='Scene Name HUD', w=180, en=False ) with pm.rowLayout( nc=10 ): pm.text(label='Export Camera : ', align='right', w=150) pm.button(label='for After Effect...', w=180, en=False ) # Asset ----------------------- with pm.frameLayout(l='Asset', cll=True, mw=3, mh=3 ): with pm.columnLayout(adj=True): with pm.rowLayout( nc=10 ): pm.text(label='Toggle Display CharacterGeo : ', align='right', w=150) pm.button(label='( preview / render )', c=pm.Callback( sm.toggleDisplayCharacterGeo ), w=180 )
def _buildupWindow(self): if isinstance(self._window, _pmCore.uitypes.Window) and self._window.exists(self._window.name()): _pmCore.deleteUI(self._window, window=True) self._window = _pmCore.window(title=self._winTitle) _pmCore.columnLayout(adjustableColumn=True) _pmCore.scrollLayout(width=300, height=250, childResizable=True) _pmCore.gridLayout(numberOfColumns=2, cellHeight = self._iconSize, cellWidth=self._iconSize) for versionNum in _Database.getVersionList(self._fileID): versionInfo = _Database.getVersionInfo(self._fileID, versionNum) print versionInfo thumbnailPath = versionInfo[3] if not _os.path.exists(versionInfo[3]): thumbnailPath = "cube.png" button = _pmCore.iconTextButton(self._versionBtnName(versionNum), style='iconAndTextVertical', image1=thumbnailPath, label=self._versionBtnName(versionNum), command=_pmCore.Callback(self._versionSelected, versionNum)) self._uiWidget[self._versionBtnName(versionNum)] = button _pmCore.setParent('..') _pmCore.setParent('..') _pmCore.separator(style='none', height=10) _pmCore.text(label="Comments: ", align='left') self._uiWidget['commentLayout'] = _pmCore.scrollLayout(width=300, height=120, childResizable=True) _pmCore.setParent('..') _pmCore.separator(style='none', height=10) self._uiWidget['comment'] = _pmCore.scrollField(width=300, height=80) _pmCore.button(label='Add Comment', command=_pmCore.Callback(self._commentAdded))
def role_mqsb_switch(status, *args): pm.rowLayout(srcAddr, e= 1, vis= 1 if status else 0) pm.rowLayout(disAddr, e= 1, vis= 0 if status else 1) pm.textField(tcHost_txt, e= 1, tx= '', ed= 1 if status else 0) pm.textField(tcPort_txt, e= 1, tx= '', ed= 1 if status else 0) pm.columnLayout(remap_Area, e= 1, en= 1 if status else 0) pm.columnLayout(exect_Area, e= 1, en= 1 if status else 0)
def __init__(self): winName = 'SineRigWin333' if pm.window(winName, exists=1): pm.deleteUI(winName,window=1) win = pm.window(winName, t='SineRig') pm.columnLayout(adj=1) pm.text('X Axis should be joint chain aim axis.') # Control self.cnt_fld = pm.textFieldButtonGrp(l='Control',bl='Load') pm.textFieldButtonGrp( self.cnt_fld, e=1, bc=lambda: pm.textFieldButtonGrp(self.cnt_fld,e=1,text=pm.ls(sl=1)[0]) ) # Name self.name_fld = pm.textFieldGrp(l='Name') # Base jnt self.base_fld = pm.textFieldButtonGrp(l='Base Joint',bl='Load') pm.textFieldButtonGrp( self.base_fld, e=1, bc=lambda: pm.textFieldButtonGrp(self.base_fld,e=1,text=pm.ls(sl=1)[0]) ) # Tip jnt self.tip_fld = pm.textFieldButtonGrp(l='Tip Joint',bl='Load') pm.textFieldButtonGrp( self.tip_fld, e=1, bc=lambda: pm.textFieldButtonGrp(self.tip_fld,e=1,text=pm.ls(sl=1)[0]) ) # Create button pm.button(l="Create",c=self.createRig) ##### Development Aide pm.textFieldButtonGrp(self.cnt_fld,e=1,text='TopFin_Base_ctrlA') pm.textFieldGrp(self.name_fld,e=1,text='Fin') pm.textFieldButtonGrp(self.base_fld,e=1,text='TopFinA_jnt_1') pm.textFieldButtonGrp(self.tip_fld,e=1,text='TopFinA_jnt_12') pm.showWindow(win)
def create(self): self.main_layout = pm.columnLayout(adjustableColumn= True, width= 400) main_frame = pm.frameLayout( label='%s' % (self.obj), collapsable= True) pm.columnLayout(adjustableColumn= False, width= 400) self.mapping_menu = pm.optionMenu( label='Mapping', width= 150, changeCommand= pm.Callback(self.mapping_type, self.obj)) pm.menuItem( label='Spherical') pm.menuItem( label='Angular') pm.setParent(main_frame) self.type_menu = pm.optionMenu( label='Type', width= 150, changeCommand= pm.Callback(self.file_type, self.obj)) pm.menuItem( label='Image File') pm.menuItem( label='Texture') self.image_field = pm.textFieldButtonGrp(label= 'Image Name', editable= False, columnWidth3= [100,200,100], buttonLabel= '<<<', buttonCommand= pm.Callback(self.load_image, self.obj)) self.list_field = pm.textScrollList(allowMultiSelection= False , width= 100, height= 100) pm.attrColorSliderGrp( at='%s.color' % (self.obj), columnWidth4= [100, 75, 175, 50]) pm.rowColumnLayout(numberOfColumns= 2, columnWidth= ([1, 200], [2, 200])) pm.button(label= 'List Ramps', command= pm.Callback(self.list_textures)) pm.button(label= 'Link Ramps', command= pm.Callback(self.link_texture, self.obj)) pm.button(label= 'Edit Ramps', command= pm.Callback(self.edit_ramp)) pm.button(label= 'Create Ramps', command= pm.Callback(self.create_ramp))
def __init__(self, path): self.path = path # the path to save the presets preset_win = 'preset_win' if pm.window(preset_win, exists= True): pm.deleteUI(preset_win) if pm.windowPref(preset_win, exists= True): pm.windowPref(preset_win, remove= True) temp_win = pm.window(preset_win, title= 'presets', width= 300,sizeable= False) pm.columnLayout(adjustableColumn= True) pm.text(label= '') pm.text(label= 'Preset Name') self.field = pm.textField() pm.text(label= '') pm.text(label= 'Description') pm.text(label= '') self.scroll = pm.scrollField(width= 300, wordWrap= True) pm.text(label= '') pm.button(label= 'Create Preset', command= pm.Callback(self.create_preset)) pm.text(label= '') temp_win.show()
def gui(): ''' creates the gui for the tool ''' win = 'uvtools' if(pm.window(win, ex = True)): pm.deleteUI(win) if(pm.windowPref(win, ex = True)): pm.windowPref(win, remove = True) global scroll_list, dyn_uis myWin = pm.window(win, title='Anim UV Tool' , sizeable = True, mnb = True, width = 500, height = 400, backgroundColor= [.68,.68,.68]) pm.scrollLayout(width= 500) pm.button(label= 'Creates Nodes', command= create_nodes, width= 500) row_layout = pm.rowColumnLayout(numberOfColumns= 3, columnWidth= [[1, 150], [2, 10], [3, 340]]) pm.columnLayout(adjustableColumn= False, width=150) scroll_list = pm.textScrollList(width= 150, height= 200, selectCommand= pm.Callback(create_ui)) pm.button(label= 'List Nodes', command= list_nodes, width= 148) pm.setParent(row_layout) pm.text(label= '') dyn_uis = pm.columnLayout(adjustableColumn= False, width= 340) # listing the nodes at start up list_nodes() myWin.show()
def createSliderObj( self ): """ creates a Slider Element """ # control=str(mel.scriptedPanel(self.__name__, # q=1,control=1)) # mel.setParent(control) # mel.setParent(self.panelUIpath) if mel.scrollLayout(self._scrollField, ex=True): # mel.setParent(control+'|'+self._scrollField+'|'+self._rowColumn) mel.setParent( self._ActionCol) mel.separator(h=10,style="none") ObjUIpath = mel.frameLayout(mw=10,l="Sliders") mel.columnLayout('sampleCol',adj=True) mel.separator(h=10,style="none") mel.floatSliderGrp('fsg1',v=self.gSampleState['fsg1'], l="Property A",f=True) mel.floatSliderGrp('fsg2',v=self.gSampleState['fsg2'], l="Property B",f=True) mel.floatSliderGrp('fsg3',v=self.gSampleState['fsg3'], l="Property C",f=True) mel.separator(h=10,style="none") # mel.setParent('..') # mel.setParent('..') return ObjUIpath
def initUI(self): pm.setUITemplate("DefaultTemplate", pushTemplate=True) form = pm.formLayout() binMeshExportPath = pm.optionVar.get('mtap_binMeshExportPath', pm.workspace.path + "/geo/export.binarymesh") prefix = pm.optionVar.get('mtap_binMeshExportPathPrefix', "prefix") createProxy = pm.optionVar.get('mtap_binMeshCreateProxy', True) percentage = pm.optionVar.get('mtap_binMeshPercentage', 0.1) createStandin = pm.optionVar.get('mtap_binMeshCreateStandin', True) oneFilePerMesh = pm.optionVar.get('mtap_binMeshOneFilePerMesh', False) useTransform = pm.optionVar.get('mtap_binMeshUseTransform', False) with pm.columnLayout('StandinLayout') as StandinLayout: with pm.frameLayout('StandinLayout', label="Standin export options", collapsable=False): with pm.columnLayout('StandinColumnLayout'): self.pathUI = pm.textFieldButtonGrp(label="Standin directory", text=binMeshExportPath, buttonLabel="File", buttonCommand=self.fileBrowser) self.prefixUI = pm.textFieldGrp(label="Prefix", text=prefix) self.createProxyUI = pm.checkBoxGrp(label="Create proxy", value1=createProxy) self.percentageUI = pm.floatFieldGrp(label="Percentage", value1=percentage) self.createStdInUI = pm.checkBoxGrp(label="Create StandIn", value1=createStandin) self.oneFilePerMeshUI = pm.checkBoxGrp(label="One File Per Mesh", value1=oneFilePerMesh) self.doTransformUI = pm.checkBoxGrp(label="Use Transform", value1=useTransform) with pm.rowColumnLayout(numberOfColumns=2): pm.button(label="Create BinaryMesh", c=self.doit) pm.button(label="Cancel", c=self.cancel) pm.formLayout(form, edit=True, attachForm=[(StandinLayout, 'top', 5), (StandinLayout, 'bottom', 5), (StandinLayout, 'right', 5), (StandinLayout, 'left', 5)]) pm.setUITemplate("DefaultTemplate", popTemplate=True)
def UI(): defUI = pm.window(t = "rig companion", w = 200) pm.columnLayout(adjustableColumn=True) pm.button(l = "create X circle (anim)!", c = lambda *args: SmartRig_createHelpers.createCircle([1,0,0])) pm.button(l = "create Y circle (anim)!", c = lambda *args: SmartRig_createHelpers.createCircle([0,1,0])) pm.button(l = "create Z circle (anim)!", c = lambda *args: SmartRig_createHelpers.createCircle([0,0,1])) pm.text(l = "-------------") pm.button(l = "create locator 1!", c = lambda *args: SmartRig_createHelpers.createLoc(1) ) pm.button(l = "create locator 0.5 !", c = lambda *args: SmartRig_createHelpers.createLoc(0.5) ) pm.button(l = "create locator 0.2 !", c = lambda *args: SmartRig_createHelpers.createLoc(0.2) ) pm.text(l = "-------------") pm.button(l = "create zero !", c = lambda *args: SmartRig_createHelpers.createZero()) pm.text(l = "-------------") pm.button(l = "create dimension !", c = lambda *args: SmartRig_createHelpers.creatDist() ) pm.text(l = "-------------") pm.button(l = "add IK attributes", c = lambda *args: smartRig_AddAttr.addAttrIK()) pm.button(l = "add switch attributes", c = lambda *args: smartRig_AddAttr.addAttrSwitch() ) pm.text(l = "-------------") pm.button(l = "create plane", c = lambda *args: smartRig_makeRibbon.createPlane()) pm.button(l = "make ribbon", c = lambda *args: smartRig_makeRibbon.makeRibbon()) pm.text(l = "-------------") # pm.button(l = "reset position", c = lambda *args: smartAnim.resetPosRot() ) pm.text(l = "-------------") pm.button(l = "add curve info", c = lambda *args: smartRig_ikCurve.curveInfo() ) pm.showWindow(defUI)
def GUI(self): # Create GUI with window and 3 buttons self._win = pmc.window(self.WINDOW_NAME, title = self.WINDOW_TITLE) pmc.columnLayout(adjustableColumn = True) pmc.button(label = "Stretch It!", c = pmc.Callback(self._callbackBind)) pmc.button(label = "Cancel", c = pmc.Callback(pmc.deleteUI, self._win)) self._win.show()
def initialiseLayout(self): """ define the layout of the ui, also find every module under the TOOL_FOLDER, create a button for each module found""" logger.debug("Function Called ( %s )"%inspect.stack()[0][3]) # Define Layout self.widgets["topLevel_scroll"] = pm.scrollLayout(childResizable=True, width=self.windowWidth+25) # Add top banner to the toolbox pm.text("Animation GUI", align='center', font='boldLabelFont', height=20, bgc=[0,0,0]) #pm.text("", align='center', font='boldLabelFont', height=5, bgc=[0,0,0]) self.widgets['topLevel_tabLayout'] = pm.tabLayout(innerMarginWidth=5, innerMarginHeight=5) tab_folders = [dir for dir in os.listdir( self.top_folder_path ) if not dir.startswith("_") and dir.find('.') == -1] tab_folders = sort_with_index(tab_folders, self.top_folder_path) tab_index = 1 for tab_folder in tab_folders: pm.setParent(self.widgets["topLevel_tabLayout"]) #self.widgets['%s_frameLayout'%tab_folder] = pm.frameLayout ( label = tab_folder, collapsable = True, bgc = [0.15,0.15,0.15]) self.widgets['%s_columnLayout'%tab_folder] = pm.columnLayout(adj=True) tab_folder_path = os.path.join( self.top_folder_path, tab_folder) frame_folders = [dir for dir in os.listdir(tab_folder_path) if not dir.startswith("_") and dir.find('.')==-1] frame_folders = sort_with_index(frame_folders, tab_folder_path) logger.info ("%s|| TabLayout Created" %(tab_folder.ljust(40))) for frame_folder in frame_folders: pm.setParent(self.widgets['%s_columnLayout'%tab_folder]) self.widgets['%s_frameLayout'%frame_folder] = pm.frameLayout ( label = frame_folder, collapsable = True) self.widgets['%s_columnLayout'%frame_folder] = pm.columnLayout (adj=True) frame_folder_path = os.path.join(tab_folder_path, frame_folder) layout_folders = [dir for dir in os.listdir( frame_folder_path ) if not dir.startswith("_") and dir.find('.') == -1] layout_folders = sort_with_index(layout_folders, frame_folder_path) logger.info (" %s|| FrameLayout Created" %(frame_folder.ljust(35))) for module in layout_folders : #print "\tCreate layout for (%s.%s.%s)" %() pm.setParent(self.widgets['%s_columnLayout'%frame_folder]) try : mod = __import__ (".".join([self.top_folder, tab_folder, frame_folder, module, module]), (), (), [module]);reload(mod) mod.main() logger.info (" %s|| Layout Created" %(module.ljust(30))) except Exception, error: logger.error(' %s|| %s'%(module.ljust(30), str(error)), level='error') #print '\t\tERROR: ' + str(error) + ", skipping..." #pm.tabLayout( tabs, edit=True, tabLabel=((child1, 'One'), (child2, 'Two')) ) pm.tabLayout( self.widgets['topLevel_tabLayout'], e=True, tabLabelIndex=[tab_index, tab_folder]) tab_index += 1
def _gatherEvents(self, instance): """event collector called once after the first Idle Event""" message = "Gathered events by '%s':\n" % instance # get the Id for the key inverseID=dict(zip(self.eventID.values(),self.eventID.keys())) # prompt Result for Id in self.eventRecord: token = str(" ID %4d Event: %s \n" % (Id, inverseID.get(Id,0))) message = message + token # --------------create new UI entry--------------- objUI = self._UIobject.createTextfieldObj(message, "eventID: %s" % inverseID.get(self.eventRecord[0],0),True) mel.setParent(objUI) mel.frameLayout(mw=self._optionMarginWidth,l = 'Command Inspect', collapse = True, collapsable = True) mel.columnLayout('subCol',adj=True) mel.separator(h=self._optionMarginWidth,style="none") mel.scrollField(numberOfLines=3, editable=False, wordWrap=False, h = self._optionInspectHeight, w = self._optionInspectWidth, text = "place Holder" ) mel.separator(h=self._optionMarginWidth,style="none") # reset Event Collection self.eventRecord = [] self.eventID["idle"] = 0
def ui_fixComponentShading(*args): ### UI setup global UI_name UI_name = [ 'chk_find', 'chk_fix', 'chk_layer', 'btn_run' ] if pm.window( 'fix_component_shading', exists=True ): pm.deleteUI( 'fix_component_shading', window=True ) ui_layout['window'] = pm.window( 'fix_component_shading', title='Fix Component Shading', sizeable=False, h=200, w=200 ) ui_layout['mainLayout'] = pm.columnLayout( columnAlign='left', columnAttach=['left', 0] ) pm.checkBox( UI_name[0], label=' Find Component Shading Object', value=1, w=200, p=ui_layout['mainLayout'] ) pm.checkBox( UI_name[1], label=' Fix Component Shading Object', w=200, p=ui_layout['mainLayout'] ) pm.checkBox( UI_name[2], label=' Fix Ecah Render Layer', w=200, p=ui_layout['mainLayout'] ) ui_layout['ui_sub1'] = pm.formLayout(p=ui_layout['mainLayout'] ) btn = pm.button( UI_name[3] ,label=' Execute !', command=pm.Callback( doExecution ), w=100, p=ui_layout['ui_sub1'] ) pm.formLayout( ui_layout['ui_sub1'], e=True, attachForm=[ (btn, 'left', 50 ) ] ) pm.separator( h=8, w=200, style='single', p=ui_layout['mainLayout'] ) ui_layout['ui_sub2'] = pm.columnLayout(p=ui_layout['mainLayout'] ) pm.text(label=' --- This script will keep the material \n in the CURRENT render layer, so \n it better to run it in MASTER layer! --- ', bgc=[0.05, 0.05, 0.05], align='left', p=ui_layout['ui_sub2'] ) pm.showWindow( ui_layout['window'] )
def customLightFiltersNew(self, attr): pm.rowLayout(numberOfColumns=3, adjustableColumn=2, rowAttach=(1, "top", 0), columnWidth=[(1, 140), (2, 180)]) pm.text(label="") pm.columnLayout(adjustableColumn=True, columnAttach=("both", 0), rowSpacing=5) uiName = '%s_aiFilter' % (self.nodeType()) self.scrollList = pm.textScrollList( uiName, height=150, ams=False, sc=self.lightFilterListChanged, dcc=self.updateCustomLightFiltersNew) pm.rowLayout(numberOfColumns=2, columnWidth2=(80, 80), columnAttach2=("both", "both"), columnAlign2=("center", "center"), columnOffset2=(2, 2)) pm.button('lf_add_button', label="Add", c=Callback(self.addLightFilterWin)) pm.button('lf_remove_button', label="Disconnect", c=Callback(self.removeLightFilter)) # implicit end of row layout pm.setParent('..') # back to column layout pm.setParent('..') # back to row layout pm.columnLayout(adjustableColumn=True, columnAttach=("both", 0), rowSpacing=5) pm.symbolButton('lf_move_up_button', image='arrowUp.xpm', c=Callback(self.moveLightFilterUp)) pm.symbolButton('lf_move_down_button', image='arrowDown.xpm', c=Callback(self.moveLightFilterDown)) pm.setParent('..') pm.setParent('..') self.addOptionMenuGrp = pm.optionMenuGrp( 'lf_add_menu', label='Add', changeCommand=self.addLightFilterCB) self.addOptionMenu = self.addOptionMenuGrp + '|OptionMenu' self.lightFiltersUpdateList() self.updateAddMenu()
def displayDialog(self, txet=None): ''' @text : str , This is the text is error result ''' window = pm.window(title="outcome display", iconName='Short Name', widthHeight=(200, 70)) pm.columnLayout(adjustableColumn=True) cmds.text('') txetList = txet.split(' ') for s in txetList: cmds.text(label=s, align='center') pm.setParent('..') pm.showWindow(window)
def __init__(self): self.customColor = [1.0, 1.0, 1.0] columnLayout(w=100, h=100) self.surfacePalette = palettePort(dim=(7, 4), w=(7 * 20), h=(4 * 20), td=True, colorEditable=False) self.surfacePalette.changeCommand( core.alt.Callback(self.changeSurfaceColor)) self.surfacePalette.setRgbValue([0] + self.customColor) for i, (name, c) in enumerate(core.shader.namedColors.items()): self.surfacePalette.setRgbValue([i + 1] + list(c))
def __init__(self): win = 'BlendshapeCorrectiveWin' if pm.window(win, exists=True): pm.deleteUI(win, window=True) window = pm.window(win, title="Blendshape Corrective", iconName=win) pm.columnLayout(adjustableColumn=True) pm.separator() pm.columnLayout(adjustableColumn=True) pm.button(label='Create Corrective Shape', c=self.generateShape) pm.setParent('..') pm.showWindow(window)
def target_attr_list_column(self): pm.columnLayout(adj=1, rs=5) pm.text(label=u"Target Object:", al="left") pm.textField("targetObjectField", w=250) pm.textScrollList("targetObjectAttrScrollList", sc=lambda *args: self.print_selected_item( widget="targetObjectAttrScrollList"), dcc=lambda *args: self.append_output_item()) pm.button("loadTargetBtn", label=u"Load Object", c=lambda *args: self.load_controller( widget="targetObjectField", extra_widget="targetObjectAttrScrollList")) pm.setParent("..")
def gui(): dir_name = os.path.dirname(__file__) file_path = os.path.join(dir_name, 'Startup', 'grade.path') f = open(file_path, 'r') pickle_data = pickle.load(f) f.close() win = 'quiz_grading' if pm.window(win, exists=True): pm.deleteUI(win) if pm.windowPref(win, exists=True): pm.windowPref(win, remove=True) global scroll_field, scroll_list, path_field, open_check_box my_win = pm.window(win, title='Quiz Grading', toolbox=True, width=600, height=400) god_layout = pm.columnLayout() pm.text(label='') path_field = pm.textFieldButtonGrp(label='Ouput Path', buttonCommand=pm.Callback(get_path), buttonLabel='<<<', text=pickle_data, columnWidth3=[100, 400, 100]) main_layout = pm.rowColumnLayout(numberOfColumns=2, columnWidth=([1, 200], [2, 400])) pm.columnLayout() pm.text(label='Quizzes') scroll_list = pm.textScrollList(width=200, height=400, selectCommand=pm.Callback(read_quiz)) pm.setParent(main_layout) pm.columnLayout() pm.text(label='Result') scroll_field = pm.scrollField(wordWrap=True, height=400, width=400) pm.setParent(god_layout) pm.rowColumnLayout(numberOfColumns=2, columnWidth=([1, 200], [2, 400])) open_check_box = pm.checkBox(label='Open File When Done', value=1) pm.button(label='Ouput To Text File', command=pm.Callback(ouput_to_text), height=35) list_quizzes() my_win.show()
def create(self): self.mainLayout = pm.columnLayout(adjustableColumn=True) self.infoLayout = pm.columnLayout(adjustableColumn=True) pm.setParent(self.mainLayout) self.layout = pm.columnLayout(adjustableColumn=True) pm.setParent(self.layout) # the total Grades Section self.total = sal.Total_Grades02() self.total.create() pm.button(label = 'Output Grade and Comment', command = pm.Callback(self.check)) pm.setParent(self.layout) grading = pm.frameLayout( label= 'Grading', cll = True, cl = True , borderStyle = 'etchedIn', w = 480) # grading for lighting self.lighting = sal.Grading_Section(name = 'Lighting', fileName = r"%s/Comments/proj02_lighting.txt" % (self.path), field = self.total.queryLight(), toUpdate = self.total) self.lighting.create() pm.setParent(grading) # grading for Composition/Focal Lenght self.compFocal = sal.Grading_Section02(name = 'Comp/Focal Length', fileName = r"%s/Comments/proj02_compFocal.txt" % (self.path), field = self.total.queryComp(), toUpdate = self.total) self.compFocal.create() pm.setParent(grading) # grading for antialiasing self.antiAliasing = sal.Grading_Section02(name = 'Antialias/Noise Qual', fileName = r"%s/Comments/proj02_antiAliasing.txt" % (self.path), field = self.total.queryAnti(), toUpdate = self.total) self.antiAliasing.create() pm.setParent(grading) # grading for Professionalism self.pro = sal.Grading_Prof02(name = 'Professionalism', fileName = r"%s/Comments/proj02_prof.txt" % (self.path), field = self.total.queryPro(), fileStart = r"%s/Startup/proj02_start.db" % (self.path), toUpdate = self.total, infoParent= self.infoLayout) self.pro.create() # the Images info section # *takes the professionalism section as an arguement pm.setParent(self.infoLayout) self.info = sal.Images02(self.pro, image = r"%s/Reference_Images/proj02_ref.tga" % (self.path)) return self.layout
def build_mimic_ui(): """ Builds main mimic UI and defines relationships between UI buttons/features and back-end functions :return: """ mimic_win = create_mimic_window('mimic_win') # Create Main UI column pm.columnLayout(width=244, adj=True) # Add UI Header Image. robotImage = pm.image(image='mimic_logo.png', width=244, height=60) mimic_tab_layout = create_mimic_tabs() animate_tab_layout = build_animate_tab(mimic_tab_layout) program_tab_layout = build_program_tab(mimic_tab_layout) setup_tab_layout = build_setup_tab(mimic_tab_layout) external_tab_layout = build_external_tab(mimic_tab_layout) prefs_tab_layout = build_prefs_tab(mimic_win) tabs = [(animate_tab_layout, "Animate"), (program_tab_layout, "Program"), (setup_tab_layout, "Setup"), (external_tab_layout, "External"), (prefs_tab_layout, "Prefs")] assign_tabs(tabs, mimic_tab_layout) # Create output column outputColumn = pm.columnLayout('outputColumn', width=7, adj=True) outputForm = pm.formLayout() outputScrollField = pm.scrollField('programOutputScrollField', width=3, height=610) pm.formLayout(outputForm, edit=True, attachForm=[(outputScrollField, "top", 3), (outputScrollField, "bottom", 3), (outputScrollField, "left", 3), (outputScrollField, "right", 3)]) pm.setParent(mimic_win) pm.columnLayout('outputBarColumn', width=7) pm.separator(height=1, style='none') bullets = '\n'.join([unichr(0x2022) for _ in range(3)]) pm.text(bullets, align='left', annotation='Drag edge to view Output Window!') # Launch UI window pm.window('mimic_win', height=560, width=245, edit=True) mimic_win.show()
def create_window(): windowName = "BakeBase" if pymel.window(windowName, exists=True): print 'Check' pymel.deleteUI(windowName) window = pymel.window(windowName, t=windowName, widthHeight=(400, 50)) pymel.columnLayout(adjustableColumn=True) pymel.text('Select NEW shape, OLD shape, Target(s)') pymel.button(label='Bake Delta', command='run()') pymel.showWindow(window)
def __init__(self): with pdil.ui.singleWindow('BoneGroups'): columnLayout() self.lister = textScrollList(dcc=Callback(self.select), sc=Callback(self.setName)) groupNames = set() for card in find.blueprintCards(): boneGroups = card.rigData.get('boneGroups', {}) groupNames.update(boneGroups.keys()) self.lister.append(sorted(groupNames)) button(l='Add To group', c=Callback(self.addToGroup)) self.name = textField()
def SJ_MultiTexwdUI(): if pm.window('multitex',ex=True): pm.deleteUI('multitex',wnd=True) pm.window('multitex',t='MultiTexToolV1.1') ''' 1.1更新说明增加对udim贴图的支持 ''' pm.columnLayout(adj=True) pm.text(l='',fn='fixedWidthFont',h=30,annotation="") pm.text(l='贴图路径数量',fn='fixedWidthFont',h=30,annotation="") pm.textField('multinum',tx="",h=30,ann="输入文件夹路径",w=50) pm.button(l='生成多贴图链接',c=multinode,h=50,ann = "选择需要生产多贴图链接的file节点,输入贴图路径的数量,点击确定生成") pm.button(l='链接节点关联',c=chconnect,h=50,ann="先选择主体choice节点,再选择被关联节点") pm.button(l='创建区分显示颜色节点',c=displaychoice,h=50,ann="选择主体choice节点的材质节点") pm.showWindow()
def __init__(self): global offsetCurveOptions with pdil.ui.singleWindow(self.id): with columnLayout(): self.mode = radioButtonGrp( nrb=3, la3=['Playback Range', 'User Defined', 'All'], on1=Callback(self.setPlaybackMode), on2=Callback(self.setUserMode), on3=Callback(self.setAllMode), ) with rowColumnLayout(nc=2) as self.range: self.start = intField() self.end = intField() with rowColumnLayout(nc=2): #checkBox(l='Autokey', en=False) button(label='Apply', c=Callback(self.apply)) if offsetCurveOptions.uiMode == 1: self.setPlaybackMode() elif offsetCurveOptions.uiMode == 2: self.setUserMode() elif offsetCurveOptions.uiMode == 3: self.setAllMode()
def gui(): # Creating a window. win = pm.window(w=150, h=100) main = pm.columnLayout() # Here a three examples of interface components # EVERY interface element is named. Just like geometry in Maya. # You are given access to this name when a object is created in Maya. # 1) Maya names the textFieldButtonGrp. # User chooses not to catch the name of the interface comp. pm.textFieldButtonGrp(label='Separator Attribute', buttonLabel='Apply', buttonCommand=work) # 2) User desides to catch the name of the textFieldButtonGrp. # But it is local scope. Only visible inside of this function. float_text = pm.textFieldButtonGrp(label='Float Attribute', buttonLabel='Apply', buttonCommand=work) # 3) User catches interface name and makes it global to the script. global int_text int_text = pm.textFieldButtonGrp(label='Integer Attribute', buttonLabel='Apply', buttonCommand=work) # Showing a window win.show()
def ui(): global __blenTxt if pm.window('blendShapeCtrlerUI', q=True, exists=True): pm.deleteUI('blendShapeCtrlerUI') with pm.window('blendShapeCtrlerUI'): with pm.columnLayout(adj=True): pm.button(l='Slider', c=pm.Callback(slider)) pm.button(l='Both Side Slider', c=pm.Callback(bothShide)) pm.button(l='Square Slider', c=pm.Callback(square)) pm.button(l='Square(small) Slider', c=pm.Callback(square_small)) with pm.rowLayout(nc=3): pm.button(l='Sym Translate', c=pm.Callback(rigSymTranslate)) pm.separator(h=16, style='in') with pm.rowLayout(nc=3): pm.button(l='SetBlendShapeNode', w=100, c=pm.Callback(setBlendShapeNode)) __blenTxt = pm.text(l='') with pm.rowLayout(nc=3): pm.button(l='Connect Blen', w=100, c=pm.Callback(connectBlen)) pm.button(l='DisConnect Blen', w=100, c=pm.Callback(disconnectBlen)) pm.separator(h=16, style='in') with pm.rowLayout(nc=3): pm.button(l='Regist Ctrl', w=80, c=pm.Callback(registBlenCtrl)) pm.button(l='Reset All', w=80, c=pm.Callback(resetBlenCtrl)) pm.button(l='Reset Selected', w=80, c=pm.Callback(resetCtrl)) pm.separator(h=8, style='in') with pm.rowLayout(nc=3): pm.button(l='Pose To Shelf', w=100, c=pm.Callback(poseToShelf))
def gui(): win = 'rigid_body_win' if pm.window(win, exists= True): pm.deleteUI(win) if pm.windowPref(win, exists= True): pm.windowPref(win, remove= True) global obj_scroll_list, name_field, tab_layout my_win = pm.window(win, title= 'BAKE', toolbox= True, width= 300) tab_layout = pm.tabLayout() ui_creator = pm.columnLayout(adjustableColumn= False) name_field = pm.textFieldGrp(label = 'System Name', text= 'Name', columnWidth2= [145, 150]) obj_scroll_list = pm.textScrollList(width= 300, height= 200, allowMultiSelection= True) pm.rowColumnLayout(nc=3, columnWidth= ([1,100], [2,100], [1,100])) pm.button(label= 'Load', command= pm.Callback(load_objects), width= 100) pm.button(label= '+', command= pm.Callback(add_objects), width= 100) pm.button(label= '-', command= pm.Callback(remove_objects), width= 100) pm.setParent('..') pm.button(label= 'Create Baking System', height= 50, width= 300, command= pm.Callback(create_baking_system)) pm.tabLayout( tab_layout, edit=True, tabLabel=((ui_creator, 'Setup'))) my_win.show()
def window(self): self.win = 'progresswin' self.num = (len(self.folls) / 100) if (pm.window(self.win, ex=True)): pm.deleteUI(self.win) if (pm.windowPref(self.win, ex=True)): pm.windowPref(self.win, remove=True) progressWin = pm.window(self.win, title='', sizeable=False, width=300, backgroundColor=[.5, .5, .5]) pm.columnLayout(adjustableColumn=True) self.bar = pm.progressBar(minValue=0, maxValue=100, width=300, step=1) progressWin.show()
def createModuleInstallButton(self, module): mod = __import__("Blueprint." + module, {}, {}, [module]) reload(mod) title = mod.TITLE description = mod.DESCRIPTION icon = mod.ICON buttonSize = 64 pm.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, buttonSize)]) #Create UI #distinguish between buttons with partial functions self.UIElements["module_button_" + module] = pm.symbolButton( width=buttonSize, height=buttonSize, image=icon, command=partial(self.installModule, module)) textColumn = pm.columnLayout(columnAlign="center") pm.text(align="left", width=self.windowWidth - 30, label=title) pm.scrollField(text=description, editable=False, width=self.windowWidth - 30, height=50, wordWrap=True) pm.setParent(self.UIElements["moduleList_row"])
def _build_ui_prefs_frame(parent_layout): pm.frameLayout(label="UI", collapsable=True) ui_prefs_column = pm.columnLayout(adj=True, columnAttach=('both', 5)) pm.separator(height=2, style='none') # Shader range row layout pm.rowLayout(numberOfColumns=3, adjustableColumn=2, columnAttach=(1, 'left', 0), columnWidth=[(1, 113), (2, 50), (3, 50)], height=20) pm.text(label='Shader range:') # Axis limit shader range float field pm.floatField("f_shaderRange", min=0, pre=0, value=20, changeCommand=mimic_utils.set_shader_range) # Set axis limit shader range button pm.button(label=' Set ', width=50, height=20, command=mimic_utils.set_shader_range) pm.setParent(ui_prefs_column) pm.separator(height=8, style='none') pm.setParent(parent_layout)
def _build_proc_options_tab(parent_layout): # Create column Layout for General settings proc_options_tab_layout = pm.columnLayout('procOptions', adj=True, width=100) pm.separator(height=3, style='none') # Name this tab? May not be necessary pm.separator(height=3, style='none') pm.text('User options:', align='left') pm.separator(height=3, style='none') # Get the options selected_options = postproc_options.DEFAULT_USER_OPTIONS supported_options = postproc_options.get_processor_supported_options() # Create the options dictionary and build the output options_dict = postproc_options.create_options_dict( selected_options, supported_options) # Construct the output columns postproc_options.build_options_columns('procOptions', options_dict, proc_options_tab_layout) pm.setParent(parent_layout) return proc_options_tab_layout
def build_setup_tab(parent_layout): # Create setup tab Layout setup_tab_layout = pm.columnLayout(adj=True, height=525, width=200) # Create Form Layout with embeded Tab Layout setup_tabs_form = pm.formLayout() setup_tabs_layout = pm.tabLayout('setup_tabs_layout', height=100, borderStyle='none') pm.formLayout(setup_tabs_form, edit=True, attachForm=[(setup_tabs_layout, "top", 0), (setup_tabs_layout, "bottom", 0), (setup_tabs_layout, "left", 0), (setup_tabs_layout, "right", 0)]) general_setup_tab_layout = _build_general_setup_tab(setup_tabs_layout) external_axes_tab_layout = _build_external_axes_tab(setup_tabs_layout) io_tab_layout = _build_io_tab(setup_tabs_layout) # comms_tab_layout = _build_comms_tab(setup_tabs_layout) tabs = [ [general_setup_tab_layout, 'General'], [external_axes_tab_layout, 'External Axes'], [io_tab_layout, 'IOs'], # [comms_tab_layout, 'Comms'] ] assign_tabs(tabs, setup_tabs_layout) pm.setParent(parent_layout) return setup_tab_layout
def _build_add_io_frame(parent_layout): pm.frameLayout('add_io_frame', label="Add IO", collapsable=True) add_io_col = pm.columnLayout(adj=True, columnAttach=('both', 5)) pm.separator(height=5, style='none') pm.rowLayout(numberOfColumns=2, adjustableColumn=2, columnAlign=[(1, 'left'), (2, 'left')], columnAttach=[(1, 'both', -1), (2, 'both', 0), (3, 'both', 0)]) pm.text(label='IO Name: ') pm.textField('t_ioNameText', placeholderText='ioName', font=FONT) pm.setParent('..') pm.separator(height=3, style='none') pm.rowLayout(numberOfColumns=2, adjustableColumn=2, columnAlign=[(1, 'left'), (2, 'left')], columnAttach=[(1, 'both', -1), (2, 'both', 0), (3, 'both', 0)]) pm.text(label='Postproc ID: ') pm.textField('t_ioPostprocIDText', placeholderText='postprocID', font=FONT) pm.setParent('..') pm.separator(height=3, style='none') pm.optionMenu('ioNumberMenu', label='IO Number:', height=18) io_number_list = [i + 1 for i in range(12)] for io_number in io_number_list: pm.menuItem(label=io_number) pm.separator(height=3, style='none') pm.optionMenu('ioTypeMenu', label='IO Type: ', height=18) io_type = ['digital', 'analog'] for attr in io_type: pm.menuItem(label=attr) pm.separator(height=3, style='none') pm.rowLayout(numberOfColumns=1) pm.checkBox('cb_ignoreIO', label="Ignore in prostprocessor", value=0) pm.setParent('..') pm.separator(height=4, style='none') pm.setParent(add_io_col) pm.button('b_add_io', label='Add IO', height=25, backgroundColor=[.361, .361, .361], command=mimic_io.add_io) pm.separator(height=5, style='none') pm.setParent(parent_layout)
def __init__(self, target=None): self.obj = None self.win = window() with columnLayout(): button(l='Tear Off', c=lambda *args: self.tearOff()) text(l='Orient') self.orient = textScrollList() text(l='Point') self.point = textScrollList() text(l='Parent') self.parent = textScrollList() showWindow() self.orient.selectCommand( lambda *args: select(self.orient.getSelectItem())) self.point.selectCommand( lambda *args: select(self.point.getSelectItem())) self.parent.selectCommand( lambda *args: select(self.parent.getSelectItem())) if target: self.viewObj(target) else: self.update() scriptJob(e=('SelectionChanged', core.alt.Callback(self.update)), p=self.win)
def _build_add_robot_frame(parent_layout): # Create frame layout with one column add_robot_frame = pm.frameLayout(label="Add Robot", collapsable=True) add_robot_col = pm.columnLayout(adj=True, columnAttach=('both', 5)) pm.separator(height=5, style='none') # Create list of robots pm.rowLayout(numberOfColumns=2, adjustableColumn=1, columnAttach=(1, 'left', 3), columnWidth=[(1, 158), (2, 45)], height=20) pm.optionMenu('robotImportList') rigs = general_utils.get_rigs_dict() rig_names = general_utils.get_rigs_names(rigs) for rig_name in rig_names: pm.menuItem(label=rig_name) pm.button(label=' Add ', command=add_robot, width=45, height=20, annotation='Imports selected robot into the scene') pm.setParent(add_robot_frame) pm.separator(style='none') pm.setParent(parent_layout)
def __init__(self): self.main = columnLayout() # Can't use `with since parent is QT` with rowColumnLayout(nc=2): self.targets = textScrollList(nr=20, sc=Callback(self.targetSelected)) with frameLayout(l='Multi Weights') as self.multiUI: pass with rowColumnLayout(nc=2): button(l=' ^ ', c=Callback(self.moveUp)) button(l=' v ', c=Callback(self.moveDown)) self.name = textFieldButtonGrp(l='Custom Name', bl='Update Existing') button(l='Add', c=Callback(self.addSpace, space.Mode.ROTATE_TRANSLATE)) button(l='Add (Trans Only)', c=Callback(self.addSpace, space.Mode.TRANSLATE)) button(l='Add ( No Rot )', c=Callback(self.addSpace, "#NOROT")) button(l='Add (No Trans)', c=Callback(self.addSpace, space.ROTATE)) button(l='Split Targets (pos then rot)', c=Callback(self.addSpace, space.Mode.ALT_ROTATE)) button(l='Multi/Vert targets', c=Callback(self.addMultiSpace)) button(l='Multi Orient', c=Callback(self.addMultiOrientSpace)) text(l='') button(l='Add Parent', c=Callback(self.addSpace, '#PARENT')) button(l='Add World', c=Callback(self.addSpace, '#WORLD')) button(l='Add True World', c=Callback(self.addSpace, '#TRUEWORLD')) #button( l='Add External World (For attachments)', c=Callback(self.addSpace, '#EXTERNALWORLD') ) button(l='Add User Driven', c=Callback(self.addSpace, '#USER')) button(l='Remove', c=Callback(self.remove)) self.update() scriptJob(e=('SelectionChanged', Callback(self.update)), p=self.main)
def buildUI(self): pm.setUITemplate("attributeEditorTemplate", pushTemplate=True) self.passesParent = pm.setParent(query=True) frameLayout = None with pm.frameLayout(label="Passes", collapsable=False, parent=self.parent) as frameLayout: with pm.columnLayout(adj=True): with pm.rowLayout(adj=True, nc=2, cw=((1, 200), (2, 200)), h=350): with pm.frameLayout(label="Existing Passes", collapsable=False, h=350): self.availableAOVsListUI = pm.textScrollList( doubleClickCommand=self.AOVdoubleClicked) pm.textScrollList(self.availableAOVsListUI, edit=True, append=self.getAOVs()) with pm.frameLayout(label="Active Passes", collapsable=False, h=350): self.activeAOVsListUI = pm.textScrollList( selectCommand=self.exsistingAOVclicked, doubleClickCommand=self.exsistingAOVdoubleClicked) self.updateExistingAOVList() pm.setUITemplate("attributeEditorTemplate", popTemplate=True) pm.scriptJob(event=("NameChanged", self.nameChangedCallback), parent=frameLayout)
def display(self, title=None, data=None, *args): '''Display the data ina window ''' win = '%s_Win' % title if pm.window(win, exists=1): pm.deleteUI(win, window=1) print 'Title: ', title print 'data: ', data pm.window(win, rtf=1, title=title) pm.columnLayout(adj=1) for line in data: pm.text(str(line), al='left') pm.showWindow(win)
def __init__(self): self.asset_name = "" self.save_path = "" clear_window('incremental_save') self.win = pm.window("incremental_save", title="Initial Save", sizeable=False) self.layout = pm.columnLayout('mainColumn', parent=self.win, adjustableColumn=True) pm.separator(h=5, style='none') pm.rowLayout('row1', numberOfColumns=3, columnAttach=[(1, "left", 5), (2, "both", 5), (3, "both", 5)]) pm.text("Filepath:") assets_path = '//medusa/cyberwitch/assets' pm.textField("FilePathTF", width=300, text=assets_path) pm.button(label="Browse", width=50, command=self.find_save_path) pm.setParent('mainColumn') pm.separator(h=5, style='none') pm.rowLayout('row2', numberOfColumns=3, columnAttach=[(1, "both", 5), (2, "both", 5), (3, "both", 5)]) pm.text(label='Asset name:') self.asset_name = pm.textField(width=100) pm.button(label="Save", width=100, command=self.save_file) pm.setParent('mainColumn') pm.showWindow()
def build(self, light_obj, parent): """ Generates the frameLayout element, along with its children. Returns the element as a pymel object. """ self.element = pm.frameLayout( l=self.name, fn='smallBoldLabelFont', mh=5, bv=True, ebg=True, cll=True, cl=True, parent=parent ) col = pm.columnLayout() # light color selector slider = pm.colorSliderGrp( label='Light Color', rgb=light_obj.color.get(), cw=[self.labelWidth,(2,75),(3,0)], p=col ) pm.colorSliderGrp ( slider, edit=True, cc=lambda *args: light_obj.color.set(pm.colorSliderGrp(slider, q=True, rgbValue=True)) ) # intensity intensity = pm.floatFieldGrp( value=(light_obj.intensity.get(),0,0,0), label='Intensity', cw=[self.labelWidth,(2,75)], nf=1, p=col ) #self.element.redistribute() return self.element
def RigFinalCheck_UI(): rfchWin = 'RIG_FINAL_CHECK_TOOL' rfchTitle = 'Rigging Final Check Tool' if pm.window(rfchWin, ex=1): pm.deleteUI(rfchWin, wnd=1) pm.window(rfchWin, t=rfchTitle, te=1, tlb=1) column1 = pm.columnLayout(rs=10, cal='left') pm.separator() row1 = pm.rowLayout(nc=3, cw3=(40, 160, 40), adj=2, cal=(1, 'right'), cat=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)]) pm.separator(st='none') pm.text(l=u'필요 없는 노드 체크 후 지우기', fn='boldLabelFont') pm.separator(st='none') pm.setParent(column1) pm.separator() pm.intFieldGrp('gids_Ifg', nf=1, l=u'Group ID : ', v1=0) pm.intFieldGrp('gps_Ifg', nf=1, l=u'Group Parts : ', v1=0) pm.intFieldGrp('mti_Ifg', nf=1, l=u'Material Info : ', v1=0) pm.intFieldGrp('aov_Ifg', nf=1, l=u'AOV : ', v1=0) pm.intFieldGrp('ukn_Ifg', nf=1, l=u'Unknown Node : ', v1=0) pm.intFieldGrp('bdt_Ifg', nf=1, l=u'Blind Data : ', v1=0) pm.intFieldGrp('pbd_Ifg', nf=1, l=u'Poly Blind Data : ', v1=0) pm.intFieldGrp('tk_Ifg', nf=1, l=u'Tweak : ', v1=0) pm.intFieldGrp('dag_Ifg', nf=1, l=u'Bind Pose : ', v1=0) pm.separator() row7 = pm.rowLayout(nc=2, cat=[(1, 'left', 20), (2, 'left', 15)]) pm.button(l=u'Check', w=90, c=PrintNodeLen) pm.button(l=u'Delete', w=90, c=DeleteNodes) pm.window(rfchWin, e=1, wh=[240, 400], s=0) pm.showWindow(rfchWin)
def options_box_setup(self): self.optvars.add('zSplitBlendShapesBlendDistance', 'float', 2) self.optvars.add('zSplitBlendShapesPlane', 'int', 2) self.optvars.add('zSplitBlendShapesPlaneOrigin', 'float', 0) self.optvars.add('zSplitBlendShapesNamingPattern', 'string', '<name>_<L|R>') parent = pm.columnLayout(adjustableColumn=1) pm.optionMenuGrp('sbsList', label='Blend shape:', cc=self.fill_blend_target) self.fill_blend_shapes('sbsList|OptionMenu', False) pm.optionMenuGrp('sbsLeftOutput', label='Left output:') self.fill_blend_shapes('sbsLeftOutput|OptionMenu', True) pm.optionMenuGrp('sbsRightOutput', label='Right output:') self.fill_blend_shapes('sbsRightOutput|OptionMenu', True) # If something is selected, try to find a blend shape to select by default. selection = pm.ls(sl=True) if selection: history = pm.listHistory(selection) blend_shapes = pm.ls(history, type='blendShape') if blend_shapes: default_blend_shape = blend_shapes[0] self.select_blend_shape(default_blend_shape) pm.optionMenuGrp('sbsTargetList', label='Blend target:') self.fill_blend_target() pm.floatSliderGrp('sbsBlendDistance', label='Blend distance', field=True, min=0, max=10, fieldMinValue=0, fieldMaxValue=1000) pm.radioButtonGrp('sbsPlane', label='Plane:', numberOfRadioButtons=3, labelArray3=('XY', 'YZ', 'XZ')) pm.floatSliderGrp('sbsPlaneOrigin', label='Plane origin', v=0, min=0, max=1000) pm.textFieldGrp('sbsNamingPattern', label='Naming pattern')