Ejemplo n.º 1
0
	def create(self):
		try:
			pm.deleteUI(self.WINDOW_NAME,window=True)
		except:pass
		
		with pm.window(self.WINDOW_NAME) as res_window:
			with pm.columnLayout(adjustableColumn=True):
				with pm.horizontalLayout():
					pm.text(label='Resolution')
					with pm.optionMenu() as self.res_menu:
						pm.menuItem(l='Low')
						pm.menuItem(l='Med')
						pm.menuItem(l='Hig')
					set_res_btn = pm.button(
						label:'Set LOD',
						command=pm.Callback(self.on_set_res_btn)
					)
				pm.separator(style='in',height=4)
				with pm.horizontalLayout() as h1:
					pm.text(label = 'Low')
					select_low_btn=pm.button(
						label='Select All',
						command=pm.Callback(
							self.on_select_btn,
							'Low'
						)
					)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
    def _build_setup_tab(self, parent_layout):
        """
        """
        layout = pm.columnLayout(adj=True)

        TEXT_COL_WIDTH = 40
        pm.separator(height=5, style='none')

        pm.rowLayout(numberOfColumns=2,
                     columnAttach=[1, 'left', 3],
                     columnWidth=[1, TEXT_COL_WIDTH],
                     adjustableColumn2=2)
        pm.text('Name:')
        pm.textField(ADD_CONTROLLER_TEXTFIELD_NAME, text='mFIZ')
        pm.setParent('..')

        # Create checkbox to set the stop playback on disconnect stat
        pm.columnLayout(adjustableColumn=True, columnAttach=['left', 43])
        self.stop_playback_checkBox = pm.checkBox(
            label='Stop Playback on Disconnect',
            value=mFIZ_config.DEFAULT_STOP_PLAYBACK_ON_DISCONNECT)
        pm.setParent('..')

        pm.separator(height=5, style='none')

        pm.button('add_controller_button',
                  label='Add mFIZ Controller',
                  command=self._add_mFIZ_controller_to_scene)

        pm.setParent(parent_layout)

        return layout
Ejemplo n.º 4
0
def instructions(*args):

	if pm.window("InstructionsWindow", q=True, exists = True):
			pm.deleteUI("InstructionsWindow")
			
	InstructionsWindow = pm.window("InstructionsWindow",t="Instructions",w=200,h=300,bgc=[0.15,0.15,0.15], sizeable=False)
	pm.columnLayout(parent = "InstructionsWindow",adjustableColumn=True)
	
	pm.text(l='Instructions', fn='boldLabelFont', align='center' )
	pm.separator(h=10, style = 'none')
	pm.text(l='First define what the prefix of the character rig will be.', align='center' )
	pm.text(l='This is so when rigging multiple characters there are no overlapping names. ', align='center' )
	pm.separator(h=5, style = 'none')
	pm.text(l='Then input how many joints you want in the spine', align='center' )
	pm.text(l='the more joints the smoother the bend but the more weight painting required.', align='center' )
	pm.text(l='Judge based on the topology resolution of your model. ', align='center' )
	pm.separator(h=5, style = 'none')
	pm.text(l='When ready create the "Reference Skeleton" and scale the rig to match your character', align='center' )
	pm.text(l='before placing all the joints based on your model', align='center' )
	pm.separator(h=10, style = 'none')
	pm.text(l='When done press Finalize and your rig will be made! Happy animating!!!', align='center' )
	
	pm.separator(h=20,style='none')
	
	pm.button(l='Exit',c=partial(quit, "InstructionsWindow"),h=50,bgc=[0.2,0.2,0.2])
	
	pm.showWindow(InstructionsWindow)
	
	pm.window("InstructionsWindow", e=True,w=500,h=220)
 def create(self):
     # destroy the window if it already exists
     try:
         pm.deleteUI(self.WINDOW_NAME, window=True)
     except: pass
         # draw the window
     with pm.window(self.WINDOW_NAME) as res_window:
         with pm.columnLayout(adjustableColumn=True):
             with pm.horizontalLayout():
                 pm.text(label='Resolution')
                 with pm.optionMenu() as self.res_menu:
                     pm.menuItem(l='Low')
                     pm.menuItem(l='Med')
                     pm.menuItem(l='Hi')
                 set_res_btn = pm.button(label='Set LOD', command=pm.Callback(self.on_set_res_btn))
             pm.separator(style='in', height=4)
             with pm.horizontalLayout() as h1:
                 pm.text(label='Low')
                 select_low_btn = pm.button(label='Select All', command=pm.Callback(self.on_select_btn,'Low'))
                 toggle_low_btn = pm.button(label='Toggle Visibility', command=pm.Callback(self.on_vis_btn, 'Low'))
             with pm.horizontalLayout() as h1:
                 pm.text(label='Medium')
                 select_med_btn = pm.button(label='Select All', command=pm.Callback(self.on_select_btn, 'Med'))
                 toggle_med_btn = pm.button(label='Toggle Visibility', command=pm.Callback(self.on_vis_btn, 'Med'))
             with pm.horizontalLayout() as h1:
                 pm.text(label='High')
                 select_hi_btn = pm.button(label='Select All', command=pm.Callback(self.on_select_btn, 'Hi'))
                 toggle_hi_btn = pm.button(label='Toggle Visibility', command=pm.Callback(self.on_vis_btn, 'Hi'))
             self.status_line = pm.textField(editable=False)
         res_window.setWidthHeight((350,140))
Ejemplo n.º 6
0
	def UI_custom(self):
		
		numJoints = len(self.jointInfo)
		
		pm.rowLayout(numberOfColumns = 2, columnWidth = [1, 100], adjustableColumn = 2)
		pm.text(label = "Number of Joints: ")
		self.numberOfJointsField = pm.intField(value = numJoints, minValue = 2, changeCommand = self.ChangeNumberOfJoints)
		
		pm.setParent('..')
		
		joints = self.GetJoints()
		self.CreateRotationOrderUIControl(joints[0])
		
		pm.separator(style = 'in')
		
		pm.text(label = "Orientation: ", align = "left")
		pm.rowLayout(numberOfColumns = 3)
		pm.attrEnumOptionMenu(attribute = "%s:module_grp.sao_local" %self.moduleNamespace, label = "Local: ")
		pm.text(label = " will be oriented to ")
		pm.attrEnumOptionMenu(attribute = "%s:module_grp.sao_world" %self.moduleNamespace, label = "World: ")
		
		pm.setParent('..')
		
		pm.separator(style = 'in')
		
		interpolating = False
		if pm.objExists("%s:interpolation_container" %self.moduleNamespace):
			interpolating = True
		
		
		pm.rowLayout(numberOfColumns = 2, columnWidth = [1, 80], adjustableColumn = 2)
		pm.text(label = "Interpolate: ")
		pm.checkBox(label = "", value = interpolating, onCommand = partial(self.SetupInterpolation, True), offCommand = self.DeleteInterpolation)
Ejemplo n.º 7
0
    def create_widgets(self):
        pm.setParent(pm.mel.globals['gPreferenceWindow'])

        # Stop if this already exists.
        if pm.columnLayout(_layout_name, q=True, numberOfChildren=True) > 0:
            return

        # Create the UI
        pm.setParent(_layout_name)
        pm.setUITemplate('prefsTemplate', pushTemplate=True)
        try:
            # This is used to force the width to fill the window
            pm.separator(style='none', h=1)

            pm.frameLayout(label='zMayaTools')
            pm.columnLayout(adj=True)

            for pref_handler in self.preference_handlers:
                pref_handler.create_widgets()

        finally:
            pm.setUITemplate(popTemplate=True)

        # Load the optvars into the window.
        self.all_optvars_to_window()
Ejemplo n.º 8
0
    def __init__(self, opts):
        self.opts = opts
        with pm.frameLayout('Export Meshes (.FBX)', collapsable=True, cl=False, bs='out'):
            with pm.columnLayout(width=250):
                pm.text(l='Export List:')
                pm.separator(height=4)
                self.meshList = pm.textScrollList(height=250, width=250, ams=True, dkc=self._remove)
                with pm.rowColumnLayout(nc=3, cw=[(1, 82), (2, 82), (3, 82)]):
                    pm.button(l='Add', c=self._add)
                    pm.button(l='Remove', c=self._remove)
                    pm.button(l='Clear', c=self._clear)

                with pm.rowColumnLayout(nc=2, cw=[(1, 124), (2,124)]):
                    self.prefix = pm.checkBox(label='Prefix', value=self.opts['prefix'], cc=self.save)
                    self.suffix = pm.checkBox(label='Suffix', value=self.opts['suffix'], cc=self.save)
                    self.prefix_text = pm.textField(en=self.prefix.getValue(), text=self.opts['prefix_text'], cc=self.save)
                    self.suffix_text = pm.textField(en=self.suffix.getValue(), text=self.opts['suffix_text'], cc=self.save)

                pm.text(l='Export Path:')
                with pm.rowColumnLayout(nc=2, cw=[(1, 215), (2, 32)]):
                    self.fbxPath = pm.textField(text=self.opts['fbxPath'], cc=self._pathRefreash)
                    pm.button(l='...', c=self._path)

                with pm.rowColumnLayout(nc=3):
                    self.center = pm.checkBox(label='Move to Orgin', v=self.opts['center'], cc=self.save)
                    self.child = pm.checkBox(label='Export Childern', v=self.opts['child'], cc=self.save)
                    pm.button(l='FBXPreset', c=self._fbxPreset)

                with pm.rowColumnLayout(nc=2, cw=[(1, 124), (2, 124)]):
                    pm.button(l='Selected', c=self._selected)
                    pm.button(l='All', c=self._all)

        self._refresh()
Ejemplo n.º 9
0
def mainUi(nameList):
    #localNameList = ['winText', 'selName', 'grpName', 'offName', False, 'pieceName']

    selText = nameList[0]
    objectName = nameList[1]
    selOk = nameList[4]

    if pm.window('toolbox', exists=True):
        pm.deleteUI('toolbox')

    window = pm.window('toolbox',
                       title='Toolbox',
                       iconName='FK',
                       widthHeight=(400, 500))

    if pm.columnLayout('winLayout', exists=True):
        pm.deleteUI('winLayout')

    winLayout = pm.columnLayout('winLayout', adjustableColumn=True)
    pm.separator('sep1', height=10, style='double')
    windowText = pm.text(selText, p=winLayout, al='center')
    pm.separator(height=20, style='double')
    pm.button(label='Make Control', command=partial(ctrlUi, nameList))
    pm.button(label='Delete History', command=delHist)
    pm.button(label='Delete Non-Deformer History', command=delNonDefHist)
    pm.button(label='Freeze Transformations', command=freezeTrans)
    pm.button(label='Group All', command=groupSel)
    pm.button(label='Sequential Renamer', command=seqRename, en=False)
    pm.button(label='Done',
              command=('pm.deleteUI(\"' + window + '\", window=True)'))
    pm.setParent('..')
    pm.showWindow(window)
    winJob = pm.scriptJob(kws=True, p=window, e=("SelectionChanged", main))
Ejemplo n.º 10
0
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 )
Ejemplo n.º 11
0
    def __init__(self, name):
        self.name = name

        if pm.window(self.name, q=True, exists=True):
            pm.deleteUI(self.name)

        self.window = pm.window(self.name, width=300)
        pm.columnLayout(columnOffset=("both", 20), height=100, rowSpacing=10)
        pm.separator()
        self.scale = pm.floatSliderGrp(label="Camera Scale",
                                       field=True,
                                       value=0.1,
                                       precision=3,
                                       columnAlign=(1, "left"))
        self.single = pm.checkBoxGrp(label="Export Single Frame",
                                     value1=False,
                                     columnAlign=(1, "left"))
        self.houexp = pm.checkBoxGrp(label="Export Houdini Camera",
                                     value1=True,
                                     columnAlign=(1, "left"))
        self.mayaexp = pm.checkBoxGrp(label="Export Maya Camera",
                                      value1=True,
                                      columnAlign=(1, "left"))
        self.range = pm.intFieldGrp(
            numberOfFields=2,
            label="Frame Range",
            value1=int(pm.playbackOptions(query=True, min=True)),
            value2=int(pm.playbackOptions(query=True, max=True)),
            columnAlign=(1, "left"))
        pm.separator()
        pm.rowLayout(numberOfColumns=2, width=300, adjustableColumn=1)
        pm.button(label="Export", width=300, command=self.exportCamera)
        pm.showWindow(self.name)
Ejemplo n.º 12
0
def importReferenceCallback(*pArgs):
    mySelection = pm.fileDialog2(caption='Import',
                                 fileFilter='*.fbx',
                                 fileMode=4,
                                 dialogStyle=2,
                                 okCaption='Select Directory')
    newObjects = importWithComparison(mySelection[0])

    windowID = 'referenceID'
    globalGender[0] = getGender()

    if cmds.window(windowID, exists=True):
        cmds.deleteUI(windowID)

    pm.window(windowID, resizeToFitChildren=True, title='Import Reference')
    pm.rowColumnLayout(numberOfColumns=1)
    pm.text(label='Describe your reference:')
    pm.textField("referenceDescription", width=200)
    pm.rowColumnLayout(numberOfColumns=3)
    pm.separator(width=100, style='none')
    pm.button(label='Save',
              width=50,
              command=functools.partial(saveReferenceName, newObjects))
    pm.button(label='Cancel',
              width=50,
              command=functools.partial(cancelName, windowID))
    pm.setParent('..')
    pm.setParent('..')

    pm.showWindow(windowID)
Ejemplo n.º 13
0
 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))
Ejemplo n.º 14
0
def uiCreate(selText, obName, selectionOk):
    objectName = obName
    selOk = selectionOk
    if pm.window('fkCtrlMaker', exists=True):
        pm.deleteUI('fkCtrlMaker')

    window = pm.window('fkCtrlMaker',
                       title='Fk Ctrl Maker',
                       iconName='FK',
                       widthHeight=(400, 200))

    if pm.columnLayout('winLayout', exists=True):
        pm.deleteUI('winLayout')

    winLayout = pm.columnLayout('winLayout', adjustableColumn=True)
    pm.separator('sep1', height=10, style='double')
    windowText = pm.text(selText, p=winLayout, al='center')
    pm.separator(height=20, style='double')
    pm.button(label='Basic Circle',
              command='makeShape("BCircle", objectName, groupName, offName)',
              en=selOk)
    pm.button(label='Detailed Circle',
              command='makeShape("DCircle", objectName, groupName, offName)',
              en=selOk)
    pm.button(label='Basic Square', command='buttonPressed()', en=selOk)
    pm.button(label='Close',
              command=('pm.deleteUI(\"' + window + '\", window=True)'))
    pm.setParent('..')
    pm.showWindow(window)
    winJob = pm.scriptJob(kws=True,
                          p=window,
                          e=("SelectionChanged", selectionCheck))
Ejemplo n.º 15
0
def multi_BasicSettings():
	# Basic Settings
	pm.text(l='', h=5)
	multi_nameField = pm.textFieldGrp('hp3dNameField', l='Name', text='', cw=[2, 150], cc=fun.partial(multi_nameChange, 'hp3dNameField'), fcc=True)

	pm.rowColumnLayout(nc=2)
	pm.text(l='Basic Settings', w=75, al='left', en=False)
	pm.separator(w=marginWidth-75, h=14)
	pm.setParent(multiLight_layout)

	multi_color = pm.colorSliderGrp('hp3dColorSlider', label='Color', rgb=(1, 1, 1), cw=[3, 20], dc=fun.partial(multi_colorChange, '.color', 'all', 'hp3dColorSlider'))
	multi_intensity = pm.floatSliderGrp('hp3dIntensitySlider', label='Intensity', field=True, v=1.000, fmx=1000000000, pre=3, cw=[3, 20], dc=fun.partial(multi_floatChange, '.intensity', 'all', 'hp3dIntensitySlider'))

	# pm.text(l='', h=3) # GUI SPACER
	pm.rowColumnLayout(nc=2)
	pm.text(l='', w=142) # GUI SPACER
	global multi_illDefault_box
	multi_illDefault_box = pm.checkBox(l='Illuminates by Default', v=1, cc=multi_illDefault)
	pm.setParent(multiLight_layout)

	pm.rowColumnLayout(nc=3)
	pm.text(l='', w=142) # GUI SPACER
	multi_emitDiff_box = pm.checkBox('hp3dEmitDiffCheckbox', l='Emit Diffuse', v=1, w=120, cc=fun.partial(multi_checkboxChange, '.emitDiffuse', 'all', 'hp3dEmitDiffCheckbox'))
	multi_emitSpec_box = pm.checkBox('hp3dEmitSpecCheckbox', l='Emit Specular', v=1, cc=fun.partial(multi_checkboxChange, '.emitSpecular', 'all', 'hp3dEmitSpecCheckbox'))
	pm.setParent(multiLight_layout)

	pm.rowColumnLayout(nc=3)
	pm.text(l='Decay Rate', w=140, al='right')
	pm.text(l='', w=3)
	multi_decayRate_menu = pm.optionMenu('hp3dDecayRateMenu', bgc=primary_componentColor, cc=fun.partial(multi_menuChange, '.decayRate', 'not directional', 'hp3dDecayRateMenu'))
	pm.menuItem(l='No Decay', da=0)
	pm.menuItem(l='Linear', da=1)
	pm.menuItem(l='Quadratic', da=2)
	pm.menuItem(l='Cubic', da=3)
	pm.setParent(multiLight_layout)
Ejemplo n.º 16
0
    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')
Ejemplo n.º 17
0
    def uiOptions(self):
        with pm.tabLayout(tv=False, imw=5, imh=5 ) as layout:  
            with pm.columnLayout(adj=1):
                self.navFieldGrp( 'navFieldGrp', label='Work Path : ', text=self.startPath.get(), optVar=self.startPath, fileMode='dir' )
             
                pm.separator(style='in', h=8)       
                with pm.rowLayout(nc=7):
                    pm.text(l=' Work : ', al='right', w=140 )   
                    pm.button(l='Create',      c=partial( self.btnCmd, 'create'), w=50 )
                    pm.button(l='Reload',      c=partial( self.btnCmd, 'reload'), w=50 )    
                    pm.button(l='Replace',     c=partial( self.btnCmd, 'replace'), w=50 )
                    pm.button(l='Import',      c=partial( self.btnCmd, 'import'), w=50 )
                    pm.button(l='Remove',      c=partial( self.btnCmd, 'remove'), w=50 )    
            
                with pm.rowLayout(nc=7):
                    pm.text(l='',al='right', w=140 )    
                    pm.button(l='Print Reference State', c=partial( self.btnCmd, 'state'), w=128 )

                pm.separator(style='in', h=8)                
                with pm.rowLayout(nc=7):
                    pm.text(l='Maya Editor : ',al='right', w=140 )    
                    pm.button(l='Reference Editor',  c=pm.Callback( pm.mel.ReferenceEditor ), w=128 )
                    pm.button(l='Namespace Editor',  c=pm.Callback( pm.mel.NamespaceEditor ), w=128 )

        return layout
Ejemplo n.º 18
0
 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
Ejemplo n.º 19
0
def _build_axis_info_frame(parent_layout):
    # Axis Info
    pm.frameLayout(
        label="Axis Info",
        # height=215,
        collapsable=True)
    pm.columnLayout(adj=True, columnAttach=('both', 5))

    pm.textScrollList('tsl_externalAxes',
                      allowMultiSelection=False,
                      height=185,
                      selectCommand=mimic_external_axes.axis_selected)

    pm.gridLayout(nc=2, cw=109, ch=25)
    pm.button(label='List Axes',
              annotation='Lists all external axes on selected robot',
              command=mimic_external_axes.list_axes)

    pm.button(label='Clear List',
              annotation='Clears list above',
              command=mimic_external_axes.clear_external_axis_list)

    pm.setParent('..')

    pm.button(label='Deselect',
              annotation='Deselects all axes in list above',
              command=mimic_external_axes.deselect_external_axis)
    pm.separator(height=10, style='out')

    pm.button(label='Remove Axis',
              annotation='Removes selected axis from robot',
              command=mimic_external_axes.remove_external_axis)
    pm.setParent(parent_layout)
Ejemplo n.º 20
0
    def addToLayout(self, option):
        if option == 1:
            self.widgetName = pm.columnLayout(self.name, p=self.parentWidget.widgetName, backgroundColor=self.color,w=140, h=75, dragCallback=self.dragCallback)
            pm.text(label=self.itemName,  font="boldLabelFont")
            pm.separator(h=5)
            pm.rowLayout(nc=2)
            pm.iconTextButton(image=self.imgPath, style='iconOnly', command=self.clickCallBack, doubleClickCommand=self.dClickCallBack, h=50, w=50)
            pm.columnLayout()
            pm.text(label=self.label,  font="smallPlainLabelFont")
            pm.separator(h=2, st='in')
            pm.text(label='code:%s' % self.code,   font="smallPlainLabelFont")
            pm.text(label='user: non',  font="smallPlainLabelFont")
            pm.text(label=self.status, font = "smallObliqueLabelFont")
            self.addMenus()

        elif option == 2:
            self.widgetName = pm.columnLayout(self.name, p=self.parentWidget.widgetName, backgroundColor=self.color,
                                               w=100, h=45, dragCallback=self.dragCallback)
            pm.text(label=self.itemName, font="smallBoldLabelFont")
            pm.rowLayout(nc=5)
            pm.iconTextButton(image=self.imgPath, style='iconOnly', command=self.clickCallBack,
                              doubleClickCommand=self.dClickCallBack,h=30,w=30)
            pm.columnLayout()
            pm.text(label=self.label,  font="smallPlainLabelFont")
            self.addMenus()
Ejemplo n.º 21
0
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)
Ejemplo n.º 22
0
def _build_io_info_frame(parent_layout):
    # IO Info
    pm.frameLayout(
        label="IO Info",
        # height=215,
        collapsable=True)
    pm.columnLayout(adj=True, columnAttach=('both', 5))

    pm.textScrollList('tsl_ios',
                      allowMultiSelection=False,
                      height=219,
                      selectCommand=mimic_io.io_selected)

    pm.gridLayout(nc=2, cw=109, ch=25)
    pm.button(label='List IOs',
              annotation='Lists all IOs on selected robot',
              command=mimic_io.list_ios)

    pm.button(label='Clear List',
              annotation='Clears list above',
              command=mimic_io.clear_io_list)

    pm.setParent('..')

    pm.button(label='Deselect',
              annotation='Deselects all axes in list above',
              command=mimic_io.deselect_io)

    pm.separator(height=10, style='out')

    pm.button(label='Remove IO',
              annotation='Removes selected axis from robot',
              command=mimic_io.remove_io)

    pm.setParent(parent_layout)
Ejemplo n.º 23
0
	def show(self):
		self.window = pm.window(self.name, wh=(self.w, self.h), title=self.name)
		self.fl = pm.formLayout(nd=100)

		#create the main form layout of the window
		self.frame_layout = pm.frameLayout(bgc=(.3,.1,.25), li=self.w/4, la='center', fn='boldLabelFont', 
										label='AW Binary Proxy Tools', borderStyle='in', mh=self.h/12,h=self.h-40)
		self.cl = pm.columnLayout(adj=True, cal='left', cat=['both',0], rs=5)
		pm.text(label='mip_renderProxy Creation', al='center')
		pm.button (label='Create Render Proxies', bgc=(.4,.5,.2),
			command= lambda *args: self._createRenderProxy( pm.ls(sl=True) ))
		pm.separator(st='doubleDash', h=25)
		pm.text(label='mip_renderProxy Assignment', al='center')
		self.fileInput = TextFieldBrowserInput( width=300, name='Proxy Input', option_name='Proxy Browse Type', options=['from file', 'from folder'], button_name='Browse', parent=self.cl )
		pm.button (label='Assign Render Proxies', bgc=(.4,.5,.2), 
				   command= lambda *args: self._attachRenderProxy( pm.ls(sl=True) ))
		pm.button (label='DELETE ALL BINARY PROXIES', bgc=(.4, .2, .2), command=self._removeAllBipx)
		pm.setParent('..')
		pm.setParent('..')
		#add the close window button
		self.close_btn = pm.button (w=self.bw, label='Close', bgc = (.4, .2, .2), command=self.close_UI)
		#finalize form layout
		pm.formLayout(self.fl, edit=True,
				   attachForm = [(self.frame_layout, 'top', 0),
								 (self.frame_layout, 'left', 0),
								 (self.frame_layout, 'right', 0),
								 (self.close_btn, 'bottom', 10),
								 (self.close_btn, 'right', 10)])
		pm.showWindow(self.window)
Ejemplo n.º 24
0
def uiContents():
    with pm.frameLayout(l='Color', cll=True, mw=3, mh=3 ):
        with pm.columnLayout(adj=True):

            with pm.rowLayout(nc=2):
                pm.text(label='Set Override Color : ', align='right', w=130)
                with pm.rowColumnLayout( nc=10 ):
                    wh=18
                    for i in range(0,32):
                        rgb = (0,0,0)
                        if i == 0:
                            rgb  = (0.5,0.5,0.5)
                            anno = 'Reset'
                            pm.symbolButton( i=iconPath+'ui_colorNone.png', annotation=anno, w=wh, h=wh, c=pm.Callback( setColor.setColor, color=i ) )

                        else:
                            rgb  = pm.colorIndex( i, q=True )
                            anno = '- index : %d\n- RGB : %03.3f %03.3f %03.3f\n- name : %s'%(i, rgb[0], rgb[1], rgb[2], setColor.color_intToStr(i) )

                            pm.canvas(
                                rgbValue   = rgb,
                                annotation = anno,
                                w=wh, h=wh,
                                pressCommand = pm.Callback( setColor.setColor, color=i )
                                ) #partial( self.setColor, i, True , self._toShape)) #partial( self.setColor, i, False, False))

            pm.separator(h=8,style='in')
            with pm.rowLayout( nc=10 ):
                pm.text(label='Set Wire Frame Color : ', align='right', w=130)
                pm.button(label='Object Color Palette', c=pm.Callback( pm.mel.objectColorPalette ), w=180 )

# ======================================
# Buttons
# ======================================
Ejemplo n.º 25
0
def _build_jerk_limits_tab(parent_layout):
    jerk_limits_tab = pm.rowColumnLayout('jerk_limits_tab', numberOfColumns=2)

    # Set up primary axis accel limits tab
    pm.columnLayout(adj=True, columnAttach=('both', 5))
    pm.separator(height=5, style='none')

    # Input text field width for all axis limits
    cell_width = 163

    for i in range(6):
        # Axis 1 Limit row
        pm.rowLayout(numberOfColumns=2,
                     columnAttach=(1, 'left', 3),
                     adjustableColumn=2,
                     height=20)
        pm.text(label='Axis {}: '.format(i + 1), enable=False)

        set_focus_count = ((i + 1) % 6) + 1
        # Axis 1 Min limit
        pm.textField("t_A{}Jerk".format(i + 1),
                     font=FONT,
                     pht='deg/sec' + u'\xb3',
                     width=cell_width,
                     changeCommand='import pymel.core as pm; ' \
                                   'import mimic_utils; ' \
                                   'pm.setFocus("t_A{}Jerk"); ' \
                     .format(set_focus_count))
        pm.setParent('..')

    pm.setParent(parent_layout)

    return jerk_limits_tab
Ejemplo n.º 26
0
    def __init__(self, *args, **kwargs):

        kwargs['resizeToFitChildren'] = True
        kwargs['sizeable']            = False

        super(RigManager, self).__init__(*args, **kwargs)

        with self._window:

            with FluidColumnLayout(numberOfChildren = 1, attachBottom = False, attachRight = False):

                self._columns = FluidColumnLayout(numberOfChildren = 3, padding = Format.PADDING, separation = Format.PADDING)
                with self._columns:

                    self._createLayout = FluidRowLayout(numberOfChildren = 2, separation = Format.SEPARATION)
                    with self._createLayout:

                        self._nameInput    = pm.textField(text = 'Rig', width = Format.Text.WIDTH, enterCommand = lambda *args: self.createRig())
                        self._createButton = pm.button(label = 'Create New', command = lambda *args: self.createRig(), width = Format.Button.WIDTH)

                    pm.separator()

                    self._listLayout = FluidColumnLayout()

        self.populateRigList()

        self._updateOnCreate  = pm.scriptJob(
            event             = ['DagObjectCreated', self.populateRigList],
            parent            = self._window,
            replacePrevious   = True
        )

        self._window.show()
Ejemplo n.º 27
0
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 )
Ejemplo n.º 28
0
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)
Ejemplo n.º 29
0
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)
Ejemplo n.º 30
0
 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)
Ejemplo n.º 31
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'] )
Ejemplo n.º 32
0
	def __init__(self, lightTransform, lightType, lightShape):
		super(PointLight, self).__init__(lightTransform, lightType, lightShape)
		pm.setParent(self.indivLight_layout)
		
		pm.rowColumnLayout(nc=3)
		pm.text(l='Decay Rate', w=140, al='right')
		pm.text(l='', w=3)
		decayRate_menu = pm.optionMenu(bgc=primary_componentColor)
		pm.menuItem(l='No Decay', da=0)
		pm.menuItem(l='Linear', da=1)
		pm.menuItem(l='Quadratic', da=2)
		pm.menuItem(l='Cubic', da=3)
		pm.connectControl(decayRate_menu, lightShape+'.decayRate')
		pm.setParent(self.indivLight_layout)

		pm.rowColumnLayout(nc=2)
		pm.text(l='Shadow Settings', w=90, al='left', en=False)
		pm.separator(w=marginWidth-90, h=14)
		pm.setParent(self.indivLight_layout)

		pm.attrFieldSliderGrp(at=lightShape+'.lightRadius', cw=[[2, 75], [3, 120]], hmb=False)
		self.shadowRays_slide = pm.attrFieldSliderGrp(at=lightShape+'.shadowRays', cw=[[2, 75], [3, 120]], hmb=False)
		pm.attrFieldSliderGrp(at=lightShape+'.rayDepthLimit', cw=[[2, 75], [3, 120]], hmb=False)

		pm.setParent(lights_layout)
Ejemplo n.º 33
0
def multi_MentalRaySettings():
	# Mental Ray Settings
	pm.rowColumnLayout(nc=2)
	pm.text(l='Mental Ray Settings', w=106, al='left', en=False)
	pm.separator(w=marginWidth-106, h=14)
	pm.setParent(multiLight_layout)

	pm.rowColumnLayout(nc=2)
	pm.text(l='', w=142) # GUI SPACER
	multi_MrAreaLight_box = pm.checkBox('hp3dUseShapeCheckbox', l='Use Light Shape', cc=fun.partial(multi_checkboxChange, '.areaLight', 'area & spot', 'hp3dUseShapeCheckbox'))
	pm.setParent(multiLight_layout)

	pm.rowColumnLayout(nc=3)
	pm.text(l='Type', w=140, al='right')
	pm.text(l='', w=3)
	multi_areaType_menu = pm.optionMenu('hp3dAreaTypeMenu', bgc=primary_componentColor, cc=fun.partial(multi_menuChange, '.areaType', 'area & spot', 'hp3dAreaTypeMenu'))
	pm.menuItem(l='Rectangle', da=0)
	pm.menuItem(l='Disc', da=1)
	pm.menuItem(l='Sphere', da=2)
	pm.menuItem(l='Cylinder', da=3)
	pm.menuItem(l='Custom', da=4)
	pm.setParent(multiLight_layout)

	multi_highSamples = pm.intFieldGrp('hp3dHighSamplesField', numberOfFields=1, label='High Samples', v1=8, cc=fun.partial(multi_samplesChange, 'highSamp'))
	multi_highSampLimit = pm.intFieldGrp('hp3dHighSampleLimitField', numberOfFields=1, label='High Sample Limit', v1=1, cc=fun.partial(multi_samplesChange, 'highSampLimit'))
	multi_lowSamples = pm.intFieldGrp('hp3dLowSamplesField', numberOfFields=1, label='Low Samples', v1=1, cc=fun.partial(multi_samplesChange, 'lowSamp'))
	pm.setParent(multiLight_layout)
    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()
Ejemplo n.º 35
0
    def initialiseLayout(self):
        
        #=======================================================================
        # Define Top Level Layout
        #=======================================================================
        self.widgets['top_level_layout'] = pm.verticalLayout()


        #=======================================================================
        # Define Layout
        #=======================================================================
        # Title Layout
        pm.setParent(self.widgets['top_level_layout'])
        self.widgets['title_layout'] = pm.horizontalLayout()
        pm.text('Multi Attributes')
        pm.text('Connection Index')
        pm.text('Connection Target')
        
        #List Layout
        pm.setParent(self.widgets['top_level_layout'])
        self.widgets['list_layout'] = pm.horizontalLayout()
        
        pm.setParent(self.widgets['list_layout'])
        self.widgets["attributes_list"] = pm.textScrollList(selectCommand=self.refresh_connections)

        pm.setParent(self.widgets['list_layout'])
        self.widgets["index_list"] = pm.textScrollList(ams=True)
        
        pm.setParent(self.widgets['list_layout'])
        self.widgets["connections_list"] = pm.textScrollList(enable=False)

        #refresh Button
        pm.setParent(self.widgets['top_level_layout'])
        self.widgets["refresh_button"] = pm.button(label="Load Selection", command=self.refresh)

        # Add Attribute
        pm.setParent(self.widgets['top_level_layout'])
        pm.separator()
        self.widgets['addAttr_layout'] = pm.horizontalLayout()
        pm.text('Add Attribute:') 
        self.widgets['attr_name'] = pm.textField() 
        self.widgets["add_button"] = pm.button(label="Add", c=self.addAttr_selected)

        # Misc Buttons        
        pm.setParent(self.widgets['top_level_layout'])
        self.widgets['buttons_layout'] = pm.horizontalLayout()
        self.widgets["append_button"] = pm.button(label="Append", command=self.append_selected)
        self.widgets["remove_button"] = pm.button(label="Remove", command=self.remove_selected)
        self.widgets["clear_button"] = pm.button(label="Clear", command=self.clear_selected)

                
        #=======================================================================
        # Redistribute
        #=======================================================================
        self.widgets['addAttr_layout'].redistribute(1,2,1)
        self.widgets['list_layout'].redistribute()
        self.widgets['title_layout'].redistribute()
        self.widgets['buttons_layout'].redistribute()
        self.widgets['top_level_layout'].redistribute(1,10,1,1,1,1)
Ejemplo n.º 36
0
    def uiCreate(self):

        self.uiClose()

        self.window = pm.window(
            WIN_NAME,
            title=SCRIPT_NAME,
            maximizeButton=False
        )

        with self.window:
            with pm.formLayout() as ui_LAY_mainForm:
                with pm.scrollLayout(childResizable=True) as ui_LAY_mainScroll:
                    with pm.frameLayout(
                            label='Parameters',
                            collapsable=True,
                            marginHeight=3,
                            borderStyle='etchedIn',
                            borderVisible=True,
                            collapse=False
                    ):
                        with pm.columnLayout(adjustableColumn=True, columnOffset=('both', 2)):
                            self.ui_FLTFLDGRP_xPos = pm.floatFieldGrp(numberOfFields=1, label='+X', precision=6)
                            self.ui_FLTFLDGRP_xNeg = pm.floatFieldGrp(numberOfFields=1, label='-X', precision=6)
                            self.ui_FLTFLDGRP_yPos = pm.floatFieldGrp(numberOfFields=1, label='+Y', precision=6)
                            self.ui_FLTFLDGRP_yNeg = pm.floatFieldGrp(numberOfFields=1, label='-Y', precision=6)
                            self.ui_FLTFLDGRP_zPos = pm.floatFieldGrp(numberOfFields=1, label='+Z', precision=6)
                            self.ui_FLTFLDGRP_zNeg = pm.floatFieldGrp(numberOfFields=1, label='-Z', precision=6)

                            pm.separator(style='none', height=5)

                self.ui_BTN_create = pm.button(
                    label='Create',
                    height=MAIN_BUTTONS_HEIGHT,
                    command=self.ui_on_BTN_create_clicked
                )

                self.ui_BTN_close = pm.button(
                    label='Close',
                    height=MAIN_BUTTONS_HEIGHT,
                    command=self.uiClose
                )

                ui_LAY_mainForm.attachForm(ui_LAY_mainScroll, 'top', 2)
                ui_LAY_mainForm.attachForm(ui_LAY_mainScroll, 'left', 2)
                ui_LAY_mainForm.attachForm(ui_LAY_mainScroll, 'right', 2)
                ui_LAY_mainForm.attachControl(ui_LAY_mainScroll, 'bottom', 2, self.ui_BTN_create)

                ui_LAY_mainForm.attachNone(self.ui_BTN_create, 'top')
                ui_LAY_mainForm.attachForm(self.ui_BTN_create, 'left', 2)
                ui_LAY_mainForm.attachPosition(self.ui_BTN_create, 'right', 2, 50)
                ui_LAY_mainForm.attachForm(self.ui_BTN_create, 'bottom', 2)

                ui_LAY_mainForm.attachNone(self.ui_BTN_close, 'top')
                ui_LAY_mainForm.attachPosition(self.ui_BTN_close, 'left', 2, 50)
                ui_LAY_mainForm.attachForm(self.ui_BTN_close, 'right', 2)
                ui_LAY_mainForm.attachForm(self.ui_BTN_close, 'bottom', 2)

        self.setupInitialValues()
Ejemplo n.º 37
0
def info_area():
	global info_layout
	info_layout = pm.rowColumnLayout(nc=5)

	leftInfo_area()
	pm.text(l='') # GUI SPACER
	pm.separator(horizontal=False, h=50, w=13)
	pm.text(l='') # GUI SPACER
	rightInfo_area()
Ejemplo n.º 38
0
    def __init__(self, **options):
        super(UI, self).__init__(**options)
        
        pm.menu(label='Options', tearOff=True, parent=self)
        pm.menuItem(label='Export members', c=pm.Callback(self.export_members))
        pm.menuItem(label='Import members', c=pm.Callback(self.import_members))
        pm.menuItem(label='---', enable=False)
        self.select_members_in_scene = pm.menuItem('Select members in scene', checkBox=DEFAULTS['select_members_in_scene'])

        with pm.verticalLayout() as main_layout:
            with pm.horizontalLayout() as content_layout:
                with pm.verticalLayout() as set_layout:
                    with pm.verticalLayout() as set_top_layout:
                        pm.button(label='load selection', c=pm.Callback(self.load_sets_from_selection))
                        pm.button(label='load all', c=pm.Callback(self.load_sets_from_scene))
                        pm.separator()
                        pm.button(label='select in scene', c=pm.Callback(self.select_sets_in_scene))
                    set_top_layout.redistribute()
                    self.sets_list = pm.textScrollList(allowMultiSelection=True, sc=pm.Callback(self.load_members))
                    # load_members
                set_layout.redistribute(0, 1)
                with pm.verticalLayout() as member_layout:
                    with pm.verticalLayout() as member_head_layout:
                        self.active_set = pm.textField(enable=False)
                        with pm.horizontalLayout() as member_selection_layout:
                            pm.button(label='+', c=pm.Callback(self.add_members_from_selection))
                            pm.button(label='-', c=pm.Callback(self.remove_members_from_selection))
                            pm.button(label='fix', c=pm.Callback(self.fix_member_order))
                        member_selection_layout.redistribute()
                        pm.separator()
                    member_head_layout.redistribute()

                    with pm.horizontalLayout() as dag_layout:
                        self.dag_member_list = pm.textScrollList(allowMultiSelection=True, sc=pm.Callback(self.dag_selection))
                        with pm.verticalLayout(w=20) as dag_button_layout:
                            pm.text('dag')
                            pm.button(label='UP', c=pm.Callback(self.move_dag_members_up))
                            pm.button(label='DN', c=pm.Callback(self.move_dag_members_down))
                            pm.button(label='-', c=pm.Callback(self.remove_active_dag_member))
                        dag_button_layout.redistribute()
                    dag_layout.redistribute(3, 1)

                    with pm.horizontalLayout() as dn_layout:
                        self.dn_member_list = pm.textScrollList(allowMultiSelection=True, sc=pm.Callback(self.dn_selection))
                        with pm.verticalLayout(w=20) as dn_button_layout:
                            pm.text('dn')
                            pm.button(label='UP', c=pm.Callback(self.move_dn_members_up))
                            pm.button(label='DN', c=pm.Callback(self.move_dn_members_down))
                            pm.button(label='-', c=pm.Callback(self.remove_active_dn_member))
                        dn_button_layout.redistribute()
                    dn_layout.redistribute(3, 1)
                member_layout.redistribute(0, 1, 1)
            content_layout.redistribute(4, 5)
        main_layout.redistribute()

        self.show()
        self.load_sets_from_selection()
Ejemplo n.º 39
0
    def __init__(self, rig, *args, **kwargs):

        self._rig                     = rig

        if not isinstance(rig, Rig):
            raise TypeError('{0} is not type {1}'.format(rig, Rig))

        name                          = rig.name
        kwargs['name']                = name
        kwargs['title']               = name

        kwargs['resizeToFitChildren'] = True
        kwargs['sizeable']            = False

        super(RigEditor, self).__init__(*args, **kwargs)

        with self._window:

            with FluidColumnLayout(numberOfChildren = 1, attachBottom = False, attachRight = False):

                self._sectionsColumn = FluidColumnLayout(numberOfChildren = 1)
                with self._sectionsColumn:

                    self._legFrame = pm.frameLayout(label='Legs', borderStyle='in')
                    with self._legFrame:

                        with FluidColumnLayout(padding = Format.PADDING):

                            self._legColumn = FluidColumnLayout(numberOfChildren = 3, separation = Format.PADDING)
                            with self._legColumn:

                                self._legCreateLayout = FluidRowLayout(numberOfChildren = 2, separation = Format.SEPARATION)
                                with self._legCreateLayout:

                                    self._legNameInput    = pm.textField(text = 'Leg', width = Format.Text.WIDTH, changeCommand = lambda *args: self.createLegRig())
                                    self._legCreateButton = pm.button(label = 'Create New', command = lambda *args: self.createLegRig(), width = Format.Button.WIDTH)

                                pm.separator()

                                self._legListLayout = FluidColumnLayout(numberOfChildren = 2)

        self.populateRigList()

        self._updateOnCreate  = pm.scriptJob(
            event             = ['DagObjectCreated', self.populateRigList],
            parent            = self._window,
            replacePrevious   = True
        )

        self._updateOnDelete = pm.scriptJob(
            nodeDeleted      = [self._rig.node, self.delete],
            parent           = self._window,
            replacePrevious  = True
        )

        self._window.show()
Ejemplo n.º 40
0
	def __init__(self, shape, trans, lightType):
		self.lightShape = shape
		self.lightTransform = trans
		self.lightType = lightType

		indivUnsupported_layout = pm.rowColumnLayout(nc=1, cal=[1, 'left'])
		pm.text(l="# {0} ({1}) not supported in this window".format(self.lightTransform, self.lightType), w=marginWidth)
		# pm.button(l='Delete', w=50, ann='Change {0}\'s "Shadow Color" to black'.format(self.lightTransform), bgc=primary_componentColor, c=self.fix_shadowColor)
		pm.setParent(unsupportedLights_layout)
		pm.separator(w=marginWidth, h=14)
Ejemplo n.º 41
0
    def FujiRendererCreateTab(self):
        log.debug("FujiRendererCreateTab()")
        self.createGlobalsNode()
        parentForm = pm.setParent(query = True)
        pm.setUITemplate("attributeEditorTemplate", pushTemplate = True)
        scLo = self.rendererName + "ScrollLayout"

        if self.rendererTabUiDict.has_key('common'):
            self.rendererTabUiDict.pop('common')
        
        parentForm = pm.setParent(query = True)
        uiDict = {}
        self.rendererTabUiDict['common'] = uiDict
        
        with pm.scrollLayout(scLo, horizontalScrollBarThickness = 0):
            with pm.columnLayout(self.rendererName + "ColumnLayout", adjustableColumn = True, width = 400):
                with pm.frameLayout(label="Sampling", collapsable = True, collapse=False):                
                    self.addRenderGlobalsUIElement(attName = 'sampleJitter', uiType = 'float', displayName = 'SampleJitter', default='1.0', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'sample_time_range_min', uiType = 'float', displayName = 'Sample Time Range Min', default='0.0', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'sample_time_range_max', uiType = 'float', displayName = 'Sample Time Range Max', default='1.0', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'samplesX', uiType = 'int', displayName = 'Pixel Samples x', default=3, uiDict=uiDict)
                    self.addRenderGlobalsUIElement(attName = 'samplesY', uiType = 'int', displayName = 'Pixel Samples y', default=3, uiDict=uiDict)
                    pm.separator()
                    self.addRenderGlobalsUIElement(attName = 'cast_shadow', uiType = 'bool', displayName = 'Cast Shadows', default='true', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'max_reflect_depth', uiType = 'int', displayName = 'Max Reflection Depth', default='3', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'max_refract_depth', uiType = 'int', displayName = 'Max Refraction Depth', default='3', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'raymarch_step', uiType = 'float', displayName = 'Raymarching Stepsize', default='0.05', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'raymarch_shadow_step', uiType = 'float', displayName = 'Raymarching Shadow Stepsize', default='0.1', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'raymarch_reflect_ste', uiType = 'float', displayName = 'Raymarching Reflection Stepsize', default='0.1', uiDict=uiDict)                    
                    self.addRenderGlobalsUIElement(attName = 'raymarch_refract_ste', uiType = 'float', displayName = 'Raymarching Refraction Stepsize', default='0.1', uiDict=uiDict)                                        
                    pm.separator()
                    self.addRenderGlobalsUIElement(attName = 'doMotionBlur', uiType = 'bool', displayName = 'Motionblur:', default=False, uiDict=uiDict)
                    self.addRenderGlobalsUIElement(attName = 'doDof', uiType = 'bool', displayName = 'Depth of Field:', default=False, uiDict=uiDict)
                    
                with pm.frameLayout(label="Output", collapsable = True, collapse=False):
                    attr = pm.Attribute(self.renderGlobalsNodeName + ".imageFormat")
                    ui = pm.attrEnumOptionMenuGrp(label = "Image Format", at=self.renderGlobalsNodeName + ".imageFormat", ei = self.getEnumList(attr)) 
                    
                with pm.frameLayout(label="Filtering", collapsable = True, collapse=False):
                    attr = pm.Attribute(self.renderGlobalsNodeName + ".filtertype")
                    ui = pm.attrEnumOptionMenuGrp(label = "Filter Type", at=self.renderGlobalsNodeName + ".filtertype", ei = self.getEnumList(attr)) 
                    ui = pm.intFieldGrp(label="Filter Size:", numberOfFields = 1)
                    pm.connectControl(ui, self.renderGlobalsNodeName + ".filtersize", index = 2 )

                with pm.frameLayout(label="Renderer", collapsable = True, collapse=False):
                    self.addRenderGlobalsUIElement(attName = 'use_max_thread', uiType = 'bool', displayName = 'Use Max Threads', default='true', uiDict=uiDict)
                    self.addRenderGlobalsUIElement(attName = 'threads', uiType = 'int', displayName = 'Threads', default=8, uiDict=uiDict)
                    self.addRenderGlobalsUIElement(attName = 'tilesize', uiType = 'int', displayName = 'Tile Size', default=64, uiDict=uiDict)
                    ui = pm.intFieldGrp(label="Verbosity:", numberOfFields = 1)
                    pm.connectControl(ui, self.renderGlobalsNodeName + ".rendererVerbosity", index = 2 )
                    
                    
        pm.setUITemplate("attributeEditorTemplate", popTemplate = True)
        pm.formLayout(parentForm, edit = True, attachForm = [ (scLo, "top", 0), (scLo, "bottom", 0), (scLo, "left", 0), (scLo, "right", 0) ])
        self.FujiRendererUpdateTab()
Ejemplo n.º 42
0
    def initializeParticleTab(self, tabHeight, tabWidth):
        tab = 'particle'
        columnWidth = 100
        moduleSpecific_scrollHeight = 120
        scrollHeight = tabHeight - moduleSpecific_scrollHeight - 20

        self.UIElements["%smainCol" % tab] = pm.columnLayout("%smainCol" % tab)
        pm.rowColumnLayout("%sCreationCol" % tab,
                           numberOfColumns=3,
                           ro=[(1, "both", 2), (2, "both", 2), (3, "both", 2)],
                           columnAttach=[(1, "both", 3), (2, "both", 3),
                                         (3, "both", 3)],
                           columnWidth=[(1, columnWidth), (2, columnWidth),
                                        (3, columnWidth)])

        # 1. particle creation
        pm.button(label="tempExport",
                  command=lambda a: mo_fileSystemUtils.tempExportSelected(
                      path=tempExportDir))
        pm.button(label="tempImport",
                  command=lambda a: mo_fileSystemUtils.tempImport(
                      path=tempExportDir))
        pm.button(label="tempExportUI",
                  command=lambda a: mo_fileSystemUtils.tempExportSelected(
                      path=tempExportDir))

        pm.button(label="create Passive",
                  command=lambda a: mo_dynamicUtils.createPassiveCollider()())
        pm.button(label="create volumeCrv",
                  command=lambda a: mo_dynamicUtils.createVolumeCrv())
        pm.button(label="create volumeCrv",
                  command=lambda a: mo_dynamicUtils.createVolumeCrv())

        pm.setParent(self.UIElements["%smainCol" % tab])
        pm.separator()
        pm.rowColumnLayout("%sEditCol" % tab,
                           numberOfColumns=3,
                           ro=[(1, "both", 2), (2, "both", 2), (3, "both", 2)],
                           columnAttach=[(1, "both", 3), (2, "both", 3),
                                         (3, "both", 3)],
                           columnWidth=[(1, columnWidth), (2, columnWidth),
                                        (3, columnWidth)])

        # 2. particle edit
        pm.button(
            label="connectVisibility",
            command=lambda a: mo_dynamicUtils.connectVisibilityToIsDynamic()())
        pm.button(label="transferAttr",
                  command=lambda a: mo_dynamicUtils.transferAttrs(
                      pm.selected()[0],
                      pm.selected()[1:]))
        pm.button(label="---")

        pm.setParent(self.UIElements["%smainCol" % tab])
        return self.UIElements["%smainCol" % tab]
Ejemplo n.º 43
0
def multi_SpotLightSettings():
	# Spot Light Settings
	pm.rowColumnLayout(nc=2)
	pm.text(l='Spot Light Settings', w=102, al='left', en=False)
	pm.separator(w=marginWidth-102, h=14)
	pm.setParent(multiLight_layout)

	multi_coneAngle = pm.floatSliderGrp('hp3dConeAngleSlider', label='Cone Angle', field=True, min=0.0057, max=179.9943, v=40.000, pre=3, cw=[3, 20], dc=fun.partial(multi_floatChange, '.coneAngle', 'spotLight', 'hp3dConeAngleSlider'))
	multi_penumbraAngle = pm.floatSliderGrp('hp3dPenumbraAngleSlider', label='Penumbra Angle', field=True, min=-10.000, max=10.000, v=0.000, pre=3, cw=[3, 20], dc=fun.partial(multi_floatChange, '.penumbraAngle', 'spotLight', 'hp3dPenumbraAngleSlider'))
	multi_dropoff = pm.floatSliderGrp('hp3dDropoffSlider', label='Dropoff', field=True, min=0, max=255.000, v=0.000, pre=3, cw=[3, 20], dc=fun.partial(multi_floatChange, '.dropoff', 'spotLight', 'hp3dDropoffSlider'))
	pm.setParent(multiLight_layout)
Ejemplo n.º 44
0
 def create(self, stationary_count, offset_count):
     '''
     Create the fgshooter window.
     '''
     if pm.window(self.window_name, exists=True):
         pm.deleteUI(self.window_name)
     pm.window(self.window_name, title=self.window_title)
     
     main_form = pm.formLayout(numberOfDivisions=2)
     self.column = pm.columnLayout(adjustableColumn=True)
     
     # Render Camera
     self.render_camera_field = pm.checkBoxGrp(label="Include Render Camera", value1=self.render_camera, changeCommand=self.updateRenderCamera)
     
     # Stationary Cameras
     pm.separator(height=20, style="in")
     
     pm.rowLayout(numberOfColumns=3, columnWidth3=(140, 80, 80), columnAlign=(1, 'right'), columnAttach3=("right", "both", "both"))
     pm.text("Stationary Cameras")
     self.stationary_field = pm.intField(value=stationary_count)
     pm.button(label="Update", height=22, command=self.update)
     pm.setParent('..')
     
     self.stationary = []
     i = 0
     while i < stationary_count:
         self.stationary.append(pm.floatFieldGrp(value1=self.stationary_frames[i], label="frame"))
         i += 1
     
     # Offset Cameras
     pm.separator(height=20, style="in")
     
     pm.rowLayout(numberOfColumns=3, columnWidth3=(140, 80, 80), columnAlign=(1, 'right'), columnAttach3=("right", "both", "both"))
     pm.text("Offset Cameras")
     self.offset_field = pm.intField(value=offset_count)
     pm.button(label="Update", height=22, command=self.update)
     pm.setParent('..')
     
     self.offset = []
     i = 0
     while i < offset_count:
         self.offset.append(pm.intFieldGrp(value1=self.offset_frames[i], label="frame offset"))
         i += 1
     
     pm.setParent('..')
     
     # remove/apply buttons        
     self.remove_button = pm.button(label="Remove All", height=30, command=self.remove)
     self.apply_button = pm.button(label="Apply / Refresh", height=30, command=self.apply)
     
     pm.formLayout(main_form, edit=True, attachForm=[(self.column, "top", 2),(self.column, "left", 2),(self.column, "right", 2), (self.remove_button, "bottom", 2), (self.remove_button, "left", 2), (self.apply_button, "bottom", 2), (self.apply_button, "right", 2)], attachControl=(self.remove_button, "right", 1, self.apply_button), attachPosition=[ (self.remove_button, "right", 0, 1), (self.apply_button, "left", 1, 1)] )
     
     pm.setParent('..')
     pm.showWindow()
Ejemplo n.º 45
0
    def __init__(self, opts):
        self.opts = opts
        with pm.frameLayout('Export Meshes (.FBX)',
                            collapsable=True,
                            cl=False,
                            bs='out'):
            with pm.columnLayout(width=250):
                pm.text(l='Export List:')
                pm.separator(height=4)
                self.meshList = pm.textScrollList(height=250,
                                                  width=250,
                                                  ams=True,
                                                  dkc=self._remove)
                with pm.rowColumnLayout(nc=3, cw=[(1, 82), (2, 82), (3, 82)]):
                    pm.button(l='Add', c=self._add)
                    pm.button(l='Remove', c=self._remove)
                    pm.button(l='Clear', c=self._clear)

                with pm.rowColumnLayout(nc=2, cw=[(1, 124), (2, 124)]):
                    self.prefix = pm.checkBox(label='Prefix',
                                              value=self.opts['prefix'],
                                              cc=self.save)
                    self.suffix = pm.checkBox(label='Suffix',
                                              value=self.opts['suffix'],
                                              cc=self.save)
                    self.prefix_text = pm.textField(
                        en=self.prefix.getValue(),
                        text=self.opts['prefix_text'],
                        cc=self.save)
                    self.suffix_text = pm.textField(
                        en=self.suffix.getValue(),
                        text=self.opts['suffix_text'],
                        cc=self.save)

                pm.text(l='Export Path:')
                with pm.rowColumnLayout(nc=2, cw=[(1, 215), (2, 32)]):
                    self.fbxPath = pm.textField(text=self.opts['fbxPath'],
                                                cc=self._pathRefreash)
                    pm.button(l='...', c=self._path)

                with pm.rowColumnLayout(nc=3):
                    self.center = pm.checkBox(label='Move to Orgin',
                                              v=self.opts['center'],
                                              cc=self.save)
                    self.child = pm.checkBox(label='Export Childern',
                                             v=self.opts['child'],
                                             cc=self.save)
                    pm.button(l='FBXPreset', c=self._fbxPreset)

                with pm.rowColumnLayout(nc=2, cw=[(1, 124), (2, 124)]):
                    pm.button(l='Selected', c=self._selected)
                    pm.button(l='All', c=self._all)

        self._refresh()
Ejemplo n.º 46
0
def multi_ShadowSettings():
	# Shadow Settings
	pm.rowColumnLayout(nc=2)
	pm.text(l='Shadow Settings', w=90, al='left', en=False)
	pm.separator(w=marginWidth-90, h=14)
	pm.setParent(multiLight_layout)

	multi_lightRadius = pm.floatSliderGrp('hp3dLightRadiusSlider', label='Light Radius', field=True, max=10.000, v=1.000, pre=3, cw=[3, 20], dc=fun.partial(multi_floatChange, '.lightRadius', 'spot & point', 'hp3dLightRadiusSlider'))
	multi_lightAngle = pm.floatSliderGrp('hp3dLightAngleSlider', label='Light Angle', field=True, max=10.000, v=1.000, pre=3, cw=[3, 20], dc=fun.partial(multi_floatChange, '.lightAngle', 'directionalLight', 'hp3dLightAngleSlider'))
	multi_shadowRays = pm.intSliderGrp('hp3dShadowRaysSlider', label='Shadow Rays', field=True, max=64, v=1, cw=[3, 20], dc=fun.partial(multi_intChange, '.shadowRays', 'all', 'hp3dShadowRaysSlider'))
	multi_rayDepth = pm.intSliderGrp('hp3dRayDepthSlider', label='Ray Depth Limit', field=True, max=15, v=3, cw=[3, 20], dc=fun.partial(multi_intChange, '.rayDepthLimit', 'all', 'hp3dRayDepthSlider'))
	pm.setParent(multiLight_layout)
Ejemplo n.º 47
0
 def window(self):
     win = pm.window(title='Frustum Selection',
                     width=400,
                     s=True,
                     resizeToFitChildren=True)
     pm.columnLayout(adj=True)
     radio = pm.radioButtonGrp(nrb=3,
                               l1='Use Time Slider',
                               l2='Start/End',
                               l3='Current Time',
                               sl=1)
     frameRange = pm.intFieldGrp(nf=2,
                                 l='Frame Range: Start',
                                 cw1=100,
                                 v1=1001,
                                 el='End',
                                 v2=1100,
                                 en=False)
     radio.onCommand2(pm.Callback(frameRange.setEnable, True))
     radio.offCommand2(pm.Callback(frameRange.setEnable, False))
     screen_size = pm.intFieldGrp(nf=2,
                                  l='Screen Size',
                                  cw1=100,
                                  v1=2048,
                                  el='Height',
                                  v2=858)
     offset = pm.floatFieldGrp(nf=1,
                               l='Selection Offset',
                               cw1=100,
                               el='%',
                               v1=0)
     invert = pm.checkBoxGrp(ncb=1, l='Invert Selection', cw1=100, v1=0)
     auto = pm.checkBoxGrp(ncb=1, l='Auto Get Camera', cw1=100, v1=1)
     pm.text(
         label=
         'Help: it is possible to select multiple cameras.\nfilmTranslate attribute on camera is NOT in effect on selecting, use filmOffset instead.\nPositive offset shrink selection while negative expanding.',
         align='left',
         fn='boldLabelFont',
         recomputeSize=True,
         wordWrap=True)
     #autoFunc, widthFunc, heightFunc, modeFunc, offsetFunc, invertFunc, startFunc, endFunc):
     pm.button(l='Select',
               command=pm.Callback(self.getObjectInFrustumShell,
                                   auto.getValue1, screen_size.getValue1,
                                   screen_size.getValue2, radio.getSelect,
                                   offset.getValue1, invert.getValue1,
                                   frameRange.getValue1,
                                   frameRange.getValue2))
     pm.button(l='Tag', command=pm.Callback(self.tagMasters))
     pm.button(l='Delete All Tags', command=pm.Callback(self.deleteAllTags))
     pm.separator(style='in', h=10)
     pm.button(label='Close', command=pm.Callback(pm.deleteUI, win.name()))
     pm.showWindow(win.name())
Ejemplo n.º 48
0
    def bug_report_window(self):
        ''' '''
        windowName = 'bugWindow'

        w = 400
        h = 330

        if pm.control(windowName, exists=True):
            pm.deleteUI(windowName)

        bug_window = pm.window(windowName, t="Bug Report / Contact", widthHeight=[w, h], rtf=False, mnb=False,
                               mxb=False, s=False, toolbox=True)

        pm.columnLayout(w=w, cw=w, cal='center')
        wM = (w - 30)
        pm.rowColumnLayout(nc=3, cw=([1, 15], [2, wM], [3, 15]))
        pm.text(l='', w=15)

        pm.columnLayout(w=wM, cw=wM, cal='center')

        pm.text(l='Message or Bug:', w=wM, h=30, al='left', font='boldLabelFont')
        message_text = pm.scrollField(w=wM, wordWrap=True)

        pm.text(l='Email Address (Optional, if you want a reply):', w=wM, h=30, al='left', font='boldLabelFont')
        email_address = pm.textField(w=wM)

        pm.setParent('..')

        pm.text(l='', w=15)

        pm.setParent('..')

        pm.separator(style='none', h=12, w=wM)

        cwA = 10
        cwB = (w / 2) - (1.5 * cwA)
        pm.rowColumnLayout(nc=5, cw=([1, cwA], [2, cwB], [3, cwA], [4, cwB], [5, cwA]))
        pm.text(l='', w=cwA)
        pm.button('bug_send', l='Send', w=cwB, h=25, command=lambda *args: self.bug_report_send(windowName,
                                                                                                pm.textField(
                                                                                                    email_address,
                                                                                                    query=True,
                                                                                                    text=True),
                                                                                                pm.scrollField(
                                                                                                    message_text,
                                                                                                    query=True,
                                                                                                    text=True)))
        pm.text(l='', w=cwA)
        pm.button('bug_cancel', l='Cancel', w=cwB, h=25, command=lambda *args: pm.deleteUI(windowName))
        pm.text(l='', w=cwA)

        bug_window.show()
        pm.window(bug_window, edit=True, h=h, w=(w + 2))
Ejemplo n.º 49
0
 def create(self):
     
     
      # this creates the actual GUI components
      #** returns the last component (the separator) so that the next group can be attached to it
     
     if self.control == '':
         # radioButtonGrp
         self.row01 = pm.radioButtonGrp( numberOfRadioButtons = 3, label = '%s' % self.name, labelArray3=['A+ -A', 'B+ -B', 'C+ -C'], onCommand = pm.Callback(self.radioCommand))
         self.row02 = pm.radioButtonGrp(  numberOfRadioButtons = 2, shareCollection = self.row01, label='', labelArray2=['D', 'F'], onCommand = pm.Callback(self.radioCommand))
         pm.formLayout( self.layout , edit=1, attachForm=[[self.row01, "top", 5], [self.row01, "left", 5]])
         pm.formLayout( self.layout , edit=1, attachForm=[self.row02, "left", 5, ], attachControl=[self.row02, "top", 5, self.row01])
         
         
         # intField for Grade
         self.intField = pm.intFieldGrp( numberOfFields = 1, label = 'Grade', changeCommand = pm.Callback(self.totalCommand), backgroundColor = [1,0,0])
         self.comments = pm.text( label = 'comments')
         
         # comment scrollField
         #scrollField = self.scrollField.create()
         self.separator = pm.separator( height=15, width=460, style='in' )
         
         # arranging components
         pm.formLayout( self.layout , edit=1, attachForm=[self.intField, "top", 5], attachControl=[self.intField, "top", 10, self.row02])
         pm.formLayout( self.layout , edit=1, attachForm=[self.scrollField, "left", 140], attachControl=[self.scrollField, "top", 10, self.intField])
         pm.formLayout( self.layout , edit=1, attachForm=[self.comments, "left", 60], attachControl=[self.comments, "top", 10, self.intField])
         pm.formLayout( self.layout , edit=1, attachForm=[self.separator, "left", 60], attachControl=[self.separator, "top", 10, self.scrollField])
     
         return self.separator
     
     else:
         # radioButtonGrp
         self.row01 = pm.radioButtonGrp( numberOfRadioButtons = 3, label = '%s' % self.name, labelArray3=['A+ -A', 'B+ -B', 'C+ -C'], onCommand = pm.Callback(self.radioCommand))
         self.row02 = pm.radioButtonGrp(  numberOfRadioButtons = 2, shareCollection = self.row01, label='', labelArray2=['D', 'F'], onCommand = pm.Callback(self.radioCommand))
         pm.formLayout( self.layout , edit=1, attachForm=[[self.row01, "top", 5], [self.row01, "left", 5]] , attachControl=[self.row01, "top", 5, self.control])
         pm.formLayout( self.layout , edit=1, attachForm=[self.row02, "left", 5, ], attachControl=[self.row02, "top", 5, self.row01])
         
         # intField for Grade
         self.intField = pm.intFieldGrp( numberOfFields = 1, label = 'Grade', cc = pm.Callback(self.totalCommand)
                                        , backgroundColor = [1,0,0])
         self.comments = pm.text( label = 'comments')
         
         # comment scrollField
         #scrollField = self.scrollField.create()
         self.separator = pm.separator( height=15, width=460, style='in' )
         
         # arranging components
         pm.formLayout( self.layout , edit=1, attachForm=[self.intField, "top", 5], attachControl=[self.intField, "top", 10, self.row02])
         pm.formLayout( self.layout , edit=1, attachForm=[self.scrollField, "left", 140], attachControl=[self.scrollField, "top", 10, self.intField])
         pm.formLayout( self.layout , edit=1, attachForm=[self.comments, "left", 60], attachControl=[self.comments, "top", 10, self.intField])
         pm.formLayout( self.layout , edit=1, attachForm=[self.separator, "left", 60], attachControl=[self.separator, "top", 10, self.scrollField])
     
         return self.separator
Ejemplo n.º 50
0
 def build(self):
     '''builds ui objects for tab'''
     self.widgets['mainRow'] = pm.rowLayout(parent = self.parent.widgets['scrollLayout'], numberOfColumns = 6, h = 50, adjustableColumn = 3, bgc = self.bgc)
     self.widgets['frontSpacer'] = pm.separator(style = 'none', w = 12)
     self.widgets['renderable'] = pm.checkBox(parent = self.widgets['mainRow'], value = self.layer.renderable.get(), w = 50, label = "", cc = pm.Callback(self.updateRenderable))
     self.widgets['cameraName'] = pm.text(parent = self.widgets['mainRow'], label = self.camera.getParent().stripNamespace(), w = 140)
     self.widgets['layerName'] = pm.iconTextButton(parent = self.widgets['mainRow'], label = self.layer.name(), w = 220, style = 'textOnly', c = pm.Callback(self.layer.setCurrent), dcc = pm.Callback(self.updateLayerName))
     self.widgets['frameRange'] = pm.textFieldGrp(parent = self.widgets['mainRow'], text = '%d - %d' % (self.parent.startFrame, self.parent.endFrame))
     self.widgets['backSpacer'] = pm.separator(style = 'none', w = 1)
     
     if not self.layer.renderable.get():
         self.updateRenderable()
 def find_save_path(self):
     multiple_filters = "Maya Files (*.ma *.mb);;Maya ASCII (*.ma);;Maya Binary (*.mb);;All Files (*.*)"
     try:
         self.save_path = pm.fileDialog2(
             fileFilter=multiple_filters,
             dialogStyle=1,
             fileMode=3,
             startingDirectory='//medusa/cyberwitch/assets')[0]
     except TypeError:
         self.save_path = '//medusa/cyberwitch/assets'
     pm.textField("FilePathTF", edit=True, text=self.save_path)
     pm.separator(h=5, style='none')
Ejemplo n.º 52
0
 def ShowUI(self):
     self.FindSelectionToGroup()
     
     if len(self.objectsToGroup) == 0:
         return
     
     self.UIElements = {}
     
     if pm.window("groupSelected_UI_window", exists = True):
         pm.deleteUI("groupSelected_UI_window")
     
     
     windowWidth = 300
     windowHeight = 150
     self.UIElements["window"] = pm.window("groupSelected_UI_window", width = windowWidth, height = windowHeight, title = "Group Selected", sizeable = False)
     
     self.UIElements["topLevelColumn"] = pm.columnLayout(adjustableColumn = True, columnAlign = 'center', rowSpacing = 3)
     self.UIElements["groupName_rowColumn"] = pm.rowColumnLayout(numberOfColumns = 2, columnAttach = (1, 'right', 0), columnWidth = [(1, 80), (2, windowWidth - 90)], parent = self.UIElements["topLevelColumn"])
     
     pm.text(label = "Group Name: ", parent = self.UIElements["groupName_rowColumn"])
     self.UIElements["groupName"] = pm.textField(text = "group", parent = self.UIElements["groupName_rowColumn"])
     
     self.UIElements["createAt_rowColumn"] = pm.rowColumnLayout(numberOfColumns = 3, rowOffset = [(1, 'top', 2), (2, 'both', 2), (3, 'both', 2)], columnWidth = [(1, 80), (2, windowWidth - 170), (3, 80)], parent = self.UIElements["topLevelColumn"])
     pm.text(label = "Position at: ", parent = self.UIElements["createAt_rowColumn"])
     pm.text(label = '', parent = self.UIElements["createAt_rowColumn"])
     pm.text(label = '', parent = self.UIElements["createAt_rowColumn"])
     
     pm.text(label = '', parent = self.UIElements["createAt_rowColumn"])
     self.UIElements["createAt_lastSelected"] = pm.button(label = "Last Selected", command = self.CreateAtLastSelected, parent = self.UIElements["createAt_rowColumn"])
     pm.text(label = '', parent = self.UIElements["createAt_rowColumn"])
     
     pm.text(label = '', parent = self.UIElements["createAt_rowColumn"])
     self.UIElements["createAt_averagePosition"] = pm.button(label = "Average Position", command = self.CreateAtAveragePosition, parent = self.UIElements["createAt_rowColumn"])
     pm.text(label = '', parent = self.UIElements["createAt_rowColumn"])
     
     pm.separator(style = 'in', parent = self.UIElements["topLevelColumn"])
     
     
     columnWidth = (windowWidth / 2) - 5
     self.UIElements["button_row"] = pm.rowLayout(numberOfColumns = 2, columnWidth = [(1, columnWidth), (2, columnWidth)], columnAttach = [(1, 'both', 10), (2, 'both', 10)], columnAlign = [(1, 'center'), (2, 'center')], parent = self.UIElements["topLevelColumn"])
     pm.button(label = "Accept", command = self.AcceptWindow, parent = self.UIElements["button_row"])
     pm.button(label = "Cancel", command = self.CancelWindow, parent = self.UIElements["button_row"])
     
     
     pm.showWindow(self.UIElements["window"])
     
     
     self.CreateTemporaryGroupRepresentation()
     
     self.CreateAtAveragePosition()
     
     pm.select(self.tempGroupTransform, replace = True)
     pm.setToolTo("moveSuperContext")
Ejemplo n.º 53
0
    def options_buttons(self, *args):
        pm.separator(style="none", h=10)
        pm.button(label = "Generate Sets", c=self.custom_sets)

        pm.separator(h=15)
                       
        pm.text('ClientAnimCtrl Tag')
        h = pm.horizontalLayout()
        pm.button(label = "Add", c=self.add_control_tag)
        pm.button(label = "Remove", c=self.remove_control_tag)
        h.redistribute()
        pm.setParent("..")
Ejemplo n.º 54
0
def baseUI():
    if pm.window('ATM', exists=1):
        pm.deleteUI('ATM')
    baseWin = pm.window('ATM', t='Attribute manager', w=280, h=100)
    with baseWin:

        mainLayout = pm.columnLayout()
        addLayout = pm.rowColumnLayout(nc=3, parent=mainLayout)
        floatField = pm.textField(tx='mTileUV', w=120, h=25)
        ADFL = pm.button(l='ADD FLOAT', w=80, h=25)
        DLFL = pm.button(l='DEL FLOAT', w=80, h=25)
        stringField = pm.textField(tx='mColor mDisp mMat', w=120, h=25)
        ADST = pm.button(l='ADD STRING', w=80, h=25)
        DLST = pm.button(l='DEL STRING', w=80, h=25)
        colorField = pm.textField(tx='mMask_A', w=120, h=25)
        ADCL = pm.button(l='ADD COLOR', w=80, h=25)
        DLCL = pm.button(l='DEL COLOR', w=80, h=25)

        allLayout = pm.rowColumnLayout(nc=2, parent=mainLayout)
        ADALL = pm.button(l='ADD ALL', w=140, h=35)
        DLALL = pm.button(l='DELETE ALL', w=140, h=35)
        pm.separator(h=10, style='none')

        setLayout = pm.rowColumnLayout(nc=3, parent=mainLayout)
        floatSetField = pm.textField(tx='mTileUV', w=60, h=25)
        floatValField = pm.textField(tx='256', w=150, h=25)
        SETFL = pm.button(l='SET FLOAT', w=70, h=25)
        stringSetField = pm.textField(tx='mMat', w=60, h=25)
        stringValField = pm.textField(tx='GEN_BASE_A', w=150, h=25)
        SETST = pm.button(l='SET STRING', w=70, h=25)
        colorSetField = pm.textField(tx='mMask_A', w=60, h=25)
        colorValField = pm.textField(tx='R', w=150, h=25)
        SETCL = pm.button(l='SET COLOR', w=70, h=25)

        ADFL.setCommand(pm.Callback(addFloatAttr, floatField))
        DLFL.setCommand(pm.Callback(delFloatAttr, floatField))
        ADST.setCommand(pm.Callback(addStringAttr, stringField))
        DLST.setCommand(pm.Callback(delStringAttr, stringField))
        ADCL.setCommand(pm.Callback(addColorAttr, colorField))
        DLCL.setCommand(pm.Callback(delColorAttr, colorField))
        ADALL.setCommand(
            pm.Callback(addAll, floatField, stringField, colorField))
        DLALL.setCommand(
            pm.Callback(delAll, floatField, stringField, colorField))

        SETFL.setCommand(
            pm.Callback(setAttrFloat, floatSetField, floatValField))
        SETST.setCommand(
            pm.Callback(setAttrString, stringSetField, stringValField))
        SETCL.setCommand(
            pm.Callback(setAttrColor, colorSetField, colorValField))
        baseWin.show()
Ejemplo n.º 55
0
 def createProjectSelect(self, parent):
     self.parentWidget = parent
     self.widgetName = pm.textFieldButtonGrp(
         'projectSel',
         p=self.parentWidget,
         label='ProjectName',
         text='projeto',
         cat=[[1, 'left', 5], [2, 'left', -50]],
         adj=2,
         bl='...',
         bc=self.projectSettingsCallback)
     pm.separator(height=40, style='in')
     self.makePopup()
Ejemplo n.º 56
0
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()
Ejemplo n.º 57
0
    def createMethodInstance(self, i ):

        #setUITemplate('attributeEditorTemplate', pushTemplate=1)

        rowSpacing = [30, 20, 400]

        defs = []
        #try:
        argUtil = factories.ApiArgUtil( self.apiClassName, self.apiMethodName, i )
        proto = argUtil.getPrototype( className=False, outputs=True, defaults=False )

        enable = argUtil.canBeWrapped()

        if argUtil.isDeprecated():
            pm.text(l='DEPRECATED')
        # main info row
        row = pm.rowLayout( '%s_rowMain%s' % (self.methodName,i), nc=3, cw3=rowSpacing, enable=enable )
        self.rows.append(row)
        pm.text(label='')

        if self.overloadPrecedenceColl is not None:
            # toggle for overloaded methods
            pm.radioButton(label='', collection=self.overloadPrecedenceColl,
                                enable = enable,
                                onCommand=pm.Callback( MethodRow.overloadPrecedenceCB, self, i ))
        pm.text(   l='', #l=proto,
                annotation = self.methodInfoList[i]['doc'],
                enable = enable)

        pm.setParent('..')

        try:
            argList = factories.apiClassOverrides[self.apiClassName]['methods'][self.apiMethodName][i]['args']
        except (KeyError, IndexError):
            argList = self.methodInfoList[i]['args']

        returnType =  self.methodInfoList[i]['returnType']
        types = self.methodInfoList[i]['types']
        args = []

        for arg , type, direction in argList:
            type = str(types[arg])
            assert arg != 'return'
            self._makeArgRow( i, type, arg, direction, self.methodInfoList[i]['argInfo'][arg]['doc'] )

        if returnType:
            self._makeArgRow( i, returnType, 'return', 'return', self.methodInfoList[i]['returnInfo']['doc'] )

        pm.separator(w=800, h=14)

        return enable
Ejemplo n.º 58
0
def rope_UI(*args):
    """
    Rope tool UI
    """

    if pm.window("mGear_rope_window", exists = True):
        pm.deleteUI("mGear_rope_window")

    window = pm.window("mGear_rope_window", title="mGear rope rig generator", w=350, h=150, mxb=False, sizeable=False)

    pm.rowColumnLayout( numberOfColumns=2, columnAttach=(1, 'right', 0), columnWidth=[(1, 100), (2, 250)] )


    pm.text("Nb of deformers: ")
    nbDeformers = pm.intField( "nbDeformers", annotation="number of deformers", w=50, value= 10)
    pm.text(label="Keep position " )
    pm.checkBox("keepRatio", label=" (base on ratio) ")
    pm.text(label="Name: " )
    RopeName = pm.textField("RopeName", text="Rope")

    pm.separator(h=10)
    pm.button(label="Build the rope!", w=150, h=50,  command=build_rope)
    pm.separator(h=10)
    pm.separator(h=10)
    pm.separator(h=10)
    pm.text(label="Instructions:  Select ctl crv + upv crv", align="left" )

    pm.showWindow(window)