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(): file_path = os.path.dirname(__file__) basename = os.path.basename(file_path) file_name = '%s.questions' % (basename) #print file_name, basename, file_path questions_file = os.path.join(file_path, file_name) #print questions_file f = open(questions_file, 'r') info = pickle.load(f) f.close() win = 'quiz_win' if pm.window(win, exists= True): pm.deleteUI(win) if pm.windowPref(win, exists= True): pm.windowPref(win, remove= True) global quiz my_win = pm.window(win, title= basename, toolbox= True, width= 400, height= 600) pm.scrollLayout() quiz = Quiz(info) pm.button(label= 'Done', height= 35, command= pm.Callback(check)) my_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 gui(): file_path = os.path.dirname(__file__) basename = os.path.basename(file_path) file_name = '%s.questions' % (basename) #print file_name, basename, file_path questions_file = os.path.join(file_path, file_name) #print questions_file f = open(questions_file, 'r') info = pickle.load(f) f.close() win = 'quiz_win' if pm.window(win, exists=True): pm.deleteUI(win) if pm.windowPref(win, exists=True): pm.windowPref(win, remove=True) global quiz my_win = pm.window(win, title=basename, toolbox=True, width=400, height=600) pm.scrollLayout() quiz = Quiz(info) pm.button(label='Done', height=35, command=pm.Callback(check)) my_win.show()
def __init__(self, title, widthHeight, tabs_names, frameLayoutPerTab, collapseStyle=0, descr=''): ### SETTING UP COLOR SCHEME ### colorScheme = col.ColorSwatches([col.ColorSwatch(47,52,64), col.ColorSwatch(63,86,102), col.ColorSwatch(234,96,69), col.ColorSwatch(245,229,192), col.ColorSwatch(248,202,77)]) colorScheme.insertBetweens(3) self.col_fls=colorScheme.getColorList() self.close_red_cl=[0.5,0.2,0.2] self.title_blue_cl=[.1,.15,.2] self.go_green_cl=[.1,.4,.2] ### SETTING UP COLOR SCHEME ### 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 vars self.window = pm.window(title, wh=(widthHeight[0], widthHeight[1]), title=title) self.title=title self.wh = widthHeight self.tabs_names = tabs_names self.fl_perTab = frameLayoutPerTab self.collapseStyle=collapseStyle self.descr=descr #Defaults self.frameLayouts={} self.close_btn='' self.tabLayout='' self.docker=None self._createLayout() self.window.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): """A GUI Class Args: args (None): Just in case... """ self.name='aw_assimilator' self.width=200 self.height=120 self.title_blue_cl=[.1,.15,.2] self.close_red_cl=[0.5,0.2,0.2] self.go_green_cl=[.1,.4,.2] if pm.window(self.name, q=True, exists=True): pm.deleteUI(self.name) if pm.windowPref(self.name, ex=True): pm.windowPref(self.name, r=True) self.win = pm.window(self.name,widthHeight=(self.width, self.height),title=self.name) # Window creation self.column_layout = pm.columnLayout(w=self.width) # Text Spacers! pm.text(l="\nSelect Source then Targets\n", fn='boldLabelFont', al='center', w=self.width, bgc=self.title_blue_cl) pm.text(l="", al='center') pm.text(l="Ready?", al='center', w=self.width) pm.text(l="", al='center', w=self.width) # Make a button and assign a command to it self.flow_layout=pm.flowLayout(w=self.width) pm.button('assimilateBtn',command=lambda *args: self.aw_assimilator(),label="Yes!", p=self.flow_layout, w=self.width/2, bgc=self.go_green_cl) pm.button('assimilateKillBtn',command=lambda *args: pm.deleteUI(self.name),label="Cancel", p=self.flow_layout, w=self.width/2-3, bgc=self.close_red_cl) self.win.show()
def build(): if pm.window('RemapWin', q = 1, ex = 1): pm.deleteUI('RemapWin') if pm.windowPref('RemapWin', q=1, ex = 1): pm.windowPref('RemapWin', r = True) with pm.window('RemapWin', title = 'RemapWin', wh = (150, 50), s = 0) as win: with pm.columnLayout(rs = 2, adj = 1): pm.button(l = u'创建色阶节点', c = run) pm.button(l = u'删除节点', c = deleteNodes)
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 gui(): ''' # gui for the script ''' 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 ParaUI(self): # setting basic UI height and width winWidth = 500 winHeight = 100 # checking for duplicate windows windowID = 'ParaScale' if pm.window(windowID, exists=True): pm.deleteUI(windowID) # re-adjusting UI if UI is not correct try: if pm.windowPref(windowID, q=True, height=True) != winHeight or pm.windowPref( windowID, q=True, width=True) != winWidth: pm.windowPref(windowID, remove=True) except: pass pm.window(windowID, title=u'Parallel scale | Ver 2018 / 06 / 22', widthHeight=(winWidth, winHeight)) masterFrame = pm.frameLayout(label=u'PARALLEL Scaling', labelIndent=5, marginHeight=5, nch=5) row1 = pm.rowLayout('row1', nc=5, width=600, parent=masterFrame) pm.text(label=u'キャラ名:', width=80, align='right') self.charalist = pm.optionMenu('listofchara', parent=row1) for i in self.nameList: pm.menuItem(label=i, parent=self.charalist) pm.text('', width=10, parent=row1) pm.button(label=u'スケール', parent=row1, command=self.scaleChara) pm.showWindow()
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 UI_exporter(self, *mayaFalse): #setting basic UI height and width winWidth = 500 winHeight = 300 # checking for duplicate windows windowID = 'AdvSkeExporter' if pm.window(windowID, exists=True): pm.deleteUI(windowID) #re-adjusting UI if UI is not correct if pm.windowPref('AdvSkeExporter', q=True, height = True) != winHeight or pm.windowPref('AdvSkeExporter', q=True, width = True) != winWidth: pm.windowPref('AdvSkeExporter', remove=True) # creating window pm.window(windowID, title=u'Prism Exporter | Ver 2018 / 06 / 06', widthHeight=(winWidth, winHeight)) rigExportFrame = pm.frameLayout(u'出力', width=500, nch = 10, labelIndent = 20) nameFormLayout = pm.formLayout('nameForm', parent = rigExportFrame, nch = 30, width = 500, height = 500, numberOfDivisions = 100) self.exportPathText = pm.text(label = u'出力先:' , parent = nameFormLayout, align = 'right', width = 50) self.exportPathField = pm.textField('exportPath', placeholderText = u'export path', width = 370) dirButton = pm.button(label='', width=20, height=20, command= self.dirChange) pm.formLayout(nameFormLayout, edit=True, attachForm = [(self.exportPathText, 'top', 40.5), (self.exportPathText, 'left', 40),#all text have an offset of 3 from top (self.exportPathField, 'top', 37.5), (self.exportPathField, 'left', 100), (dirButton, 'top', 37.5), (dirButton, 'left', 475)]) self.fbxNameText = pm.text(label = u'ファイル名:', parent = nameFormLayout, align = 'right', width = 50) self.fbxNameField = pm.textField('fbxName', placeholderText = u'file name', width = 370) pm.formLayout(nameFormLayout, edit=True, attachForm = [(self.fbxNameText, 'top', 68), (self.fbxNameText, 'left', 40), (self.fbxNameField, 'top', 65), (self.fbxNameField, 'left', 100)]) self.exportOptionGrp = pm.radioButtonGrp('expRadioGrp', numberOfRadioButtons = 2, parent = nameFormLayout, label1 = u'リグ', label2 = u'モーション', width = 300, label = u'出力設定:', columnAlign = [1, 'right'], columnWidth = [(1, 90), (2, 100), (3, 100)], columnAttach = [(2, 'left', 15)]) pm.formLayout(nameFormLayout, edit=True, attachForm = [(self.exportOptionGrp, 'top', 100), (self.exportOptionGrp, 'left', 0)]) self.expButton = pm.button(label = u'出力', parent = nameFormLayout, command = self.exportButton, width = 250) pm.formLayout(nameFormLayout, edit=True, attachForm=[(self.expButton, 'top', 200), (self.expButton, 'left', 100)]) self.projectList() self.projListUI = pm.optionMenu(numberOfItems = len(self.prj_data), changeCommand = self.projectChange) for i in self.prj_data: pm.menuItem(i.split()[0], label = i.split()[0], parent = self.projListUI, annotation = i.split()[1].replace('\\', '/')) #pm.optionMenu(self.projListUI, edit = True, visibleChangeCommand = partial(self.projectChange, i.split()[1])) prjText = pm.text(label = u'案件:', align = 'right', parent = nameFormLayout, width = 50) pm.formLayout(nameFormLayout, edit=True, attachForm=[(self.projListUI, 'top', 10), (self.projListUI, 'left', 99), (prjText, 'top', 13), (prjText, 'left', 40)]) pm.showWindow()
def reset_floating_window(): '''reset floating window position''' window_list = pm.lsUI(windows=True) for window in window_list: if window != "MayaWindow" and window != "scriptEditorPanel1Window": pm.deleteUI(window) pm.windowPref(window, remove=True) print window, " reset"
def build(): if pm.window("RemapWin", q=1, ex=1): pm.deleteUI("RemapWin") if pm.windowPref("RemapWin", q=1, ex=1): pm.windowPref("RemapWin", r=True) with pm.window("RemapWin", title="RemapWin", wh=(150, 50), s=0) as win: with pm.columnLayout(rs=2, adj=1): pm.button(l=u"创建色阶节点", c=run) pm.button(l=u"删除节点", c=deleteNodes)
def createWindow(): """ try to get data from shotgun project fields need to get context's project context's shotgun instance """ app = self.parent project = app.context.project sg = app.context.tank.shotgun # set filters and search fields for entity type "Project" filters=[["id", "is", project['id']],] fields=["sg_width", "sg_height"] result=sg.find_one("Project", filters, fields) # with result, set parameters accordingly or use default otherwise if result: videoWidth = result.get("sg_width", DEFAULT_WIDTH) videoHeight = result.get("sg_height", DEFAULT_HEIGHT) # Find first camera matching pattern and set as active camera # if not use default current active camera camera_name_pattern = app.get_setting( "camera_name_pattern", "persp" ) cameraList = [c.name() for c in pm.ls(type="camera", r=True) if re.search( camera_name_pattern, c.name() )] if not "cam" in MODEL_EDITOR_PARAMS.keys() and cameraList: MODEL_EDITOR_PARAMS["cam"] = cameraList[0] # Give Viewport 2.0 renderer only for Maya 2015++ # mayaVersionString = cmds.about(version=True) # mayaVersion = int(mayaVersionString[:4]) if len(mayaVersionString) >= 4 else 0 # if mayaVersion >= 2015: # params[ "rendererName" ] = "vp2Renderer" # Create window if pm.windowPref( PLAYBLAST_WINDOW, exists=True ): pm.windowPref( PLAYBLAST_WINDOW, remove=True ) window = pm.window( PLAYBLAST_WINDOW, titleBar=True, iconify=True, leftEdge = 100, topEdge = 100, width = videoWidth, height = videoHeight, sizeable = False) # Create editor area layout = pm.formLayout() editor = pm.modelEditor( **MODEL_EDITOR_PARAMS ) pm.setFocus( editor ) pm.formLayout( layout, edit=True, attachForm = ( ( editor, "left", 0 ), ( editor, "top", 0 ), ( editor, "right", 0 ), ( editor, "bottom", 0 ) ) ) # Show window pm.setFocus( editor ) pm.showWindow( window ) pm.refresh() try: yield True except: traceback.print_exc() finally: pm.deleteUI(window)
def gui(path): win = 'salwindow' if(pm.window(win, ex = True)): pm.deleteUI(win) if(pm.windowPref(win, ex = True)): pm.windowPref(win, remove = True) myWin = pm.window(win, title='SAL_Grading' , sizeable = True, mnb = True, width = 490, height = 800, backgroundColor= [.68,.68,.68], toolbox= 0) main = pm.scrollLayout(width = 490) tabs = pm.tabLayout(innerMarginWidth=5, innerMarginHeight=5, width = 490) pm.setParent(tabs) first = pm.columnLayout(adjustableColumn = True, width = 490) proj01 = sal.Project01(path).create() pm.setParent(tabs) second = pm.columnLayout(adjustableColumn = True, width = 490) proj02 = sal.Project02(path).create() pm.setParent(tabs) third = pm.columnLayout(adjustableColumn = True, width = 490) proj03 = sal.Project03(path).create() pm.setParent(tabs) fourth = pm.columnLayout(adjustableColumn = True, width = 490) proj04 = sal.Project04(path).create() pm.setParent(tabs) fith = pm.columnLayout(adjustableColumn = True, width = 490) proj05 = sal.Project05(path).create() pm.setParent(tabs) sixth = pm.columnLayout(adjustableColumn = True, width = 490) proj06 = sal.Project06(path).create() pm.setParent(tabs) seventh = pm.columnLayout(adjustableColumn = True, width = 490) proj07 = sal.Project07(path).create() pm.setParent(tabs) final = pm.columnLayout(adjustableColumn = True, width = 490) final_proj = sal.Final_Project(path).create() # ------------------------------------------ pm.tabLayout( tabs, edit=True, tabLabel=((first, 'Proj01'), (second, 'Proj02'), (third, 'Proj03 '), (fourth, 'Proj04'), (fith, 'Proj05'), (sixth, 'Proj06'), (seventh, 'Proj07'), (final, ' Final ')) ) myWin.show()
def gui(): if pm.window(winName, q=True, exists=True): pm.deleteUI(winName) if pm.windowPref(winName, q=True, exists=True): pm.windowPref(winName, r=True) win_w = 170 win_h = 200 btn_w = win_w / 2 btn_h = win_h / 5 win = pm.window(winName, w=win_w, h=win_h + btn_h, nde=True, tlb=True, s=False, mnb=True, mxb=True, ds=True) mainLayout = pm.rowColumnLayout(nc=1) pm.text( label= 'This tool renames and\norients the joints for\nthe respective anatomy\npart, just select and\n press the proper button' ) btnLayout = pm.rowColumnLayout(nc=2, cw=[[1, btn_w], [2, btn_w]]) armBtn = WindowButton(btn_w, btn_h, 'Arm Bone\nSetup', '.arm_setup()', black) legBtn = WindowButton(btn_w, btn_h, 'Leg Bone\nSetup', '.leg_setup()', black) handBtn = WindowButton(btn_w, btn_h, 'Hand Bone\nSetup', '.hand_setup()', black) thumbBtn = WindowButton(btn_w, btn_h, 'Thumb Bone\nSetup', '.thumb_setup()', black) index_fingerBtn = WindowButton(btn_w, btn_h, 'Index Finger\nBone Setup', '.index_finger_setup()', black) middle_fingerBtn = WindowButton(btn_w, btn_h, 'Middle Finger\nBone Setup', '.middle_finger_setup()', black) ring_fingerBtn = WindowButton(btn_w, btn_h, 'Ring Finger\nBone Setup', '.ring_finger_setup()', black) pinky_fingerBtn = WindowButton(btn_w, btn_h, 'Pinky Finger\nBone Setup', '.pinky_finger_setup()', black) clavicleBtn = WindowButton(btn_w, btn_h, 'Clavicle\nBone Setup', '.clavicle_setup()', black) hipsBtn = WindowButton(btn_w, btn_h, 'Hips Bone\nSetup', '.hip_setup()', black) spineBtn = WindowButton(btn_w, btn_h, 'Spine Bone\nSetup', '.spine_setup()', black) neckBtn = WindowButton(btn_w, btn_h, 'Neck Bone\nSetup', '.neck_setup()', black) headBtn = WindowButton(btn_w, btn_h, 'Head Bone\nSetup', '.head_setup()', black) mirror_jointsBtn = WindowButton(btn_w, btn_h, 'Mirror Selected\nBones', '.mirror_joints()', black) win.show()
def show(self): if pm.window(self.windowName, q=True, exists=True): pm.deleteUI(self.windowName) pm.windowPref(self.windowName, remove=True) pm.window(self.windowName, s=True, w=300, h=100, rtf=False) self.buildUI() pm.showWindow()
def window_creation(): window_name='MyRiggingTool v. 1.1' if pm.window(window_name, exists = True): pm.deleteUI(window_name, window = True) if pm.windowPref(window_name, ex=True): pm.windowPref(window_name, r=True) window_obj = pm.window(window_name, menuBar = True) gui_creation() window_obj.show()
def __init__(self): self.title = "Ribbon_Builder" # Creation check if pm.windowPref(self.title, q=True, ex=True): pm.windowPref(self.title, remove=True) if pm.window(self.title, q=True, ex=True): pm.deleteUI(self.title, window=True) self.build()
def __init__(self): title="michaelTools" if(pm.windowPref(title, q=True, ex=True)): pm.windowPref(title, remove=True) if(pm.window(title, q=True, ex=True)): pm.deleteUI(title) # Michael's Tools UI self.win = pm.window(title, title="Michael's Tools") self.winlayout = pm.columnLayout() self.tabs = pm.tabLayout(innerMarginWidth=5, innerMarginHeight=5) # CTRL Tools TAB self.ctrlTools_layout = pm.columnLayout(parent = self.tabs) # grouping Functions frame and contents self.grpFrame = pm.frameLayout( parent = self.ctrlTools_layout, w =244, label='Grouping Functions', borderStyle='out', cll = True, cl = True ) self.grplayout = pm.rowColumnLayout(parent = self.grpFrame, numberOfColumns = 2, columnWidth = [(1, 120), (2, 120)] ) self.offSetGRP_Btn = pm.button(parent=self.grplayout,w = 100, h = 24, label="Add Offset Group", command = offSetGRP.add_offset_grps ) self.sdkGRP_Btn = pm.button(parent=self.grplayout,w = 100, h = 24, label="Add SDK Group", command = sdkGRP.add_SDK_grps ) self.conGRP_Btn = pm.button(parent=self.grplayout,w = 100, h = 24, label="Add Control Group", command = conGRP.add_con_grps ) self.underLoc_Btn = pm.button(parent=self.grplayout,w = 100, h = 24, label="Under Locator", command = unLoc.under_locator ) # color overrides frame and contents self.colorFrame = pm.frameLayout( parent = self.ctrlTools_layout, w =244, label='Color Overrides', borderStyle='out', cll = True, cl = True ) self.colorlayout = pm.columnLayout( parent = self.colorFrame, columnWidth = 120 ) self.colorSlider = pm.colorIndexSliderGrp( parent = self.colorlayout,cw3 = [40, 60, 130], label='Color ', min=1, max=32, value=0 ) self.changeColor_Btn = pm.button(parent=self.colorlayout,w = 240, h = 24, label="Override Color", command = self.exe_sliderColor ) self.orRGBText = pm.text( parent=self.colorlayout, w = 240, label='Or Use', align='center' ) self.changeColor_Btn = pm.button(parent=self.colorlayout,w = 240, h = 24, label="RGB Color Picker", command = rgbColor.rgbColorOverride ) # Shape Functions Frame and Contents self.shapeFrame = pm.frameLayout( parent = self.ctrlTools_layout, w =244, label='Shape Functions', borderStyle='out', cll = True, cl = True ) self.shapelayout = pm.columnLayout(parent = self.shapeFrame, columnWidth = 240 ) self.parentShape_Btn = pm.button(parent=self.shapelayout,w = 240, h = 24, label="Parent Shapes To Last", command = prntShps.parentShapes ) ctrlTools_gradParent=self.ctrlTools_layout ctrlTools_gradParent.getNumberOfChildren() color_range = ColorRange([0.0, 0.4, 0.4]) for ctrlTools_grad, color in zip(ctrlTools_gradParent.children(), color_range.get_range(len(ctrlTools_gradParent.children())) ): print ctrlTools_grad, color ctrlTools_grad.setBackgroundColor(color) # TRANSFORM TOOLS TAB self.transformTools_layout = pm.columnLayout(parent = self.tabs) self.newPivBtn = pm.button(parent = self.transformTools_layout, w = 244, h = 24, label="Match All Piviots To Last Selected", command = newPivot.set_newPivot ) self.newPosBtn = pm.button(parent = self.transformTools_layout, w = 244, h = 24, label="Match All Positions To Last Selected", command = newPosition.set_newPosition ) # Edit Tab Layout labels pm.tabLayout( self.tabs, edit=True, tabLabel=((self.ctrlTools_layout, 'Control Tools'), (self.transformTools_layout, 'Transform Tools')) ) # Window Functions self.closeToolBtn = pm.button(parent = self.winlayout,w = 251, h = 24, label="Close Tool", command = self.closeWin) self.delete = [] self.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 destroy_window(self): """If the PLAYBLAST_WINDOW exists, destroy it (window and its prefs). """ try: pm.deleteUI(PLAYBLAST_WINDOW) m = '>> Found and deleted existing window > {}'.format() self.logger.info(m) except Exception: pass if pm.windowPref(PLAYBLAST_WINDOW, exists=True): pm.windowPref(PLAYBLAST_WINDOW, remove=True)
def gui(): if(pm.window(win, ex = True)): pm.deleteUI(win) if(pm.windowPref(win, ex = True)): pm.windowPref(win, remove = True) myWin = pm.window(win, title='Testing' , sizeable = True, mnb = True, width = 480, height = 900, backgroundColor = [.5, .5, .5]) pm.scrollLayout() main01 = pm.columnLayout( adjustableColumn=True ) main02 = pm.columnLayout( adjustableColumn=True ) pm.setParent(main02) # file info section pm.frameLayout(label = 'File Info', cll = True, cl = False, borderStyle = 'etchedIn', w = 480) global fileInfo fileInfo = sal.Images() pm.setParent(main02) # grade total section infoFrame = pm.frameLayout( label = 'Grades Total', cll = True, cl = True , borderStyle = 'etchedIn', w = 480 ) infoLayout = pm.formLayout() # isntancing the total grade section global totalGrades totalGrades = sal.UpperSection() totalGrades.create() pm.setParent(infoFrame) pm.button( label = 'Output Grade and Comment' , command = checkWeighting) pm.setParent(main02) pm.frameLayout( label = 'Grade', cll = True, cl = True , borderStyle = 'etchedIn', w = 480 ) mainLayout = pm.formLayout() # grading / commenting section # first intance of Section for antiAliasing / Noise Quality global antiAlising, compFocalLenght, prof antiAlising = sal.Section( name = 'Anitalias/Noise Qual', layout = mainLayout , updateCommand = totalGrades, fileRead = "/Users/Fearman/Library/Preferences/Autodesk/maya/2011-x64/scripts/proj01_antiAlisaing.txt",updateField= totalGrades.queryAnti()) section01 = antiAlising.create() # second intance of Section for Composition / Focal Lenght compFocalLenght = sal.Section( name = 'Comp/Focal Length', layout = mainLayout , updateCommand = totalGrades, fileRead = "/Users/Fearman/Library/Preferences/Autodesk/maya/2011-x64/scripts/proj01_compFocal.txt", updateField = totalGrades.queryComp(), control=section01) section02 = compFocalLenght.create() # first intance of Section for proffesionalism prof = sal.Section( name = 'Professionalism', layout = mainLayout , updateCommand = totalGrades, fileRead = "/Users/Fearman/Library/Preferences/Autodesk/maya/2011-x64/scripts/proj01_prof.txt", updateField = totalGrades.queryPro(), control=section02) section03 = prof.create() myWin.show()
def scriptUI(): windowID = 'WeapCon' if pm.window(windowID, exists=True): pm.deleteUI(windowID) pm.windowPref('WeapCon', remove=True) #creating window pm.window(windowID, title=u'SER 武器コンストレイン | 2018/02/28', widthHeight=(600, 100)) #buttons for first row constrFrame = pm.frameLayout(annotation='annotation test', label=u'武器コンストレイン', labelIndent=5, width=590, marginHeight=5) pm.rowLayout('row1', nc=5, width=400) conSetup = pm.button( 'constraintSetup', label=u'コンストレイン インストール', width=300, height=30, backgroundColor=(0.6, 0.6, 0.6), parent='row1', command='SERTools_001.constraintSwitch.createConstr()') bake = pm.button('motionBake', label=u'ベーク', width=300, height=30, backgroundColor=(0.6, 0.6, 0.6), parent='row1', command='SERTools_001.constraintSwitch.bakeLoc()') ''' #buttons for 2nd row pm.rowLayout( 'row2', nc = 2, parent = 'columnLayout01' ) bodySliderGrp = pm.intSliderGrp(field = True, label = u'全身ポーズ', minValue = 0, maxValue = upperLimit - 1, value = 0, adj = 3, columnWidth3 = [100,50,200], width = 525, dragCommand = setPose) pm.rowLayout( 'row3', nc = 2, parent = 'columnLayout01', width = 590, height = 50) pm.columnLayout( 'col_1', width = 100, parent = 'row3')#spacer pm.columnLayout( 'col_2', width = 390, parent = 'row3') resetButton = pm.button( 'resetButton', label = u'T ポーズに', width = 390, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'col_2', command = resetChar ) pm.rowLayout( 'row4', nc = 2, parent = 'columnLayout01', width = 590, height = 50) pm.columnLayout( 'col_3', width = 100, parent = 'row4')#spacer pm.columnLayout( 'col_4', width = 390, parent = 'row4') resetButton_ctrlRig = pm.button( 'ctrlRigReset', label = u'Control Rig T pose', width = 390, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'col_4', command = resetCharTPose ) ''' pm.showWindow() pm.window(windowID, edit=True, widthHeight=(600, 100))
def SERTools_Window(): #checking for duplicate windows windowID = 'localGlobalWindow' if pm.window(windowID, exists = True): pm.deleteUI(windowID) pm.windowPref( 'localGlobalWindow', remove=True ) #creating window pm.window(windowID, title = 'SER Tools 1.0 | 2018/05/017 | DEVELOPMENT VERSION', widthHeight = (460,200)) col = pm.columnLayout( 'columnLayout01', width = 400) commonToolsFrame = pm.frameLayout(label = u'共通ツールス', labelIndent = 5, marginHeight = 5, parent = col, nch = 5) pm.rowLayout( 'row1', nc = 5, width = 450) #buttons for first row pm.button( 'SER export', label = u'SER 出力 Test', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row1', command = 'export = SERTools_001_Test.Exporter_001Test.main()') pm.button( 'SER manager', label = u'SER シーン管理', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row1', command = 'sceneBrowser = SERTools_001_Test.PrismSceneManager_001a.PrismToolsMainWindow().uiWindow()') #buttons for 2nd row modelFrame = pm.frameLayout(label = u'モデルツールス', labelIndent = 5, width = 450, marginHeight = 5, parent = col) pm.rowLayout( 'row2', nc = 5, width = 450) pm.button( 'SER pose', label = u'SER ポーズテスト', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row2', command = 'poseTest = SERTools_001_Test.AnimPose_001_test.poseTest()') animFrame = pm.frameLayout(label = u'モーションツールス', labelIndent = 5, width = 450, marginHeight = 5, parent = col) pm.rowLayout( 'row3', nc = 5, width = 450) pm.button( 'SER whipmake', label = u'SER 鞭リッグ作る', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row3', command = 'whip = SERTools_001_Test.whipMake_001.whipMake()') pm.button( 'SER fingerMirror_r', label = u'SER 指 右→左', width = 75, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row3', command = FingerCopyPasta.rightFingerToLeft) pm.button( 'SER fingerMirror_l', label = u'SER 指 左→右', width = 75, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row3', command = FingerCopyPasta.leftFingerToRight) pm.button( 'SER ishiiCheck', label = u'SER 石井チェック', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row3', command = 'constr = SERTools_001_Test.ishiiCheck.ishiiCheckFunc()') pm.rowLayout( 'row4', nc = 5, width = 450, parent = animFrame) pm.button( 'SER WeaponRig', label = u'SER 武器リグ', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row4', command = Weapon_Rig.rigUI) #pm.button( 'Wrist gbl to loc', label = 'Remove: Left hand Global controller', width = 200, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'wristTranslateControllers', command = 'ChewTools.GlobalLocalSwitch2.L_global_to_local()') ''' pm.rowLayout('L_Hand_to_Weapon_Row', nc = 2, parent = 'columnLayout01' ) pm.button( 'L_Hand_to_Weapon_Row', label = '左手を武器にbindする', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'L_Hand_to_Weapon_Row', command = 'ChewTools.LeftHand_to_Weapon.Weapon_Bind()') pm.rowLayout( 'separator', nc = 2, parent = 'columnLayout01' ) pm.separator(height = 10, style = 'in') #buttons for 3rd row, Mocap Transfer pm.rowLayout( 'mocapTransfer1', nc = 4, parent = 'columnLayout01' ) pm.button( 'bone_import', label = 'Bone Import', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer1', command = 'ChewTools.importBones()' ) pm.button( 'bocap_import', label = 'Mocap Import', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer1', command = 'ChewTools.importMocap()' ) #buttons for 4th row, Mocap Transfer pm.rowLayout( 'mocapTransfer2', nc = 4, parent = 'columnLayout01' ) pm.button( 'Mocap Zero ', label = 'Zero out Mocap', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer2', command = 'ChewTools.mocapZeroOut()' ) pm.button( 'mocap Transfer', label = 'Mocap Copy', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer2', command = 'ChewTools.mocapButton()' ) ''' pm.showWindow() pm.window(windowID, edit = True, widthHeight = (455,200))
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 uiWindow(self): # checking for duplicate windows windowID = 'PrismRigger' if pm.window(windowID, exists=True): pm.deleteUI(windowID) pm.windowPref(windowID, remove=True) # creating window pm.window(windowID, title=u'Prism リガー', widthHeight=(600, 800)) # menu bar menuBar = pm.menuBarLayout() helpMenu = pm.menu(label=u'Help') manualMenu = pm.menuItem(label=u'仕様書', parent=helpMenu, subMenu=True)#help
def rigMakeUI(): windowID = 'rigUI' if pm.window(windowID, exists=True): pm.deleteUI(windowID) pm.windowPref('WeapCon', remove=True) #creating window pm.window(windowID, title='SER Rig | 2018/03/01', widthHeight=(600, 100)) #buttons for first row rigFrame = pm.frameLayout(label=u'リグツール', labelIndent=5, width=590, marginHeight=5) pm.rowLayout('row1', nc=5, width=400) conSetup = pm.button('controllerSetup', label=u'リグを作る', width=300, height=30, backgroundColor=(0.6, 0.6, 0.6), parent='row1', command='createContr()') constrainSetup = pm.button('constraintSetup', label=u'2', width=300, height=30, backgroundColor=(0.6, 0.6, 0.6), parent='row1', command='reverseConstraint()') ''' #buttons for 2nd row pm.rowLayout( 'row2', nc = 2, parent = 'columnLayout01' ) bodySliderGrp = pm.intSliderGrp(field = True, label = u'全身ポーズ', minValue = 0, maxValue = upperLimit - 1, value = 0, adj = 3, columnWidth3 = [100,50,200], width = 525, dragCommand = setPose) pm.rowLayout( 'row3', nc = 2, parent = 'columnLayout01', width = 590, height = 50) pm.columnLayout( 'col_1', width = 100, parent = 'row3')#spacer pm.columnLayout( 'col_2', width = 390, parent = 'row3') resetButton = pm.button( 'resetButton', label = u'T ポーズに', width = 390, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'col_2', command = resetChar ) pm.rowLayout( 'row4', nc = 2, parent = 'columnLayout01', width = 590, height = 50) pm.columnLayout( 'col_3', width = 100, parent = 'row4')#spacer pm.columnLayout( 'col_4', width = 390, parent = 'row4') resetButton_ctrlRig = pm.button( 'ctrlRigReset', label = u'Control Rig T pose', width = 390, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'col_4', command = resetCharTPose ) ''' pm.showWindow() pm.window(windowID, edit=True, widthHeight=(600, 100))
def __init__(self): # create a window with a text prompt and a checkbox title = 'extrude rig options' if pm.window(title, q=True, ex=True): pm.deleteUI(title) if pm.windowPref(title, q=True, ex=True): pm.windowPref(title, r=True) self.window = pm.window(title, rtf = True) self.cl = pm.columnLayout(adj = True) self.btn_chkbox = pm.button(l = "Print checkbox", c=self.query) self.chkbox_ds = pm.checkBox(l = 'Double Sided?') self.window.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 __init__(self): title="flexi_plane" if(pm.windowPref(title, q=True, ex=True)): pm.windowPref(title, remove=True) if(pm.window(title, q=True, ex=True)): pm.deleteUI(title) # flexi plane UI self.win = pm.window(title, title="flexi plane") self.layout = pm.rowColumnLayout() self.flexiPlaneNumSlider = pm.intSliderGrp(enable=True, field=True, label='number of joints', minValue=3, maxValue=100, fieldMinValue=3, fieldMaxValue=100, value=5,) self.flexiPlaneNameField = pm.textFieldGrp(parent=self.layout,enable=True, label='Name Flexi Plane Module', placeholderText="name your flexi plane", editable=True, tcc=self.flexiPlaneNameField_change) self.goBtn = pm.button(parent=self.layout, enable=False,w = 100, h = 24, label="GO!", command=self.execute) self.noBtn = pm.button(parent=self.layout, enable=False,w = 100, h = 24, label="NO DONT DO IT!", command=self.close) self.format_string = "{PREFIX}_{INDEX}_{SUFFIX}" self.delete = [] self.win.show()
def gui(): win = 'quiz_maker' 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 my_win = pm.window(win, title= 'Quiz Maker', toolbox= True, width= 550, height= 400) dir_path = os.path.dirname(__file__) file_path = os.path.join(dir_path, 'questions.txt') main_layout = pm.columnLayout() maker = Quiz_Maker(file_path) my_win.show()
def init(self): #Initializing Variables self.localProject = os.environ[ 'MAYA_PROJECT' ] self.localUser=os.environ[ 'USER' ] self.path = (localProject + "/export/GEO") self.title='aw_msvExp' self.wh = [352,542] # Make me a button! if pm.window(self.title, query=True, exists=True): pm.deleteUI(self.title) if pm.windowPref(self.title, query=True, exists=True): pm.windowPref(self.title, remove=True) # Window creation self.window = pm.window(self.title,widthHeight=self.wh,title=self.title) self.majorLayout = pm.gridLayout('aw_expLayout',numberOfColumns=1,cellWidthHeight=(self.wh[0], (self.wh[1]/18))) pm.text(bgc=(.3, .35, .4),ebg=1,al="center",fn="boldLabelFont",l=" Obj Exporter") #menu for export type pm.optionMenu('exportType',label=" FileType") pm.menuItem(label="FBX") pm.menuItem(label="OBJ") pm.menuItem(label="PROXY") #menu for model type pm.optionMenu('modelType',changeCommand=lambda *args: mel.aw_addRemCombName(),label=" ModelType") pm.menuItem(label="Combined") pm.menuItem(label="Separate") #EXPORTER pm.textField('combName',tx="Object Export Name") pm.text(al="left",l="Set directory for objects to be outputted") pm.textField('pathName',tx=path_here) pm.button('fileBrowse2',command=lambda *args: mel.fileBrowser(pathname),label="Browse") pm.button('msvExp',bgc=(0.1, .7, .145),command=lambda *args: mel.objExp(),label="Export") pm.text(l="") #IMPORTER pm.text(bgc=(.3, .3, .4),ebg=1,al="center",fn="boldLabelFont",l=" Obj importer") pm.text(al="left",l="Set directory for objects to be inputted") pm.textField('pathImpName',tx=path_here) pm.button('fileBrowse1',command=lambda *args: mel.fileBrowser(pathimpname),label="Browse") pm.button('msvList',command=lambda *args: mel.fileList(),label="List OBJ Files") pm.text(al="left",l="Type wildcard here or leave blank for all objs in the folder") pm.textField('wildName') pm.button('msvImp',bgc=(0.1, .7, .145),command=lambda *args: mel.objImp(),label="Import") pm.button('msvKillBtn',command=lambda *args: deleteUI('aw_msvExp'),label="Close Window") self.window.show()
def main_GUI(docked=False): global windowWidth, windowHeight, isDocked, windowName, dockedWindow, marginWidth isDocked = docked windowWidth = 390 marginWidth = windowWidth-12 windowHeight = 700 windowLabel = 'HP3D | Simple Lights GUI' windowName = 'hp3dSimpleLightsWin' # Colors global primary_componentColor, secondary_componentColor, windowColor, disabled_componentColor, frameColor primary_componentColor = [.261, .380, .393] secondary_componentColor = [.175, .198, .200] windowColor = [.300, .305, .305] disabled_componentColor = [.322, .384, .388] frameColor = [primary_componentColor[0]/1.5, primary_componentColor[1]/1.5, primary_componentColor[2]/1.5] if pm.window(windowName, q=True, ex=True): pm.deleteUI(windowName) if pm.windowPref(windowName, q=True, ex=True): pm.windowPref(windowName, r=True) if pm.dockControl(windowName, q=True, ex=True): pm.deleteUI(windowName) global window_obj window_obj = pm.window(windowName, title=windowLabel, w=windowWidth, h=windowHeight, mnb=False, mxb=False, bgc=windowColor) pm.scrollLayout(w=windowWidth+40,) pm.columnLayout() pm.rowColumnLayout(nr=2, rh=[1, 7]) pm.text(l='') # GUI SPACER pm.rowColumnLayout(nc=3, cw=[[1, 7], [3, 7]]) pm.text(l='') # GUI SPACER all_sections() pm.text(l='') # GUI SPACER if docked == False: window_obj.show() elif docked == True: allowedAreas = ['right', 'left'] dockedWindow = pm.dockControl(windowName, l=windowLabel, a='right', con=window_obj, aa=allowedAreas, visible=True)
def UI_exporter(self): #setting basic UI height and width winWidth = 500 winHeight = 300 # checking for duplicate windows windowID = 'AdvSkeExporter' if pm.window(windowID, exists=True): pm.deleteUI(windowID) #re-adjusting UI if UI is not correct if pm.windowPref('AdvSkeExporter', q=True, height = True) != winHeight or pm.windowPref('AdvSkeExporter', q=True, width = True) != winWidth: pm.windowPref('AdvSkeExporter', remove=True) # creating window pm.window(windowID, title=u'Prism Exporter | Ver 2018 / 06 / 06', widthHeight=(winWidth, winHeight)) rigExportFrame = pm.frameLayout(u'出力', width=500, nch = 10, labelIndent = 20) nameFormLayout = pm.formLayout('nameForm', parent = rigExportFrame, nch = 30, width = 500, height = 500, numberOfDivisions = 100) self.exportPathText = pm.text(label = u'出力先:' , parent = nameFormLayout, align = 'right', width = 50) self.exportPathField = pm.textField('exportPath', placeholderText = u'export path', width = 300) pm.formLayout(nameFormLayout, edit=True, attachForm = [(self.exportPathText, 'top', 25.5), (self.exportPathText, 'left', 40),#all text have an offset of 3 from top (self.exportPathField, 'top', 22.5), (self.exportPathField, 'left', 100)]) self.fbxNameText = pm.text(label = u'ファイル名:', parent = nameFormLayout, align = 'right', width = 50) self.fbxNameField = pm.textField('fbxName', placeholderText = u'file name', width = 300) pm.formLayout(nameFormLayout, edit=True, attachForm = [(self.fbxNameText, 'top', 53), (self.fbxNameText, 'left', 40), (self.fbxNameField, 'top', 50), (self.fbxNameField, 'left', 100)]) self.exportOptionGrp = pm.radioButtonGrp('expRadioGrp', numberOfRadioButtons = 2, parent = nameFormLayout, label1 = u'リグ', label2 = u'モーション', width = 300, label = u'出力設定:', columnAlign = [1, 'right'], columnWidth = [(1, 90), (2, 100), (3, 100)], columnAttach = [(2, 'left', 15)]) pm.formLayout(nameFormLayout, edit=True, attachForm = [(self.exportOptionGrp, 'top', 80), (self.exportOptionGrp, 'left', 0)]) self.expButton = pm.button(label = u'出力', parent = nameFormLayout, command = self.exportButton, width = 250) pm.formLayout(nameFormLayout, edit=True, attachForm=[(self.expButton, 'top', 200), (self.expButton, 'left', 100)]) pm.showWindow()
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 __init__(self): win = 'portal_pose_library_warning' if pm.window(win, exists= True): pm.deleteUI(win) if pm.windowPref(win, exists= True): pm.windowPref(win, remove= True) self.window = pm.window(win, title= 'Warning', width= 400, height= 300, sizeable= False) pm.columnLayout(adjustableColumn= True) pm.text(label= 'ERROR', bgc= [1, 0, 0], align= 'center', height= 25) pm.text(label = 'ALREADY A RANDOM QUESTION', align= 'center') pm.text(label = '') pm.button(label= 'CLOSE', command= pm.Callback(self.close)) self.window.show()
def __init__(self): title="Make Halo" if(pm.windowPref(title, q=True, ex=True)): pm.windowPref(title, remove=True) if(pm.window(title, q=True, ex=True)): pm.deleteUI(title) #splineIK UI self.win = pm.window(title, title=title) self.layout = pm.rowColumnLayout() self.names = {'Halo Curve':None, 'Halo Parent':None, 'Control':None} for name in self.names: self.names[name] = pm.textFieldButtonGrp(cw= ((1, 76), (2, 176)), label= name, placeholderText= 'Enter New Name Here or >>>> ', buttonLabel= 'load selected', buttonCommand= pm.Callback( self.nameField_load, name)) self.goBtn = pm.button(parent=self.layout, enable=True,w = 40, h = 20, label="Build", command=self.execute) self.noBtn = pm.button(parent=self.layout, enable=True,w = 40, h = 20, label="NO DONT DO IT!", command=self.close) self.delete = [] self.win.show()
def __init__(self): win = 'portal_pose_library_warning' if pm.window(win, exists=True): pm.deleteUI(win) if pm.windowPref(win, exists=True): pm.windowPref(win, remove=True) self.window = pm.window(win, title='Warning', width=400, height=300, sizeable=False) pm.columnLayout(adjustableColumn=True) pm.text(label='ERROR', bgc=[1, 0, 0], align='center', height=25) pm.text(label='ALREADY A RANDOM QUESTION', align='center') pm.text(label='') pm.button(label='CLOSE', command=pm.Callback(self.close)) self.window.show()
def custom(self): self.customWin = 'customWindow' if (pm.window(self.customWin, ex=True)): pm.deleteUI(self.customWin) if (pm.windowPref(self.customWin, ex=True)): pm.windowPref(self.customWin, remove = True) myWin = pm.window(self.customWin, title = 'CUSTOM', width = 200, height = 150) pm.columnLayout(adjustableColumn=True) pm.text(l='Enter label') self.customLabel = pm.textField(editable = True) pm.text(l='Enter custom comment') self.customComment = pm.scrollField(width = 200, height= 150) self.customFeedback = pm.text(label = '') pm.rowColumnLayout(nc = 2) # nc = number of rows pm.button(label='create', command=pm.Callback(self.addCustom)) pm.button(label='add' , command=pm.Callback(self.saveComment)) myWin.show()
def build(self): #check for pre-existing window if pm.window(self.winName, ex=True): pm.deleteUI(self.winName, wnd=True) if not pm.windowPref(self.winName, ex=True): pm.windowPref(self.winName, tlc=(200, 200)) pm.windowPref(self.winName, e=True, w=280, h=100) with pm.window(self.winName, rtf=1, mb=1, tlb=True, t='Resetter %s' % __version__) as self.win: imenu = pm.menu(l='Info') pm.setParent(imenu, m=True) pm.menuItem(l='List Objects with Defaults', c=pm.Callback(listObjectsWithDefaults)) pm.menuItem(l='Select Objects with Defaults', c=pm.Callback(selectObjectsWithDefaults)) pm.menuItem(l='List Defaults', c=pm.Callback(listDefaults)) with pm.formLayout(nd=100) as form: with pm.frameLayout(l='Set/Remove Defaults', bs='out', mw=2, mh=2, cll=True, cl=True) as setFrame: with pm.columnLayout(rs=2, adj=True): pm.button(l='Set Defaults', c=pm.Callback(setDefaults), bgc=self.colSet, ann='Set defaults on the selected objects using all keyable attributes') pm.button(l='Set Defaults Include Non-Keyable', c=pm.Callback(setDefaultsNonkeyable), bgc=self.colSet, ann='Set defaults on the selected objects using keyable and non-keyable attributes in the channel box') pm.button(l='Set Defaults with CB Selection', c=pm.Callback(setDefaultsCBSelection), bgc=self.colSet, ann='Set defaults on the selected objects using the selected channel box attributes') pm.button(l='Remove Defaults', c=pm.Callback(removeDefaults), bgc=self.colRemove, ann='Remove all defaults from the selected objects') pm.button(l='Remove from All Objects', c=pm.Callback(removeAllDefaults), bgc=self.colRemove, ann='Remove defaults from all objects in the scene') with pm.frameLayout(l='Reset', bs='out', mw=2, mh=2) as resetFrame: with pm.formLayout(nd=100) as resetForm: b6 = pm.button(l='Smart', c=pm.Callback(resetSmart), bgc=self.colReset, ann='Reset the selected objects. Uses transform standards if no defaults are defined for translate, rotate, and scale') b7 = pm.button(l='Default', c=pm.Callback(reset), bgc=self.colReset, ann='Reset the selected objects using only stored defaults, if any') b8 = pm.button(l='Transform', c=pm.Callback(resetTransform), bgc=self.colReset, ann='Reset the selected objects using only transform standards for translate, rotate, scale (eg. 0, 0, 1)') b9 = pm.button(l='All', c=pm.Callback(resetAll), bgc=self.colReset2, ann='Reset all objects in the scene with defaults') pm.formLayout(resetForm, e=True, ap=[(b6, 'left', 0, 0), (b6, 'right', 2, 25), (b7, 'left', 2, 25), (b7, 'right', 2, 50), (b8, 'left', 2, 50), (b8, 'right', 2, 75), (b9, 'left', 2, 75), (b9, 'right', 2, 100), ]) mw = 4 pm.formLayout(form, e=True, af=[(setFrame, 'left', mw), (setFrame, 'right', mw), (resetFrame, 'left', mw), (resetFrame, 'right', mw)], ac=[(resetFrame, 'top', 2, setFrame)], )
def UI(self): ui_development = True # Clean up old windows which share the name if pm.window(self.win_name, exists=True): pm.deleteUI(self.win_name) # Clean up existing window preferences try: if pm.windowPref(self.win_name, query=True, exists=True) and ui_development: pm.windowPref(self.win_name, remove=True) except RuntimeError: pass # Declare the GUI window which we want to work with self.toolbox_ui = pm.window( self.win_name, title='Toolbox UI', widthHeight=[200,440] ) with pm.verticalLayout() as base: with pm.verticalLayout() as self.header: pm.text('Source Path', font='boldLabelFont') pm.separator(height=1) with pm.verticalLayout(): with pm.horizontalLayout() as path: self.ui_path = pm.textField(placeholderText = self.toolbox_path) pm.button(label='Browse', command= self.ui_set_path) pm.button(label='Reload Toolbox', command= self.ui_reload_tools) pm.separator() with pm.verticalLayout() as tool_header: pm.text('Tools List', font='boldLabelFont') pm.separator() with pm.columnLayout(adjustableColumn=True) as self.ui_toolbox_layout: # Placeholder for adding new tools. pass # Fix spacing of layout elements base.redistribute(.01,.01,.15,.01,.01) tool_header.redistribute(.01,.01) # Last lines of code self.toolbox_ui.show() self.ui_reload_tools()
def __init__(self, *args): """A GUI Class Args: self (str): We all know what self does. Kwargs: args (None): Just in case... """ self.w = 300 self.bw = self.w/6 self.h = 350 self.name = 'aw_transformer' self.project_path = ENVPATHS.PROJECT self.user = ENVPATHS.USER self.scene_name = mel.eval('file -q -sn -shn') if (pm.windowPref(self.name, query=True, exists=True)): pm.windowPref(self.name, remove=True) if (pm.window(self.name, query=True, exists=True)): pm.deleteUI(self.name)
def gui(): win = 'quiz_maker' 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 my_win = pm.window(win, title='Quiz Maker', toolbox=True, width=550, height=400) dir_path = os.path.dirname(__file__) file_path = os.path.join(dir_path, 'questions.txt') main_layout = pm.columnLayout() maker = Quiz_Maker(file_path) my_win.show()
def applyMetrics(self, m=None): """Set window size and position by editing the window prefs""" if m is None: m = self.metrics if not pm.windowPref(self.winName, ex=True): pm.windowPref(self.winName, tlc=DEFAULT_TLC, w=DEFAULT_SIZE[0], h=DEFAULT_SIZE[1]) if m.has_key('w') and m['w'] is not None: pm.windowPref(self.winName, e=True, w=m['w']) if self._win is not None: self._win.setWidth(m['w']) if m.has_key('h') and m['h'] is not None: pm.windowPref(self.winName, e=True, h=m['h']) if self._win is not None: self._win.setHeight(m['h']) if m.has_key('tlc') and m['tlc'] is not None: pm.windowPref(self.winName, e=True, tlc=m['tlc'])
def moriToolUI(mayaFalse = False): windowID = 'moritool'#checking if window already exists if pm.window(windowID, exists = True): pm.deleteUI(windowID) pm.windowPref( 'moritool', remove=True ) pm.window(windowID, title = u'Prism 森ツール') moriToolLayout = pm.columnLayout( 'moriToolLayout', width = 400) vertexFrame = pm.frameLayout(label = u'頂点関連', labelIndent = 5, marginHeight = 5, parent = moriToolLayout, nch = 5) vertexRow = pm.rowLayout( 'vertexRow', nc = 5, width = 600) pm.button( 'vertexJump', label = u'頂点移動', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = vertexRow, command = weaponGlobal) pm.button( 'vertexAverage', label = u'頂点中間', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = vertexRow, command = migi) normalFrame = pm.frameLayout(label = u'法線関連', labelIndent = 5, marginHeight = 5, parent = moriToolLayout, nch = 5) normalRow = pm.rowLayout( 'normalRow', nc = 5, width = 600) pm.button( 'normalCopy', label = u'法線コピー', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = normalRow, command = hidari) pm.button( 'normalAverage', label = u'法線平均', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = normalRow, command = hidari) pm.showWindow() pm.window(windowID, edit = True, widthHeight = (500,250))
def create_ramp(self): my_ramp = pm.shadingNode('ramp', asTexture= True) self.customWin = 'customramps' if (pm.window(self.customWin, exists=True)): pm.deleteUI(self.customWin) if (pm.windowPref(self.customWin, exists=True)): pm.windowPref(self.customWin, remove = True) myWin = pm.window(self.customWin, title = 'CUSTOM RAMPS', width = 200, height = 150, backgroundColor=[.5,.5,.5]) pm.columnLayout(adjustableColumn=True) colors = pm.attrColorSliderGrp(columnWidth4= [100, 75, 175, 50]) my_port = pm.rampColorPort(node= my_ramp, sc= colors) self.ramp_field = pm.textFieldButtonGrp(label= 'ramp name', buttonLabel= 'rename', buttonCommand= pm.Callback(self.rename, my_ramp), columnWidth3= [150,100,150]) myWin.show()
def gui(): ''' # gui for the script ''' win = 'shader_grading' if (pm.window(win, ex=True)): pm.deleteUI(win) if (pm.windowPref(win, ex=True)): pm.windowPref(win, remove=True) my_win = pm.window(win, title='shader_grading', width=550, height=250) main = pm.columnLayout() tab_layout = pm.tabLayout() sorter = pm.columnLayout() grader = Shader_sorter() pm.setParent(tab_layout) assigner_layout = pm.columnLayout() assigner = Shader_assign() pm.setParent(sorter) pm.tabLayout(tab_layout, edit=True, tabLabel=((sorter, 'Grade'), (assigner_layout, 'Assign'))) pm.text(label='Objects With Default Lambert', align='center', height=50, backgroundColor=[1, 0, 0], width=550) pm.scrollLayout(width=560, height=300) lambert_objs = Lambert_objects_checker() my_win.show()
def UI(self): # Clean up old windows which share the name if pm.window(self.win_name, exists=True): pm.deleteUI(self.win_name) # Clean up existing window preferences try: if pm.windowPref(self.win_name, query=True, exists=True) and self.window_development: pm.windowPref(self.win_name, remove=True) except RuntimeError: pass # Declare the GUI window which we want to work with self.my_win = pm.window(self.win_name, widthHeight=[200, 150]) base = pm.verticalLayout() with base: # Using the variable created 2 lines above, we can nest inside that layout element with pm.verticalLayout( ) as header: # We can also assign a variable while creating the layout element pm.text('FK/IK Setup') pm.separator() with pm.verticalLayout( ): # The assignment of a variable to the layout is optional #pm.button( ) # This button does nothing! pm.button(label='Create Guides', command=self.FKIK_create_guides ) # First way to execute a command with a button pm.button(label='Create Joints', command=self.FKIK_create_joints_from_guides ) # First way to execute a command with a button #pm.button( label='Create Orient Helper', command= self.FKIK_query_guide_orient ) # Fix spacing of layout elements base.redistribute(.1) header.redistribute(1, .1) # Last lines of code self.my_win.show()
def custom(self): self.customWin = 'customWindow' if (pm.window(self.customWin, ex=True)): pm.deleteUI(self.customWin) if (pm.windowPref(self.customWin, ex=True)): pm.windowPref(self.customWin, remove=True) myWin = pm.window(self.customWin, title='CUSTOM', width=200, height=150) pm.columnLayout(adjustableColumn=True) pm.text(l='Enter label') self.customLabel = pm.textField(editable=True) pm.text(l='Enter custom comment') self.customComment = pm.scrollField(width=200, height=150) self.customFeedback = pm.text(label='') pm.rowColumnLayout(nc=2) # nc = number of rows pm.button(label='create', command=pm.Callback(self.addCustom)) pm.button(label='add', command=pm.Callback(self.saveComment)) myWin.show()
def gui(): win = 'lighting' if pm.window(win, exists= True): pm.deleteUI(win) if pm.windowPref(win, exists= True): pm.windowPref(win, remove= True) global first, second my_win = pm.window(win, title= 'lighting_tools', sizeable= True, width= 400, backgroundColor= [.5, .5, .5]) main_layout = pm.scrollLayout(width= 400) tabs = pm.tabLayout(innerMarginWidth=5, innerMarginHeight=5, width = 400) first = pm.columnLayout(adjustableColumn= True) global light_type light_type = pm.optionMenu( label='Light Type', width= 250,) pm.menuItem( label='Spot') pm.menuItem( label='Area') pm.menuItem( label='Directional') pm.menuItem( label='Point') pm.menuItem( label='Ambient') pm.menuItem( label='Volume') my_text = pm.textFieldButtonGrp('myText', label= 'light name', buttonLabel= 'create', buttonCommand= create_light, columnWidth3= [100, 100, 100]) pm.setParent(tabs) second = pm.columnLayout(adjustableColumn = True, width = 400) pm.button(label= 'Create IBL UI', command= create_ibl) pm.tabLayout( tabs, edit=True, tabLabel=((first, 'Create Lights'),(second, 'IBL UI'))) my_win.show()
def uIGenerator(self): if pm.window(self.myWinName, query=True, exists=True): pm.deleteUI(self.myWinName) try: if pm.windowPref(self.myWinName, query=True, exists=True) and self.window_development: pm.windowPref(self.myWinName, remove=True) except RuntimeError: pass myWindow = pm.window(self.myWinName, title='Object Instancer', widthHeight=[600, 300]) base = pm.verticalLayout() with base: with pm.verticalLayout() as header: title = pm.text(label='Object Instancer'.upper()) pm.separator() with pm.verticalLayout() as target: self.targetInstances = pm.intSliderGrp( label="Target Instances", field=True, minValue=0, maxValue=1000, changeCommand=self.storeTargetInstances) pm.separator() with pm.verticalLayout() as randomization: title3 = pm.text(label='Randomization') self.rotation = pm.checkBoxGrp( numberOfCheckBoxes=3, label="Rotation ", labelArray3=("RotateX", "RotateY", "RotateZ"), changeCommand=self.storeRotations) self.translation = pm.checkBoxGrp( numberOfCheckBoxes=3, label="Translation ", labelArray3=("TransX", "TransY", "TransZ"), changeCommand=self.storeTranslation) pm.separator() with pm.verticalLayout() as Randomness: self.rRPecentage = pm.floatSliderGrp( label="Rotation Randomness", field=True, minValue=0, maxValue=100) self.tRPecentage = pm.floatSliderGrp( label="Translation Randomness", field=True, minValue=0, maxValue=100) with pm.horizontalLayout() as Button: pm.button(label='Generate', backgroundColor=[0, 1, 0.5], align='left', command=self.generate) base.redistribute(.4) header.redistribute(1, .1) myWindow.show()
def show_window(self): window_name = "设置通道".decode("utf-8") self.pass_dict = { 'red': ["红".decode("utf-8"), [1, 0, 0]], 'green': ["绿".decode("utf-8"), [0, 1, 0]], 'black': ["黑".decode("utf-8"), [0, 0, 0]], 'blue': ["蓝".decode("utf-8"), [0, 0, 1]], 'rim': ["边缘光".decode("utf-8"), [1, 1, 1]] } self.pop = {} if pm.window(window_name, q=1, ex=1): pm.deleteUI(window_name) if pm.windowPref(window_name, exists=1): pm.windowPref(window_name, remove=1) with pm.window(window_name): with set_template(): with pm.frameLayout(): with pm.rowLayout(numberOfColumns=3, columnWidth3=[420, 50, 50]): self.renderer = self.render_settings.currentRenderer.get( ) pm.text('info_text', label='') self.show_sg_attrs() pm.checkBox('hair_check', label='hair', onCommand=pm.Callback( self.show_hair_attrs), offCommand=pm.Callback(self.show_sg_attrs)) pm.checkBox('all_check', label='all', onCommand=pm.Callback(self.show_all_attrs), offCommand=pm.Callback(self.show_sg_attrs)) with pm.frameLayout(): with pm.rowLayout(numberOfColumns=5): pm.button('create_aov', label="创建mask aov".decode("utf-8"), command=self.add_mask_aov) if self.renderer == "arnold": rim_btn = pm.button( label="创建rim aov".decode('utf-8'), command=self.add_rim_aov) costom_btn = pm.button( label="创建常用aov".decode("utf-8")) popup_menu_left = pm.popupMenu(parent=costom_btn, button=1) pm.menuItem(parent=popup_menu_left, label='AO', command=pm.Callback( self.create_costom_aov, "AO")) pm.menuItem(parent=popup_menu_left, label='ambocc', command=pm.Callback( self.create_costom_aov, "ambocc")) pm.menuItem(parent=popup_menu_left, label='lambert', command=pm.Callback( self.create_costom_aov, "lambert")) popup_menu_right = pm.popupMenu(parent=costom_btn, button=3) pm.menuItem(parent=popup_menu_right, label='Set AO samples', command=self.set_ao_samples) pm.button(label="创建自定义aov".decode("utf-8"), command=self.add_custom_aov) if self.renderer == "mentalRay": pm.button(label=u"重建aov", command=self.rebuld_aov) elif self.renderer == 'arnold': pm.button(label=u"重建aov", command=self.rebuild_arnold_aov_final) with pm.frameLayout(): with pm.rowLayout(numberOfColumns=len(self.pass_dict)): all_pass = ["red", "green", "blue", "black", "rim"] if self.renderer == "mentalRay": all_pass = all_pass[:-1] for i in all_pass: pm.button(label=self.pass_dict[i][0], backgroundColor=self.pass_dict[i][1]) self.pop[i] = pm.popupMenu( button=1, postMenuCommand=pm.Callback( self.show_aov_lists, i))
def gui(dir_path): if(pm.window(win, ex = True)): pm.deleteUI(win) if(pm.windowPref(win, ex = True)): pm.windowPref(win, remove = True) myWin = pm.window(win, title='sal_testing' , sizeable = True, mnb = True, width = 480, height = 900, backgroundColor= [.68,.68,.68]) pm.scrollLayout() main01 = pm.columnLayout( adjustableColumn=True ) main02 = pm.columnLayout( adjustableColumn=True ) global antiAlising, compFocalLenght, prof pm.setParent(main02) # file info section pm.setParent(main02) infoColumn = pm.columnLayout(adjustableColumn=True) global fileInfo pm.setParent(main02) # grade total section infoFrame = pm.columnLayout(adjustableColumn=True) #infoLayout = pm.formLayout() # isntancing the total grade section global totalGrades totalGrades = sal.Total_Grades() totalGrades.create() #pm.setParent(infoFrame) pm.button( label = 'Output Grade and Comment' , command = checkWeighting) pm.setParent(main02) #pm.frameLayout( label = 'Grade', cll = True, cl = True , borderStyle = 'etchedIn', w = 480 ) #mainLayout = pm.formLayout() # grading / commenting section # first intance of Section for antiAliasing / Noise Quality grading = pm.frameLayout( label= 'Grading', cll = True, cl = True , borderStyle = 'etchedIn', w = 480) pm.setParent(grading) antiAlising = sal.Grading_Section( name = 'Anitalias/Noise Qual', fileName = r"%s/Comments/proj01_antiAlisaing.txt" % dir_path, field = totalGrades.queryAnti(), toUpdate = totalGrades) section01 = antiAlising.create() pm.setParent(grading) # second intance of Section for Composition / Focal Lenght compFocalLenght = sal.Grading_Section( name = 'Comp/Focal Length', fileName = r"%s/Comments/proj01_compFocal.txt" % dir_path, field = totalGrades.queryComp(), toUpdate = totalGrades) section02 = compFocalLenght.create() pm.setParent(grading) prof = sal.Grading_Prof( name = 'Professionalism', fileName = r"%s/Comments/proj01_prof.txt" % (dir_path), field = totalGrades.queryPro(), fileStart = r"%s/Startup/proj01_start.db" % (dir_path), toUpdate = totalGrades) prof.create() # first intance of Section for proffesionalism #prof = sal.Checker( fileName= r"/Users/Fearman/Desktop/sal_package/Sartup/proj01_start") #section03 = prof.create() pm.setParent(infoColumn) fileInfo = sal.Images(prof) myWin.show()
def sknTransferUI(): if pm.window('SkinTransfer', exists=True ): pm.deleteUI( 'SkinTransfer', window=True ) if pm.windowPref('SkinTransfer', exists=True ): pm.windowPref( 'SkinTransfer', r=True ) pm.window('SkinTransfer', title='Skin Transfer', iconName='Short Name', widthHeight=(336,150),s=0 ) form = pm.formLayout(numberOfDivisions=100,bgc =[(.294),(.294),(.294)]) source = pm.textField('sourcetxf',w=150,h=40) destination = pm.textScrollList('asd',h=40,w=150) sourceButton = pm.button(l='Source',w=150,bgc =[(.394),(.394),(.394)],c='sourceobjs()') destinationButton = pm.button(l='Destination',w=150,bgc =[(.394),(.394),(.394)],c='destinationObjs()') transfer = pm.button(l='Transfer',w=310,bgc =[(.2),(.5),(.4)],h=25,c='Transfer()') author = pm.symbolButton(i='UV_Freeze_Tool.png',c='author()') pm.formLayout(form,edit=True,attachForm=[ (source,'top',10), (destination,'top',11), (sourceButton,'top',60), (destinationButton,'top',60), (transfer,'top',91), (author,'top',120), (source,'left',12), (destination,'left',12), (sourceButton,'left',12), (destinationButton,'left',12), (transfer,'left',12), (author,'left',302), ], attachControl=[ (destination, 'left', 10, source), (sourceButton, 'bottom', 20, source), (destinationButton, 'left', 10, sourceButton), ] ) pm.showWindow('SkinTransfer')