예제 #1
0
def ui() :
	global FFU_E_SETTINGS, FFU_E_WINDOW 
	init()

	WINDOW_NAME = 'w_ff_utils_export'
	if( pm.window( WINDOW_NAME, q=True, exists=True ) ) :
		pm.deleteUI( WINDOW_NAME )

	FFU_E_WINDOW = pm.window( WINDOW_NAME, title='Export to Fiction Factory', sizeable=True )
	vl = pm.verticalLayout()
	hl = pm.horizontalLayout( parent=vl )
	
	l1 = pm.frameLayout( parent=hl, label="Scene options" )
	for setting in FFU_E_SETTINGS :
		uiobject = __create_uiobject_from_setting( setting )

	l2 = pm.frameLayout( parent=hl, label="FFEXport options" )
	for setting in FFU_E_FFEXPORT_SETTINGS :
		uiobject = __create_uiobject_from_setting( setting ) 

	pm.button(
		label='Export!',
		parent=vl,
		command=lambda *args : ui_do_export()
	)

	FFU_E_WINDOW.setHeight(600)
	FFU_E_WINDOW.setWidth(200)
	hl.redistribute( 2.5, 1 )
	vl.redistribute( 5, 1 )	
	FFU_E_WINDOW.show()
    def __init__(self, parentRef):
        self.parentRef = parentRef
        self.win = pm.window(title="Joint Orientation", width=250, height=180)
        self.col = pm.columnLayout()
        self.row1 = pm.rowColumnLayout(width=200, numberOfColumns=2)
        self.rotateXText = pm.text(label="X rotate:", parent=self.row1)
        self.rotateXField = pm.intField(parent=self.row1)
        self.rotateYText = pm.text(label="Y rotate:", parent=self.row1)
        self.rotateYField = pm.intField(parent=self.row1)
        self.rotateZText = pm.text(label="Z rotate:", parent=self.row1)
        self.rotateZField = pm.intField(parent=self.row1)
        self.button = pm.button(
            label="Rotate Joints",
            width=200,
            command=lambda x: parentRef.rotateJoint(
                self.rotateXField.getValue(), self.rotateYField.getValue(),
                self.rotateZField.getValue()),
            parent=self.col)
        self.button = pm.button(label="Rotate Joints Relative",
                                width=200,
                                command=lambda x: parentRef.rotateJoint(
                                    self.rotateXField.getValue(),
                                    self.rotateYField.getValue(),
                                    self.rotateZField.getValue(),
                                    rotateRelative=True),
                                parent=self.col)

        self.win.show()
        self.win.setWidth(260)
        self.win.setHeight(210)
        
    def initUi(self):
        win = self.win = pm.window("Mmmm Mel To Python Converter")
        with win:
          col = self.col = pm.columnLayout(adjustableColumn=True)
          with col:
          
            labelMel = self.labelMel = pm.text("Mel:")              
            tf01 = self.tf01 = pm.scrollField( wordWrap=True )
            btnRunMel = self.btnRunMel = pm.button("Run Mel",
              command= lambda x:  pm.mel.eval( self.tf01.getText()  )
            )            
            labelSpacer01 = self.labelSpacer01 = pm.text("\n")
            
            
            labelPython = self.labelPython = pm.text("Python:")
            tf02 = self.tf02 = pm.scrollField( editable=False,  wordWrap=True  )
            btnRunPython = self.btnRunMel = pm.button("Run Python",
              command= lambda x:  self.execPython( codeStr=self.tf02.getText() )
            )             
            labelSpacer02 = self.labelSpacer02 = pm.text("\n")
              

            btnConvert = self.btnConvert = pm.button("Convert Mel To Python",
              command= lambda x:
                  self.tf02.setText(
                      self.convertFunc( self.tf01.getText()  )
                  )
            )

            
 def __init__(self, parent):
   self.parent = parent
   self.win = pm.window('Attribute Setter', resizeToFitChildren=True)
   with self.win:
     self.col = pm.columnLayout()
     with self.col:
       self.helpButton = pm.button(
         label="Show Help",
         command=lambda x: self.showHelp(),
       )      
       ## Text label that says "Attribute to change:"
       self.attributeLabel = pm.text( 'Attribute to change:' )
       ## Text entry field, a place where the user will type in the attribute to change
       self.attributeField = pm.textField(  width=600   )
       ## Text label that says "New value for attribute:"
       self.valueLabel = pm.text( 'New value for attribute:' )
       ## Text entry field, a place where the user will type the new value to set the attribute to
       self.valueField = pm.textField(   width=600  )
       
       self.go = pm.button(
         label="Set Attributes",
         command=lambda x: self.parent.setAttributes(
           attribute=self.attributeField.getText(),
           value=self.valueField.getText(),
         )
       ) 
예제 #5
0
    def __init__(self, parentRef=None, mmmmToolsRef=None):
        self.mmmmTools = mmmmToolsRef
        self.parentRef = parentRef

        self.scriptFileRunner = MmmmScriptFileRunner(
            parentRef=self, mmmmToolsRef=self.mmmmTools)
        self.scriptFileRunner.findScripts()
        self.win = pm.window("Script File Runner")

        self.ddMenuEntires = []

        with self.win:
            self.col = pm.columnLayout()
            with self.col:
                self.textPath = pm.text("Path to scripts:")
                self.textFieldPath = pm.textField(
                    text=self.scriptFileRunner.searchPath,
                    width=400,
                    changeCommand=lambda x: self.onTextPathChangeCommand())
                self.btnRefresh = pm.button("Refresh Scripts",
                                            command=lambda x: self.buildMenu())

                self.text = pm.text("Script File To Run:")
                self.ddMenu = pm.optionMenu(changeCommand=self.onDdMenuChange)
                self.buildMenu()
                ## self.textFieldScript = pm.textField( width=500 )
                self.btnRunScript = pm.button(
                    "Run Script",
                    command=lambda x: self.scriptFileRunner.runScript(
                        self.chosenScript))
        self.win.show()
    def initUi(self):
        win = self.win = pm.window("Mmmm Mel To Python Converter")
        with win:
            col = self.col = pm.columnLayout(adjustableColumn=True)
            with col:

                labelMel = self.labelMel = pm.text("Mel:")
                tf01 = self.tf01 = pm.scrollField(wordWrap=True)
                btnRunMel = self.btnRunMel = pm.button(
                    "Run Mel",
                    command=lambda x: pm.mel.eval(self.tf01.getText()))
                labelSpacer01 = self.labelSpacer01 = pm.text("\n")

                labelPython = self.labelPython = pm.text("Python:")
                tf02 = self.tf02 = pm.scrollField(editable=False,
                                                  wordWrap=True)
                btnRunPython = self.btnRunMel = pm.button(
                    "Run Python",
                    command=lambda x: self.execPython(codeStr=self.tf02.
                                                      getText()))
                labelSpacer02 = self.labelSpacer02 = pm.text("\n")

                btnConvert = self.btnConvert = pm.button(
                    "Convert Mel To Python",
                    command=lambda x: self.tf02.setText(
                        self.convertFunc(self.tf01.getText())))

        win.show()
def insert_joints_UI():
    WINDOW = 'InsertJoints'
    if pm.window(WINDOW, query=True, exists=True):
        pm.deleteUI(WINDOW)
    pm.window(WINDOW,
              title="Insert Joints",
              iconName='CS',
              widthHeight=(200, 70))
    main_col = pm.columnLayout(adjustableColumn=True)
    pm.separator(height=5, style='none', parent=main_col)
    textip_col = pm.rowColumnLayout(numberOfColumns=2,
                                    parent=main_col,
                                    columnOffset=(1, "left", 5),
                                    columnSpacing=(2, 5))
    pm.separator(height=5, style='none', parent=main_col)
    butn_col = pm.rowColumnLayout(numberOfColumns=3,
                                  parent=main_col,
                                  columnOffset=(2, "left", 65))
    pm.text(label="number of joints", parent=textip_col)
    textip = pm.textField(text="", parent=textip_col)
    pm.text(label="", parent=butn_col)
    pm.button(label="Create",
              parent=butn_col,
              command=lambda x: call_fun(textip.getText()))
    pm.showWindow(WINDOW)
    pm.window(WINDOW, edit=True, widthHeight=(200, 70))
    return None
예제 #8
0
def create( layout ) :
	container = pm.verticalLayout( p=layout )
	top_layout = pm.columnLayout( p=container, adj=True )
	# top_layout = pm.verticalLayout( bgc=(1,0,0), p=container )		
	bottom_layout = pm.scrollLayout( p=container, cr=True )	
	bottom_horiz = pm.horizontalLayout( p=bottom_layout )

	left = pm.frameLayout( label='Old Name', mh=4, mw=4, p=bottom_horiz )
	right = pm.frameLayout( label='New Name', mh=4, mw=4, p=bottom_horiz )		
	list_left = pm.columnLayout( 'th_rename_preview_left', p=left, rs=4 )
	list_right = pm.columnLayout( 'th_rename_preview_right', p=right, rs=4 )
	
	bottom_horiz.redistribute()
	
	# regex
	rename_frame = pm.frameLayout( label='Regex', mh=4, mw=4, p=top_layout )
	rename_layout = pm.columnLayout( p=rename_frame, adj=True, rs=4 )
	
	rename_search = pm.textField( 'th_rename_search', pht='Search', p=rename_layout,
		cc=lambda *args : __update_rename_preview()
	)
	rename_replace = pm.textField( 'th_rename_replace', pht='Replace', p=rename_layout,
		cc=lambda *args : __update_rename_preview()
	)


	rename_prefix = pm.textField( 'th_rename_prefix', pht='Prefix', p=rename_layout,
		cc=lambda *args : __update_rename_preview()
	)
	rename_suffix = pm.textField( 'th_rename_suffix', pht='Suffix', p=rename_layout,
		cc=lambda *args : __update_rename_preview()
	)
	renumber_layout = pm.rowLayout( p=rename_layout, nc=2, adj=True )
	rename_from = pm.textField( 'th_rename_from', pht='Renumber From', p=renumber_layout,
		cc=lambda *args : __update_rename_preview()
	)
	rename_by = pm.textField( 'th_rename_by', pht='Renumber By', p=renumber_layout,
		cc=lambda *args : __update_rename_preview()
	)
	

	pm.button( 
		label='Rename', 
		p=rename_layout,
		c=lambda *args : __rename_from_ui()
	)

	# setup a script job to update preview grids
	pm.scriptJob( 
		p=container,
		e=(		
		'SelectionChanged',
		lambda *args : __populate_preview_grids( list_left, list_right )
	) )

	__populate_preview_grids( list_left, list_right )
	container.redistribute( 1, 3 )
예제 #9
0
def create(layout):
    container = pm.verticalLayout(p=layout)
    top_layout = pm.columnLayout(p=container, adj=True)
    # top_layout = pm.verticalLayout( bgc=(1,0,0), p=container )
    bottom_layout = pm.scrollLayout(p=container, cr=True)
    bottom_horiz = pm.horizontalLayout(p=bottom_layout)

    left = pm.frameLayout(label='Old Name', mh=4, mw=4, p=bottom_horiz)
    right = pm.frameLayout(label='New Name', mh=4, mw=4, p=bottom_horiz)
    list_left = pm.columnLayout('th_rename_preview_left', p=left, rs=4)
    list_right = pm.columnLayout('th_rename_preview_right', p=right, rs=4)

    bottom_horiz.redistribute()

    # regex
    rename_frame = pm.frameLayout(label='Regex', mh=4, mw=4, p=top_layout)
    rename_layout = pm.columnLayout(p=rename_frame, adj=True, rs=4)

    rename_search = pm.textField('th_rename_search',
                                 pht='Search',
                                 p=rename_layout,
                                 cc=lambda *args: __update_rename_preview())
    rename_replace = pm.textField('th_rename_replace',
                                  pht='Replace',
                                  p=rename_layout,
                                  cc=lambda *args: __update_rename_preview())

    rename_prefix = pm.textField('th_rename_prefix',
                                 pht='Prefix',
                                 p=rename_layout,
                                 cc=lambda *args: __update_rename_preview())
    rename_suffix = pm.textField('th_rename_suffix',
                                 pht='Suffix',
                                 p=rename_layout,
                                 cc=lambda *args: __update_rename_preview())
    renumber_layout = pm.rowLayout(p=rename_layout, nc=2, adj=True)
    rename_from = pm.textField('th_rename_from',
                               pht='Renumber From',
                               p=renumber_layout,
                               cc=lambda *args: __update_rename_preview())
    rename_by = pm.textField('th_rename_by',
                             pht='Renumber By',
                             p=renumber_layout,
                             cc=lambda *args: __update_rename_preview())

    pm.button(label='Rename',
              p=rename_layout,
              c=lambda *args: __rename_from_ui())

    # setup a script job to update preview grids
    pm.scriptJob(
        p=container,
        e=('SelectionChanged',
           lambda *args: __populate_preview_grids(list_left, list_right)))

    __populate_preview_grids(list_left, list_right)
    container.redistribute(1, 3)
예제 #10
0
    def _createRObjGUI(self):
        pm.text( label='Geometry' ) 
        pm.attrEnumOptionMenuGrp( l='Type', 
                             at=self.node.name() +
                             '.'+CRRenderObject_Node._geoTypeAttr,
                             ei=self._genEnumsFor(Geometry))

        pm.button(label="Add", w=128,
                c=pm.Callback(self.addChildEnumCB, CRGeometry,
                    self.geo,
                    srcattr=CRRenderObject_Node._geoTypeAttr))
예제 #11
0
    def _createShaderGUI(self):
        pm.text( label='Shader' ) 
        pm.attrEnumOptionMenuGrp( l='Type', 
                             at=self.node.name() +
                             '.'+CRRenderObject_Node._sdrTypeAttr,
                             ei=self._genEnumsFor(Shader))

        pm.button(label="Add", w=128,
                c=pm.Callback(self.addChildEnumCB, CRShader,
                    self.shaders,
                    srcattr=CRRenderObject_Node._sdrTypeAttr))
예제 #12
0
    def _createRObjGUI(self):
        pm.text( label='RenderObject' ) 
        pm.attrEnumOptionMenuGrp( l='Type', 
                             at=self.node.name() +
                             '.'+CRSimulation_Node._robjTypeAttr,
                             ei=self._genEnumsFor(RenderObject))

        pm.button(label="Add", w=128,
                c=pm.Callback(self.addChildEnumCB, CRRenderObject,
                    self.robjs,
                    srcattr=CRSimulation_Node._robjTypeAttr))
예제 #13
0
    def _createDataGUI(self):
        pm.text( label='Data' ) 
        pm.attrEnumOptionMenuGrp( l='Type', 
                             at=self.node.name() +
                             '.'+CRSimulation_Node._dataTypeAttr,
                             ei=(0, DataObject.getTypeName()))

        pm.button(label="Add", w=128,
                c=pm.Callback(self.addChildEnumCB, CRDataObject,
                    self.datasrcs,
                    srcattr=CRSimulation_Node._dataTypeAttr))
예제 #14
0
    def _createScriptGUI(self):
        pm.text( label='Script' ) 

        pm.attrEnumOptionMenuGrp( l='Type', 
                at=self.node.name() +
                '.'+CRObject_Node._scriptTypeAttr,
                ei=(0, Scriptable.getTypeName()),
                en=self.bScript)

        pm.button(label="Add", w=128,
                c=pm.Callback(self.addScriptGUI, prefix='script'), 
                en=self.bScript)
예제 #15
0
    def _createDataSourceGUI(self):
        pm.text( label='Data Source' ) 

        pm.attrEnumOptionMenuGrp( l='Format', 
                             at=self.node.name() +
                             '.'+CRDataObject_Node._dataSrcTypeAttr,
                             ei=self._genEnumsFor(DataSource))

        pm.button(label="Add DataSource", w=128,
                c=pm.Callback(self.addChildEnumCB, CRDataSource,
                    self.datasrcs,
                    srcattr=CRDataObject_Node._dataSrcTypeAttr))
예제 #16
0
    def _genTypeGUI(self, attrname, typ, val):
        if pm.attributeQuery(attrname, node=self.obj.node, h=True): return

        pm.text(l='Attribute')
        if typ == cr_types.url:
            pm.attrControlGrp(attribute=self.obj.node.name()+'.'+attrname)
            pm.button(label="Find", w=128, c=
                    pm.Callback(gui.setAttrFromFileDialog, self.obj.node,
                        attrname))
        else:
            pm.attrControlGrp(attribute=self.obj.node.name()+'.'+attrname)
            pm.button(label="Ignore", w=128, en=False)
예제 #17
0
 def __init__(self, parentRef=None, parentWidget=None):
     self.parentRef = parentRef
     self.buttons = []
     self.layoutsR = []
     self.widgets = {}
     
     if parentWidget==None:
         parentWidget = self.widgets['parentWidget'] = pm.window(
             sizeable = True, title = "Mirrorer", titleBar=True,
             resizeToFitChildren=True,
         )
     else:
         self.widgets['parentWidget'] = parentWidget        
     
     with parentWidget:
         self.layoutC = pm.columnLayout( )
         with self.layoutC:
             row = pm.rowLayout( numberOfColumns=3 )
             self.layoutsR.append( row )
             with row:
                 self.makeStartShapeUi = pm.button ( label = 'Make Starting Shape',
                             command = lambda xc: self.parentRef.makeStartShape(),width = 200 )
             row = pm.rowLayout( numberOfColumns=3 )
             self.layoutsR.append( row )
             with row:
                 self.deleteNegativeSideUi = pm.button ( label = 'Delete Negative Side',
                             command = lambda xc: self.parentRef.deleteNegativeSide(),width = 200 )
             row = pm.rowLayout( numberOfColumns=3 )
             self.layoutsR.append( row )
             with row:
                 self.mirrorSelectionUi = pm.button ( label = 'Mirror As Instance',
                             command = lambda xc: self.parentRef.mirrorSelection(),width = 200 )
                 
             row = pm.rowLayout( numberOfColumns=3 )
             self.layoutsR.append( row )
             with row:    
                 self.mirrorSelectionUi = pm.button ( label = 'Flatten to zero on X axis',
                             command = lambda xc: self.parentRef.flattenToXZero(),width = 200 )
     
     
             row = pm.rowLayout( numberOfColumns=3 )
             self.layoutsR.append( row )
             with row:
                 self.mirrorSelectionUi = pm.button ( label = 'Mirror Geometry (Baked/Frozen)',
                             command = lambda xc: self.parentRef.mirrorGeometry( ),width = 200 )
     
         
     # Show Window
     if type( parentWidget ) == pm.core.windows.window:
         win = parentWidget
         pm.showWindow(win)
         win.setWidth(300)
         win.setHeight(200)        
예제 #18
0
Utils = UtilsMod.Utils

class ScripterEditorUi(object):
    def __init__(self,mmmmToolsRef=None,makeUi=True):
        widthForAll = 900 
        self.mmmmTools = mmmmToolsRef
        self.attrName = 'notes'   ##'mmmmScriptStringAttr'
        self.activeScriptText = ''
        self.scriptModule = None
        self.node = None
        self.codeString = ''
        self.activeScriptLabelStartText = "Actice Script being Edited is:  "
        self.win = pm.window("Scripter - Editor", width=widthForAll)
        initialUuid = str( uuid.uuid4() ).replace('-','_')

        with self.win:
            self.col = pm.columnLayout( width=600 )
            with self.col:
                self.notice = pm.text( '''NOTICE: Script Objects Use Object Notes attributes, which don't exist when blank. \n You may have to add to them manually if you can't use "get from selection".''')
                pm.text( " ")
                pm.text( "Script prefix: (it is recommended this be left as the default)" )
                self.scriptPrefixTextField = pm.textField(
                    text="script__",
                    width=widthForAll,
                )
                pm.text( "Script name: (it is recommended that you use a unique and descriptive name)" )                
                self.scriptNameTextField = pm.textField(
                    text=initialUuid,
                    width=widthForAll,
                )

                self.scriptGetButton = pm.button(
                    label="Make the script, or get the script if it already exists. (Works using the above fields, prefix and name.)",
                    command=lambda x: self.getScriptContents(),
                    width=widthForAll,
                )
                self.getScriptFromSelectionButton = pm.button(
                    label="Get Script From Selection / Make new script if no script on selection \n Autofills above fields when it find a script.",
                    command=lambda x: self.getScriptFromSelection(),
                    width=widthForAll,
                )
                
                pm.text( " " )
                pm.text( "   " )  ## different spaces used to keep unique names
                self.activeScriptText = pm.text( self.activeScriptLabelStartText )
                pm.text( "Script contents: (Editing here will immediately edit the corresponding mmmmScriptStringAttr attribute on the object.)" )
                self.scriptContentsScrollField = pm.scrollField(
                    keyPressCommand = lambda x: self.setScriptContents(),
                    changeCommand = lambda x: self.setScriptContents(),
                    width=widthForAll, height=500,                    
예제 #19
0
    def createNew(self, floating=False):

        if self.mmmm == None:
            self.mmmm = MmmmToolsMod.Dynamic.GetInstance()
        mmmm = self.mmmm
        self.widgets = {}
        self.subs = {}
        ## Create Main Widgets
        win = self.widgets["win"] = pm.window()
        ##
        scroll = self.widgets["scroll"] = pm.scrollLayout(parent=win, horizontalScrollBarThickness=0)
        ## The dock must be created after the window's layout
        dock = self.widgets["dock"] = pm.dockControl(
            "MmmmTools Dock", floating=floating, area="left", content=win, allowedArea=["right", "left"]
        )

        col = self.widgets["col"] = pm.columnLayout(parent=scroll)

        # self.mainFrame = MmmmMainDockableWindowSub( )
        # self.mainFrame
        # self.mainFrame =
        # self.makeMainFrame( parentLayout=col )

        modellerFrame = pm.frameLayout(label="Modeler", collapsable=True, parent=col, marginWidth=10)
        modellerCol = pm.columnLayout(parent=modellerFrame)

        f0 = pm.frameLayout(label="Modeler Actions", marginWidth=10, collapsable=True, parent=modellerCol)
        commander = self.mmmm.commander
        cmdEntries = commander.entries
        prefix = "Modeler/"
        for name, entry in cmdEntries.items():
            if name.startswith(prefix):
                uiLabel = entry.get("uiLabel")
                if uiLabel == None:
                    ## Trim modeler from name
                    uiLabel = name[len(prefix) :]
                pm.button(label=uiLabel, parent=f0, command=commander.commandsMelNames[name])

        f1 = pm.frameLayout(label="Grid Tools", marginWidth=10, collapsable=True, parent=modellerCol)
        mmmm.modeler.runGridTools(makeUi=True, parentWidget=f1)
        f2 = pm.frameLayout(label="Retopo Tools", marginWidth=10, collapsable=True, parent=modellerCol)
        mmmm.modeler.runRetoper(makeUi=True, parentWidget=f2)
        f3 = pm.frameLayout(label="Mirror Tools", marginWidth=10, collapsable=True, parent=modellerCol)
        mmmm.modeler.runMirrorer(makeUi=True, parentWidget=f3)

        pm.windowPref(win, width=500, height=500)
        win.setWidth(500)
        win.setHeight(800)
예제 #20
0
    def makeUi( self ):
        self.win = pm.window(title="Mr Clean")
        self.win.show()
        with self.win:
            self.col = pm.columnLayout()
            with self.col:
                self.win.setWidth( 400 )
                self.win.setHeight( 200 )

                self.precisionText = pm.text(
                "Precision:\n Accuracy of face check, higher is more precise \n" + 
                "but will allow smaller errors.\n" +
                "It's like the opposite of merge distance tolerance." )                                
                self.precision = pm.intField(  )
                self.precision.setValue( 2 )
                
                self.toleranceText = pm.text( "Tolerance" )                                
                self.tolerance = pm.floatField(  )
                self.tolerance.setValue( 0.01 )
                
                
                self.button = pm.button( 
                    "Mostly Safe Cleanup",
                     command = lambda x:    self.mrClean.mostlySafeCleanup(    self.precision.getValue(), self.tolerance.getValue()    )
                )
                
                self.warningText = pm.text(
                    "Beware, backup your model first,\n" + 
                    "since this tool might delete more of\n" +
                    "your model than you want it to. This\n" +
                    "tool often helps with *very* broken\n" +
                    "models, but it can potentially make\n" +
                    "changes even where there aren't problems\n" +
                    " on a model."
                )
예제 #21
0
 def run(self):
     self.win = pm.window( title="Mmmm Baker Tool" )
     with self.win:
         self.col = pm.columnLayout()
         with self.col:
             self.spacers = []
             self.xnormalPathTextLabel = pm.text("Path and filename of xNormal executable:")
             self.xnormalPathTextField = pm.textField( width = 500, text="C:/Program Files/S.Orgaz/xNormal 3.19.2/x64/xNormal.exe" )
             self.spacers.append(  pm.text(" ")  )
             
             self.modelsPathTextLabel = pm.text("Path where models are:")
             self.modelsPathTextField = pm.textField( width = 500, text="C:/Users/Public/mmmmBaker" )
             self.modelsPathTextLabel2 = pm.text(
                 "(Warning, if changed, requires custom xnormal settings xml which points to new path.)"
             )                
             self.spacers.append(  pm.text(" ")  )
             
             self.highSuffixTextLabel = pm.text( 'High Suffix, on models for xnormals "high" model files, no extension' )
             self.highSuffixTextField = pm.textField( width = 500, text="_hi" )
             self.spacers.append(  pm.text(" ")  )
             
             #self.highSuffixTextLabel = pm.text( "Suffix on files: (not extension)" )
             #self.cageSuffixTextField = pm.textField( width = 500, text="_cage" )
             
             self.xmlFilesTextLabel = pm.text( "Xml files to bake, comma separated list:" )
             self.xmlFilesTextLabel2 = pm.text( "(xnormal settings files, should be in the same folder as models)" )
             self.xmlFilesTextField = pm.textField( width = 500, text="xnormal_settings_for_mmmmbaker_example.xml,xnormal_settings_for_mmmmbaker_example2.xml" )
             self.goButton = pm.button(  label="Go!  (Bake selected models) )", command=lambda x: self.go()  )
    def go(self):
        with self.win:
            self.col = pm.columnLayout()

            self.sourceText = pm.text("Attribute source")
            self.sourceField = pm.textField(width=300)

            self.text7 = pm.text(" ")
            self.targetText = pm.text("Attribute target")

            ## text that says attribute
            ## place to enter text for which attribute
            self.targetField = pm.textField(width=300)

            self.text5 = pm.text(" ")
            self.text6 = pm.text(
                "Multiplier (Only has affects resut if it is changed from the default 0.0 to another number.)"
            )
            self.multField = pm.floatField(width=300)

            self.button = pm.button(
                "Connect the attribute of the source to all the targets \n (source is first selected)",
                command=lambda x: self.parent.connectAttributes(
                    sourceAttrName=self.sourceField.getText(),
                    targetAttrName=self.targetField.getText(),
                    multiplier=self.multField.getValue(),
                ),
            )
            ## text that says value
            ## place to enter the new value
        self.win.show()
    def go(self):
        with self.win:
            self.col = pm.columnLayout()

            self.sourceText = pm.text("Attribute source")
            self.sourceField = pm.textField(width=300)

            self.text7 = pm.text(" ")
            self.targetText = pm.text("Attribute target")

            ## text that says attribute
            ## place to enter text for which attribute
            self.targetField = pm.textField(width=300)

            self.text5 = pm.text(" ")
            self.text6 = pm.text(
                "Multiplier (Only has affects resut if it is changed from the default 0.0 to another number.)"
            )
            self.multField = pm.floatField(width=300)

            self.button = pm.button(
                "Connect the attribute of the source to all the targets \n (source is first selected)",
                command=lambda x: self.parent.connectAttributes(
                    sourceAttrName=self.sourceField.getText(),
                    targetAttrName=self.targetField.getText(),
                    multiplier=self.multField.getValue()))
            ## text that says value
            ## place to enter the new value
        self.win.show()
예제 #24
0
  def __init__(self, parentRef):
    self.parentRef = parentRef
    self.buttons = []
    self.window = pm.window( sizeable = False, title = "Selector", titleBar=True)
    with self.window:
        self.layout = pm.columnLayout()
        with self.layout:
            self.labFace = pm.text( label='A Useful Tool For Making Selections.', align='left',parent = self.layout )
            self.labFace = pm.text( label='Currently this tool only selects non quad faces.', align='left',parent = self.layout )
            self.labFace3 = pm.text( label='More features will be added to this tool in the future.', align='left',parent = self.layout )

            self.labFace4Blank = pm.text( label='           ', align='left',parent = self.layout )
            self.labFace4Blank = pm.text( label='           ', align='left',parent = self.layout )
            
            btn__find_non_quad_faces = pm.button ( label = 'Find-Quad Face Faces',parent = self.layout,
                        command = lambda xc: self.parentRef.highlightNonQuads(),width = 300  )
            self.buttons.append( btn__find_non_quad_faces )
            
            self.labTriResult = pm.text( label='Number of Triangles Found:', align='left', parent = self.layout )
            self.triFace = pm.intField(parent = self.layout, width = 40,value=0)
            self.labngonResult = pm.text( label='Number of n-Gons Found:', align='left', parent = self.layout )            
            self.ngonFace = pm.intField(parent = self.layout, width = 40,value=0)

            
    # Set the values?
    
    self.buttons.append( btn__find_non_quad_faces )                
    #pm.formLayout( form, edit=True,attachForm=[(self.labVtx,'top',10),(self.labVtx,'left',5),(self.layoutGrid,'top',30),(self.layoutGrid,'left',5),(self.labFace,'top',200),(self.labFace,'left',5),(btn_Face,'top',220),(btn_Face,'left',5),(self.labTriResult,'top',255),(self.labTriResult,'left',5),(self.triFace,'top',250),(self.triFace,'left',160),(self.ngonFace,'top',270),(self.ngonFace,'left',160),(self.labngonResult,'top',275),(self.labngonResult,'left',5)])
    
    # Show Window
    pm.showWindow(self.window)
    self.window.setWidth(600)
    self.window.setHeight(400)
 def __init__(self, parentRef, selection=False, multiplier=1.0):
     self.parentRef = parentRef
     self.buttons = []
     self.window = pm.window(sizeable=False,
                             title="Light Multiplier",
                             titleBar=True)
     with self.window:
         self.layout = pm.columnLayout()
         with self.layout:  ## Using Ui on the end of Widget names
             self.multiplierText = pm.text(label='Multiplier:',
                                           align='left')
             self.multiplierUi = pm.floatField(value=1.0)
             self.checkBoxUi = pm.checkBox(
                 label='Affect Selected Lights Only')
             self.okUi = pm.button(
                 label='Apply',
                 parent=self.layout,
                 command=lambda xc: self.parentRef.applyMultiplier(
                     multiplier=self.multiplierUi.getValue(),
                     selection=self.checkBoxUi.getValue(),
                 ),
                 width=300)
     pm.showWindow(self.window)
     self.window.setWidth(600)
     self.window.setHeight(400)
예제 #26
0
    def create_atr_ui(self):
        self.ATTR_WINDOW = "Create_Attr"
        if pm.window(self.ATTR_WINDOW, query=True, exists=True):
            pm.deleteUI(self.ATTR_WINDOW)
        pm.window(self.ATTR_WINDOW,
                  title="create attribute",
                  iconName="CA",
                  widthHeight=(250, 200))
        attr_main_col = pm.columnLayout(adjustableColumn=True,
                                        parent=self.ATTR_WINDOW)

        attr_nm_col = pm.rowColumnLayout(parent=attr_main_col,
                                         numberOfColumns=2)

        pm.text(label="Enum Attribute Name  :  ", parent=attr_nm_col)

        self.attr_nm = pm.textField("", parent=attr_nm_col, width=120)

        pm.separator(parent=attr_main_col, style="in")

        attr_val_col = pm.rowColumnLayout(parent=attr_main_col,
                                          numberOfColumns=2,
                                          columnOffset=(1, "right", 5))

        attr_val_ch_col = pm.rowColumnLayout(parent=attr_val_col,
                                             numberOfRows=2)

        attr_val_btn_ch_col = pm.rowColumnLayout(parent=attr_val_col,
                                                 numberOfRows=2)

        pm.text(label="Enum Attribute values", parent=attr_val_ch_col)

        self.enum_val = pm.scrollField(parent=attr_val_ch_col,
                                       width=130,
                                       height=150)

        pm.text(label=" ", parent=attr_val_btn_ch_col)

        pm.button(label="Create Attr\non selected\ncontrol",
                  parent=attr_val_btn_ch_col,
                  height=150,
                  width=100,
                  command=lambda x: self.create_attr())
        pm.showWindow(self.ATTR_WINDOW)
        pm.window(self.ATTR_WINDOW, edit=True, widthHeight=(250, 200))

        return None
예제 #27
0
    def __init__(self, parentRef):
        self.parentRef = parentRef
        self.buttons = []
        self.window = pm.window(sizeable=False,
                                title="Selector",
                                titleBar=True)
        with self.window:
            self.layout = pm.columnLayout()
            with self.layout:
                self.labFace = pm.text(
                    label='A Useful Tool For Making Selections.',
                    align='left',
                    parent=self.layout)
                self.labFace = pm.text(
                    label='Currently this tool only selects non quad faces.',
                    align='left',
                    parent=self.layout)
                self.labFace3 = pm.text(
                    label=
                    'More features will be added to this tool in the future.',
                    align='left',
                    parent=self.layout)

                self.labFace4Blank = pm.text(label='           ',
                                             align='left',
                                             parent=self.layout)
                self.labFace4Blank = pm.text(label='           ',
                                             align='left',
                                             parent=self.layout)

                btn__find_non_quad_faces = pm.button(
                    label='Find-Quad Face Faces',
                    parent=self.layout,
                    command=lambda xc: self.parentRef.highlightNonQuads(),
                    width=300)
                self.buttons.append(btn__find_non_quad_faces)

                self.labTriResult = pm.text(label='Number of Triangles Found:',
                                            align='left',
                                            parent=self.layout)
                self.triFace = pm.intField(parent=self.layout,
                                           width=40,
                                           value=0)
                self.labngonResult = pm.text(label='Number of n-Gons Found:',
                                             align='left',
                                             parent=self.layout)
                self.ngonFace = pm.intField(parent=self.layout,
                                            width=40,
                                            value=0)

        # Set the values?

        self.buttons.append(btn__find_non_quad_faces)
        #pm.formLayout( form, edit=True,attachForm=[(self.labVtx,'top',10),(self.labVtx,'left',5),(self.layoutGrid,'top',30),(self.layoutGrid,'left',5),(self.labFace,'top',200),(self.labFace,'left',5),(btn_Face,'top',220),(btn_Face,'left',5),(self.labTriResult,'top',255),(self.labTriResult,'left',5),(self.triFace,'top',250),(self.triFace,'left',160),(self.ngonFace,'top',270),(self.ngonFace,'left',160),(self.labngonResult,'top',275),(self.labngonResult,'left',5)])

        # Show Window
        pm.showWindow(self.window)
        self.window.setWidth(600)
        self.window.setHeight(400)
예제 #28
0
def create(layout):
    print 'Creating shelves'
    container = pm.verticalLayout(p=layout)
    scroll_layout = pm.scrollLayout(p=container)
    top_layout = pm.verticalLayout(p=scroll_layout)
    bottom_layout = pm.verticalLayout(p=container)

    shelf_frames = __load_shelves(top_layout)
    pm.button(label='Refresh Shelves',
              c=lambda x: __load_shelves(top_layout),
              p=bottom_layout)
    pm.button(label='Edit Shelves',
              c=lambda x: pm.mel.eval('ShelfPreferencesWindow'),
              p=bottom_layout)

    bottom_layout.redistribute()
    container.redistribute(12, 1)
예제 #29
0
    def lyr_swtch_ui(self):

        self.MAIN_WINDOW = "Layered_texture_switch"
        if pm.window(self.MAIN_WINDOW, query=True, exists=True):
            pm.deleteUI(self.MAIN_WINDOW)
        pm.window(self.MAIN_WINDOW,
                  title="Layered Tex Switch",
                  iconName="LTS",
                  widthHeight=(150, 200))
        main_col = pm.columnLayout(adjustableColumn=True,
                                   height=100,
                                   parent=self.MAIN_WINDOW)

        but_col = pm.rowColumnLayout(parent=main_col, numberOfColumns=2)

        self.create_attr_btn = pm.button(
            label="Create ENUM Attribute",
            parent=main_col,
            command=lambda x: self.create_atr_ui())

        pm.separator(parent=main_col, style="in", height=10)

        pm.text(label="Enum Attribuite list", parent=main_col)
        pm.separator(parent=main_col, style="none", height=5)

        self.text_lst = pm.textScrollList(allowMultiSelection=False,
                                          parent=main_col,
                                          height=150)

        pm.separator(parent=main_col, style="none", height=5)

        but_col = pm.rowColumnLayout(parent=main_col, numberOfColumns=3)

        pm.button(label="Refresh List",
                  parent=but_col,
                  command=lambda x: self.populate_list())
        pm.separator(parent=but_col, horizontal=False)
        pm.button(label="Create Switch",
                  parent=but_col,
                  command=lambda x: self.create_switching())

        pm.showWindow(self.MAIN_WINDOW)
        pm.window(self.MAIN_WINDOW, edit=True, widthHeight=(150, 235))

        return None
    def reorder_edit_ui(self):
        reorder_win = "Reorder_Deformer_List"
        if pm.window(reorder_win, query=True, exists=True):
            pm.deleteUI(reorder_win)
        pm.window(reorder_win, title="Rearrange Deformers", iconName="ReArDf")
        main_col = pm.columnLayout(parent=reorder_win, adjustableColumn=True)
        self.reord_lst = pm.scrollField('reorder_deformer_list',
                                        parent=main_col,
                                        height=235,
                                        width=150,
                                        text=self.populate_order_edit_list())

        pm.button("Save order list",
                  parent=main_col,
                  command=lambda x: self.save_deformer_list())

        pm.showWindow(reorder_win)
        pm.window(reorder_win, edit=True, widthHeight=(150, 260))
        return None
  def __init__(self, parentRef):
    self.parentRef = parentRef
    self.win = pm.window( title="Joint Orientation", width=250, height=180)
    self.col = pm.columnLayout()
    self.row1 = pm.rowColumnLayout(
      width = 200, 
      numberOfColumns=2 
      )
    self.rotateXText = pm.text(
      label="X rotate:",
      parent=self.row1 )
    self.rotateXField = pm.intField(
      parent=self.row1 )
    self.rotateYText = pm.text(
      label="Y rotate:",
      parent=self.row1 )
    self.rotateYField = pm.intField(
      parent=self.row1 )
    self.rotateZText = pm.text(
      label="Z rotate:",
      parent=self.row1 )
    self.rotateZField = pm.intField(
      parent=self.row1 )
    self.button = pm.button(
      label="Rotate Joints",
      width=200,
      command = lambda x: parentRef.rotateJoint(
         self.rotateXField.getValue() ,self.rotateYField.getValue() ,self.rotateZField.getValue()   ),
         parent=self.col )
    self.button = pm.button(
      label="Rotate Joints Relative",
      width=200,
      command = lambda x: parentRef.rotateJoint(
         self.rotateXField.getValue() ,self.rotateYField.getValue() ,self.rotateZField.getValue(), rotateRelative=True   ),
         parent=self.col )

    
    
    self.win.show()
    self.win.setWidth(260)
    self.win.setHeight(210)
예제 #32
0
def create( layout ) :
	print 'Creating shelves'
	container = pm.verticalLayout( p=layout )
	scroll_layout = pm.scrollLayout( p=container )
	top_layout = pm.verticalLayout( p=scroll_layout )
	bottom_layout = pm.verticalLayout( p=container )

	shelf_frames = __load_shelves( top_layout )
	pm.button(
		label='Refresh Shelves', 
		c=lambda x : __load_shelves( top_layout ),
		p=bottom_layout
	)
	pm.button(
		label='Edit Shelves',
		c=lambda x : pm.mel.eval( 'ShelfPreferencesWindow' ), 
		p=bottom_layout
	)	

	bottom_layout.redistribute()
	container.redistribute( 12, 1 )
예제 #33
0
    def uv_ratio_UI(self):
        UV_RATIO_WINDOW = "UVratio"
        if pm.window(UV_RATIO_WINDOW, query=True, exists=True):
            pm.deleteUI(UV_RATIO_WINDOW)

        pm.window(UV_RATIO_WINDOW, title="uv ratio", iconName="UVR")

        main_col = pm.columnLayout(adjustableColumn=True)
        self.ref_shell_btn = pm.button("set reference shell",
                                       height=40,
                                       parent=main_col,
                                       backgroundColor=(.863, 0.078, 0.235),
                                       command=lambda x: self.set_ref_shell())
        pm.separator(parent=main_col, style="in", height=5)
        self.sel_shell_btn = pm.button("select assigned reference shell",
                                       parent=main_col,
                                       enable=False,
                                       command=lambda x: self.sel_ref_shell())
        pm.separator(parent=main_col, style="in", height=10)
        self.assign_btn = pm.button("apply uv ratio on\n selected Shells",
                                    height=40,
                                    parent=main_col,
                                    enable=False,
                                    command=lambda x: self.rescale_uv())
        #self.assign_btn.setEnable(False)
        pm.separator(parent=main_col, height=5, style="in")
        ch_bx_col = pm.rowColumnLayout(numberOfColumns=2,
                                       parent=main_col,
                                       columnOffset=(1, "left", 40))
        pm.text("", parent=ch_bx_col)
        self.ch_bx = pm.checkBox(label="Object Selection",
                                 parent=ch_bx_col,
                                 enable=False)
        pm.text("Check above option to select mesh\ninstead of shell",
                parent=main_col)

        pm.showWindow(UV_RATIO_WINDOW)
        pm.window(UV_RATIO_WINDOW, edit=True, widthHeight=(200, 170))
        return None
예제 #34
0
 def __init__(self):
     self.simpleScripter = SimpleScripter()
     self.win = pm.window("Simple Scripter")
     with self.win:
         self.col = pm.columnLayout()
         with self.col:
             self.text = pm.text("Mel Script code to repeat:")
             self.textFieldScript = pm.textField(width=500,
                                                 text=mel_command)
             self.btnOneToMany = pm.button(
                 "Run as One To Many",
                 command=lambda x: self.simpleScripter.oneToMany(
                     self.textFieldScript.getText()))
예제 #35
0
 def set_ref_shell(self):
     self.ref_shell = pm.ls(selection=True, flatten=True)
     if not self.ref_shell:
         pm.button(self.ref_shell_btn,
                   edit=True,
                   backgroundColor=(.863, 0.078, 0.235))
         self.ref_shell = None
         self.assign_btn.setEnable(False)
         self.sel_shell_btn.setEnable(False)
         self.ch_bx.setEnable(False)
         return None
     if not isinstance(self.ref_shell[0], pm.MeshFace):
         pm.displayWarning("Please select shells")
         return None
     r = round(random.uniform(0.000, 0.500), 3)
     b = round(random.uniform(0.000, 0.500), 3)
     pm.button(self.ref_shell_btn, edit=True, backgroundColor=(r, .545, b))
     self.ratioREF = self.get_area_ratio(flag="REF",
                                         sel_face=self.ref_shell)
     self.assign_btn.setEnable(True)
     self.sel_shell_btn.setEnable(True)
     self.ch_bx.setEnable(True)
     return None
예제 #36
0
class ScriptFileRunnerUi(object):
    def __init__(self, parentRef=None, mmmmToolsRef=None):
        self.mmmmTools = mmmmToolsRef
        self.parentRef = parentRef

        self.scriptFileRunner = MmmmScriptFileRunner(
            parentRef = self,
            mmmmToolsRef=self.mmmmTools
        )
        self.scriptFileRunner.findScripts()
        self.win = pm.window("Script File Runner")
        
        self.ddMenuEntires = [ ]
        with self.win:
            self.col = pm.columnLayout()
            with self.col:
                self.textPath = pm.text( "Path to scripts:" )
                self.textFieldPath = pm.textField(
                    text=self.scriptFileRunner.searchPath,
                    width=400,
                    changeCommand= lambda x : self.onTextPathChangeCommand()
                )
                self.btnRefresh = pm.button( "Refresh Scripts",
                    command = lambda x: self.buildMenu( )
예제 #37
0
 def __init__(self):
     self.simpleScripter = SimpleScripter()
     self.win = pm.window("Simple Scripter")
     with self.win:
         self.col = pm.columnLayout()
         with self.col:
             self.text = pm.text( "Mel Script code to repeat:" )
             self.textFieldScript = pm.textField( width=500, text=mel_command )
             self.btnOneToMany = pm.button(
                 "Run as One To Many",
                 command = lambda x:
                  self.simpleScripter.oneToMany(
                      self.textFieldScript.getText()
                  )
             )
예제 #38
0
 def makeAndAddButton(self, widgetListToAddTo, entry):
           n = widgetListToAddTo
           name = entry.name
           text = entry.text
           cmd = entry.cmd
           eColor = entry.color
           w = len(text)*8
           
           print( type(cmd)  )
           c = str(cmd)
           #c = 'print "hello world";'
           print( c )
           if type(entry.cmd)==type(','):
               tmp = n[name] = pm.button( text, bgc=eColor,
                           annotation=name[3:],
                           width=w, height=16,
                           command = lambda x: pm.mel.eval( c )
               )
           else:
               tmp = n[name] = pm.button( text, bgc=eColor,
                           annotation=name[3:],
                           width=w, height=16,
                           command = cmd
               )
    def ui(self):
        WINDOW = "jointSequence"
        if pm.window(WINDOW, query=True, exists=True):
            pm.deleteUI(WINDOW)
        pm.window(WINDOW, title="Continue Joints along loops", iconName="JNTS")
        main_col = pm.columnLayout(adjustableColumn=True)
        guide_col = pm.columnLayout(parent=main_col)
        info_txt = "INFO:"+\
                   "\nFrom selected edges as starting point and"+\
                   "\ndirection guide, every next edge loop is"+\
                   "\nobtained till it reaches the end or the"+\
                   "\nstaring selection edge or the selected end point"
        guide_txt = "GUIDE:\nSelect 2 edges, each from adjacent loops"+\
                    "\nfirst edge is the starting point"+\
                    "\nsecond edge to guide the direction"+\
                    "\nif third edge is selected, acts as end point"
        pm.text(guide_txt, align="left", parent=guide_col)
        pm.separator(parent=guide_col, height=5, style="in")
        pm.text(info_txt, align="left", parent=guide_col)
        pm.separator(parent=main_col, height=10)
        text_col = pm.rowColumnLayout(parent=main_col,
                                      numberOfColumns=2,
                                      columnOffset=(2, "left", 25))
        pm.text("number of loops to\nskip inbetween", parent=text_col)
        self.skip_val = pm.textField(text="0", parent=text_col, width=50)
        check_col = pm.rowColumnLayout(numberOfColumns=2,
                                       parent=main_col,
                                       columnOffset=(2, "left", 120))
        pm.text("", parent=check_col)
        self.skn_chk = pm.checkBox("skin", parent=check_col)
        pm.separator(parent=main_col, style="none", height=5)
        pm.button("create", parent=main_col, command=lambda x: self.run())

        pm.showWindow(WINDOW)
        pm.window(WINDOW, edit=True, widthHeight=(220, 230))
        return None
예제 #40
0
class MmmmShellThickenUi(object):
    def __init__(self, autorun=True ):
        self.shellThicken = MmmmShellThicken( )
        if autorun==True:
            self.createUi()
        
    def createUi(self):
        self.win = pm.window(title="Mmmm Shell Thicken")
        with self.win:
            self.col = pm.columnLayout()
            with self.col:
                self.thicknessLabel = pm.text( "Thickness:             " )
                self.thicknessFloatField = pm.floatField( value=1.0, precision=9, width=200 )
                self.divisionsLabel = pm.text( "Divisions:             " )
                self.divisionsIntField = pm.intField( value=1, width=200 )
                self.mergeLabel = pm.text( "Distance (tolerance) for verts merge:" )
예제 #41
0
 def __init__(self, mmmmTools=None, randomSelector=None):
     if randomSelector == None:
         self.randomSelector = RandomSelector()
     else:
         self.randomSelector = randomSelector
     self.win = pm.window("Random Selector")
     with self.win:
         self.col = pm.columnLayout()
         with self.col:
             self.ratioText = pm.text("Decimal number as ratio to select:")
             self.ratioFloat = pm.floatField()
             self.ratioFloat.setValue(0.5)
             self.selectButton = pm.button(
                 "Select by Ratio", command=lambda x: self.randomSelector.go(self.ratioFloat.getValue())
             )
     self.win.show()
예제 #42
0
 def __init__(self, mmmmTools=None, randomSelector=None):
     if randomSelector == None:
         self.randomSelector = RandomSelector()
     else:
         self.randomSelector = randomSelector
     self.win = pm.window('Random Selector')
     with self.win:
         self.col = pm.columnLayout()
         with self.col:
             self.ratioText = pm.text("Decimal number as ratio to select:")
             self.ratioFloat = pm.floatField()
             self.ratioFloat.setValue(0.5)
             self.selectButton = pm.button(
                 "Select by Ratio",
                 command=lambda x: self.randomSelector.go(self.ratioFloat.
                                                          getValue()))
     self.win.show()
예제 #43
0
    def manage_shape_ui(self):
        WINDOW = "add_control"
        chk_win = pm.window(WINDOW, query=True, exists=True)
        if chk_win:
            pm.deleteUI(WINDOW)
        pm.window(WINDOW, title="Manage_Shapes", iconName="MS")
        main_col = pm.columnLayout(parent=WINDOW, adjustableColumn=True)

        main_split_col = pm.rowColumnLayout(parent=main_col,
                                            numberOfColumns=2,
                                            columnOffset=(2, "left", 5))
        cmd_col = pm.columnLayout(parent=main_split_col)
        pm.separator(parent=main_col, height=10)
        mel_cmd_col = pm.columnLayout(parent=cmd_col,
                                      columnOffset=("left", 10))
        pm.text("\t\t\t\tShape Name", parent=mel_cmd_col)
        nm_txt = pm.textField(text="", parent=mel_cmd_col, width=300)
        pm.text("\t\t\t\tShape mel command", parent=mel_cmd_col)
        txt = pm.scrollField("",
                             wordWrap=True,
                             parent=mel_cmd_col,
                             height=130,
                             width=300)
        pm.separator(parent=main_col, height=10)
        add_btn_col = pm.columnLayout(parent=cmd_col,
                                      columnOffset=("left", 100))
        pm.button("add",
                  parent=add_btn_col,
                  width=100,
                  command=lambda x: self.add_ctr(cmd=txt.getText(),
                                                 nm=nm_txt.getText()))

        list_col = pm.columnLayout(parent=main_split_col)
        pm.text("\t\tExisting Shapes", parent=list_col)
        self.shp_lst_bx = pm.textScrollList(parent=list_col,
                                            height=165,
                                            width=170)

        edit_btn_col = pm.rowColumnLayout(numberOfColumns=3, parent=list_col)
        pm.button("Delete",
                  parent=edit_btn_col,
                  width=82,
                  command=lambda x: self.delete_selection())
        pm.separator(parent=edit_btn_col, horizontal=False)
        pm.button("rename",
                  parent=edit_btn_col,
                  width=82,
                  command=lambda x: self.rename_ui())

        pm.showWindow(WINDOW)
        pm.window(WINDOW, edit=True, widthHeight=(500, 220))
        return None
 def __init__(self, parentRef, selection=False, multiplier=1.0):
   self.parentRef = parentRef
   self.buttons = []
   self.window = pm.window( sizeable = False, title = "Light Multiplier", titleBar=True)
   with self.window:
       self.layout = pm.columnLayout()
       with self.layout:  ## Using Ui on the end of Widget names
           self.multiplierText = pm.text( label='Multiplier:', align='left' )
           self.multiplierUi = pm.floatField( value=1.0 )
           self.checkBoxUi = pm.checkBox( label='Affect Selected Lights Only')
           self.okUi = pm.button ( label = 'Apply',parent = self.layout,
                       command = lambda xc: self.parentRef.applyMultiplier( multiplier=self.multiplierUi.getValue(),
                                   selection=self.checkBoxUi.getValue(),
                               ),
                       width = 300  )
   pm.showWindow(self.window)
   self.window.setWidth(600)
   self.window.setHeight(400)
예제 #45
0
    def run(self):
        self.win = pm.window(title="Mmmm Baker Tool")
        with self.win:
            self.col = pm.columnLayout()
            with self.col:
                self.spacers = []
                self.xnormalPathTextLabel = pm.text(
                    "Path and filename of xNormal executable:")
                self.xnormalPathTextField = pm.textField(
                    width=500,
                    text=
                    "C:/Program Files/S.Orgaz/xNormal 3.19.2/x64/xNormal.exe")
                self.spacers.append(pm.text(" "))

                self.modelsPathTextLabel = pm.text("Path where models are:")
                self.modelsPathTextField = pm.textField(
                    width=500, text="C:/Users/Public/mmmmBaker")
                self.modelsPathTextLabel2 = pm.text(
                    "(Warning, if changed, requires custom xnormal settings xml which points to new path.)"
                )
                self.spacers.append(pm.text(" "))

                self.highSuffixTextLabel = pm.text(
                    'High Suffix, on models for xnormals "high" model files, no extension'
                )
                self.highSuffixTextField = pm.textField(width=500, text="_hi")
                self.spacers.append(pm.text(" "))

                #self.highSuffixTextLabel = pm.text( "Suffix on files: (not extension)" )
                #self.cageSuffixTextField = pm.textField( width = 500, text="_cage" )

                self.xmlFilesTextLabel = pm.text(
                    "Xml files to bake, comma separated list:")
                self.xmlFilesTextLabel2 = pm.text(
                    "(xnormal settings files, should be in the same folder as models)"
                )
                self.xmlFilesTextField = pm.textField(
                    width=500,
                    text=
                    "xnormal_settings_for_mmmmbaker_example.xml,xnormal_settings_for_mmmmbaker_example2.xml"
                )
                self.goButton = pm.button(
                    label="Go!  (Bake selected models) )",
                    command=lambda x: self.go())
 def __init__(self):
     self.window = pm.window( "Rename UI" )
     self.window.show()
     with self.window:
         self.col = pm.columnLayout()
         with self.col:
             pm.text( "Prefix Field" )
             self.prefixField = pm.textField( text="", width=300 )
             pm.text( "Search Field" )
             self.searchField = pm.textField( text="", width=300 )
             pm.text( "Replace Field" )
             self.replaceField = pm.textField( text="",width=300 )
             pm.text( "Suffix Field" )                
             self.suffixField = pm.textField( text="",width=300 )
             self.button = pm.button(
                 "Rename Selected",
                 command = lambda x: self.renameSelected()
             )
             self.button.setBackgroundColor( [0,0.5,0] )
             self.window.setWidth( 380 )
             self.window.setHeight( 180 )
 def __init__(self):
     self.win=pm.window()
     with self.win:
         self.col = pm.columnLayout()
         with self.col:
             self.label1 = pm.text( "Attribute Group Name (To Be Added)" )
             self.dropdown = pm.optionMenu( "menu", 
                 changeCommand = self.onDropDownChange                
             )
             with self.dropdown:
                 for i,v in enumerate(addableAttrList):
                     pm.menuItem( v )
             self.attrNameField = pm.textField( )
             self.addAttrButton = pm.button(
                 "Add Attribtutes!",
                 command = lambda x:  self.addAttributeGroup(
                    self.attrNameField.getText()
                 )
             )
             
     self.win.show()
예제 #48
0
def object_creator_ui():
    """This method creates user interface to input object details

        User Inputs:
            - Object name
            - Object ID

    Returns : None
    """
    WINDOW = 'ObjectCreator'
    if pm.window(WINDOW, query=True, exists=True):
        pm.deleteUI(WINDOW)
    pm.window(WINDOW,
              title="Object creator",
              iconName='OC',
              widthHeight=(200, 250))
    column_1 = pm.columnLayout(adjustableColumn=True)

    pm.Text(label="Enter Object Name", parent=column_1)
    object_name = pm.TextField(text='Object', parent=column_1)

    pm.separator(height=20, style='in', parent=column_1)
    pm.Text(label="Enter ID to start with", parent=column_1)
    object_id = pm.TextField(text='01', parent=column_1)

    pm.separator(height=20, style='in', parent=column_1)
    pm.button(label='Create Joint',
              command=lambda x: create_joint(object_name.getText(),
                                             object_id.getText()),
              parent=column_1)

    pm.separator(height=20, style='in', parent=column_1)
    pm.button(label='Create Locator',
              command=lambda x: create_locator(object_name.getText(),
                                               object_id.getText()),
              parent=column_1)

    pm.separator(height=20, style='in', parent=column_1)
    pm.button(label='Create Group',
              command=lambda x: create_group(object_name.getText(),
                                             object_id.getText()),
              parent=column_1)

    pm.showWindow(WINDOW)
    pm.window(WINDOW, edit=True, widthHeight=(200, 250))
    return None
    def main_rearrange_ui(self):
        WIN = "rearrange_nodes"
        if pm.window(WIN, query=True, exists=True):
            pm.deleteUI(WIN)
        pm.window(WIN, title="Rearrange Nodes", iconName="ReArNd")
        main_col = pm.columnLayout(parent=WIN, adjustableColumn=True)
        list_ord_col = pm.rowColumnLayout(parent=main_col, numberOfColumns=3)
        ord_col_ch = pm.columnLayout(parent=list_ord_col,
                                     adjustableColumn=True)
        pm.separator(parent=list_ord_col, horizontal=False, width=10)
        list_col_ch = pm.columnLayout(parent=list_ord_col,
                                      adjustableColumn=True)

        self.ord_lst = pm.textScrollList('deformers_reorder',
                                         numberOfRows=10,
                                         parent=ord_col_ch,
                                         height=235,
                                         width=150,
                                         allowMultiSelection=False,
                                         enable=False)

        pm.separator(style="none", height=20, parent=list_col_ch)
        self.nd_typ_txt = pm.textField(parent=list_col_ch, width=150)
        pm.separator(style="none", height=10, parent=list_col_ch)
        pm.button(label="Get Selected Node Type",
                  parent=list_col_ch,
                  command=lambda x: self.show_type())
        pm.separator(style="in", height=50, parent=list_col_ch)
        pm.button(label="Rearrange",
                  height=130,
                  parent=list_col_ch,
                  backgroundColor=(0.561, 0.737, 0.561),
                  command=lambda x: self.reorder_deformer_nodes())
        pm.button(label="Edit Order List",
                  parent=ord_col_ch,
                  command=lambda x: self.reorder_edit_ui())
        pm.showWindow(WIN)
        pm.window(WIN, edit=True, widthHeight=(320, 260))
        return None
예제 #50
0
def ckFidgetWin():
    """
        ckFidgetWin()

        description: creates interface for ckFidget tool. the list is built dynamically
            from the list of active fidgets on load, so the more fidgets you add. the
            longer the tool window will become.

        inputs:

        outputs: the main fidget window.

        CK - I should add some menus to this that have basic falloffs
         for common tasks, like cloth, sss, or lighting.

    """
    if pm.mel.eval('window -ex "fidgetMainWin" ;'):
        pm.mel.eval('deleteUI "fidgetMainWin";' )
    fidgetWin = pm.mel.eval('window -title "Carl Keifer attribute fidgeter" -width 150 fidgetMainWin;')
    pm.columnLayout( adjustableColumn=True )
    pm.frameLayout( label = "Build Fidget", borderStyle='in', collapsable=True )
    pm.rowLayout( numberOfColumns=5, columnWidth=(75,75) )
    pm.button( label = 'Add Fidget', command = 'ckAddFidget()' )
    pm.button( label = 'refresh UI', command = 'ckFidget()' )
    pm.button( label = 'Save All', command = 'ckSavRstZerAll( "save" )')
    pm.button( label = 'Zero All', command = 'ckSavRstZerAll( "zero" )')
    pm.button( label = 'Restore All', command = 'ckSavRstZerAll( "restore" )')
    pm.setParent( '..' )
    pm.setParent( '..' )
    pm.frameLayout( label = "Master Fidget", borderStyle='in', collapsable=True )
    pm.rowLayout( numberOfColumns=6, columnWidth=(75,75) )
    pm.mel.eval( 'floatField -value $gckFidgetBump -min 0 -changeCommand "$gckFidgetBump = `floatField -q -v  masterBump`"  masterBump;' )
    pm.button( label = '<', command = 'ckFidgetBumpAll("Down")')
    pm.button( label = '>', command = 'ckFidgetBumpAll("Up")')
    pm.radioButtonGrp( label='Bump by:', labelArray2=['0.0', '%'], numberOfRadioButtons=2, sl=1, on1= 'pm.setAttr("ckFidget_GRP.bumpBy", False)', on2= 'pm.setAttr("ckFidget_GRP.bumpBy", True)')
    pm.setParent( '..' )
    pm.setParent( '..' )
    pm.frameLayout( label = "Fidget Attributes", borderStyle='in', collapsable=True )
    e = 0
    # this iterates the list of fidgets we have
    ckList = ckGetList("ckFidget_GRP.ckFidgetList")
    for i in ckList:
        print "i, ",i
        pm.rowLayout( numberOfColumns=6, columnWidth=(75,75) )
        pm.attrFieldSliderGrp( l=str(i), min=-10.0, max=10.0, at = i )
        pm.button( label = '<', command = 'ckFidgetBump(\"'+i+'\", "Down")' )
        pm.button( label = '>', command = 'ckFidgetBump( \"'+i+'\","Up")' )
        pm.button( label = 'save', command = 'ckSavRst( \"'+i+'\", "save")')
        pm.button( label = 'zero', command = 'pm.setAttr( \"'+i+'\", 0)' )
        pm.button( label = 'restore', command = 'ckSavRst( \"'+i+'\", "restore")')
        pm.setParent( '..' )
    pm.setParent( '..' )
    pm.setParent( '..' )
    pm.showWindow(fidgetWin)
    # I should now connect the master fidget value to the fidget group
예제 #51
0
 def _createImportGUI(self):
     pm.text( label='Import' ) 
     pm.text( label='This imports the entire simulation' ) 
     pm.button(label="Import", w=128,
             c=pm.Callback(self._import))
예제 #52
0
    def __init__(self, parentRef, parentWidget=None, mmmm=None ):
        self.parentRef = parentRef
        self.buttons = []
        self.widgets = {}
        
        self.mmmm = mmmm
        

        if parentWidget==None:
            parentWidget = self.widgets['parentWidget'] = pm.Window(
                sizeable = True, title = "Mmmm Hotkeys Manager", titleBar=True
            )
        else:
            self.widgets['parentWidget'] = parentWidget

        with parentWidget:
            self.layout = pm.columnLayout()
            with self.layout:
            
                self.widgets['editorBtn'] =  pm.button( "Maya Hotkey Editor Window...",
                    annotation=
                        "Open the Maya's default builtin hotkey editor window. "
                        +
                        " There is nothing MmmmTools specific about this, it's just a shortcut.",
                    command='pm.mel.eval("HotkeyPreferencesWindow;")',
                )
                
                self.widgets['infoText'] = pm.text("\nInstructions (read tooltip, hover here)\n",
                                    annotation = 
                      "Note that users should avoid editing the hotkey sets \n"
                    + "starting with Mmmm. If you wish to modify them, \n"
                    + "you should duplicate the Mmmm keyset you want to modify, \n"
                    + "rename, so it does not start with Mmmm, and make change to your own copy. \n\n"
                    + "Changing the Mmmm keySets themselves requires writing/altering python code. \n"
                    + "Our recommendation is that for your own hotkeys, you make your own hotkey sets, \n"
                    + "and switch to them as necessary. (See other button tooltips for more info.)"
                )
                
                                
                self.widgets['nextKeySetBtn'] = pm.button( "Next Hotkey Set",
                    command = lambda x: self.parentRef.nextKeySet(),
                    annotation="Go to the next keyset, in alphabetical order. \n\n "
                    + "In case you want to add it to a shelf/button: \n"
                    + "The mel command to do this is: MmmmCmds__Hotkeys__NextKeySet",
                )
                self.widgets['prevKeySetBtn'] = pm.button( "Prev Hotkey Set",
                    command = lambda x: self.parentRef.prevKeySet(),
                    annotation="Go to the previous keyset, in alphabetical order. \n\n "
                    + "In case you want to add it to a shelf/button: \n"
                    + "The mel command to do this is: MmmmCmds__Hotkeys__PrevKeySet",
                )
                
                #self.widgets['refreshListBtn'] = pm.button( "Refresh Hotkey Set Dropdown List" )
                self.widgets['dropdownLabel'] =  pm.text("\n Choose active hotkey set:",
                    annotation="You may need to either click the refresh button, "
                    +"or if that is unavailable, close and reopen this window, to refresh the list."
                )
                
                self.widgets['dropdown'] = pm.optionMenu( "MmmmKeySetDropdownMenu", 
                    changeCommand = self.onDropDownChange,
                )
                keySets = pm.hotkeySet( query=True, hotkeySetArray=True)
                keySets.sort()
                for keySet in keySets :
                    pm.menuItem( keySet )
    def __init__(self):
        self.winTitle = "Gad29Tools"
        #try:
        #    pm.deleteUI( self.winTitle )
        #except:
        #    print( traceback.format_exc() )
        if pm.window( self.winTitle, query=True, exists=True ):
            pm.deleteUI( self.winTitle )
        self.win = pm.window( "Gad29Tools" )
        #self.win = pm.window( "Gad29Tools" + '_' +  str( datetime.datetime.today().strftime('y%Ym%md%dh%Hn%Ms%S') )    )
        self.scroll = pm.scrollLayout(parent=self.win)
        self.col = pm.columnLayout(parent=self.scroll)
        with self.col:

            self.jointsSectionLabel = pm.text( "Joints:" )
            self.autoOrientXKeepZBtn = pm.button( "auto orient x while keeping z",
                command = lambda x: self.autoOrientXKeepZForSelected()
            )
            self.autoOrientTipJointsBtn = pm.button( "auto orient tip joints",
                command = lambda x: self.autoOrientTipJointsForSelected()
            )
            self.autoOrientTipJointsBtn = pm.button( "fix joint complex xforms",
                command = lambda x: self.fixJointComplexXformsForSelected()
            )
            
            self.checkJointsBtn = pm.button( "check joints (currently only rot and scale)",
                command = lambda x: self.checkJoints()
            )  


            self.ctrlSectionLabel = pm.text( "\n" + "Controls:" )            
            self.ctrlSizeFloatField = pm.floatField(
                value=8.0
            )
            self.makeAnimCtrlAndZeroBtn = pm.button(
                "Make Anim Ctrl And Zero (at size given above)",
                command = lambda x: self.makeAnimCtrlAndZero()
            )
            self.clearSelectedCtrlsPosSlaveBtn = pm.button(
                "Clear Selected Ctrls Pos Slave",
                command = lambda x: self.clearSelectedCtrlsPosSlave()
            )
            self.clearSelectedCtrlsRotSlaveBtn = pm.button(
                "Clear Selted Ctrls Rot Slave",
                command = lambda x: self.clearSelectedCtrlsRotSlave()
            )
            self.constrainSlavesToSelectedBtn = pm.button(
                "Constrain Slaves To Selected",
                command = lambda x: self.constrainSlavesToSelected()
            )
            

            self.parentingSectionLabel = pm.text( "\n" + "Parenting:" )
            self.chainParentBtn = pm.button( "chain parent",
                command = lambda x: self.chainParent()
            )                                    
            self.chainParentWithZeroesBtn = pm.button( "chain parent with zeroes",
                command = lambda x: self.chainParentWithZeroes()
            )
            self.parentWithZeroesBtn = pm.button( "parent with zeroes",
                command = lambda x: self.parentWithZeroes()
            )
            
            #self.fromBtn = pm.button( "parent without compensation",
            #    command = lambda x: self.parentWithoutCompensation()
            #)

            self.connectionsSectionLabel = pm.text( "\n" + "Connections:" )
            
            self.fromBtn = pm.button( "from",
                command = lambda x: self.setFromAttrsViaChannelBoxAndSelection()
            )
            self.toBtn = pm.button( "to (connect)",
                command = lambda x: self.connectToAttrsViaChannelBoxAndSelection()
            )
            self.toBtn = pm.button( "to (drive)",
                command = lambda x: self.driveToAttrsViaChannelBoxAndSelectionOneToOne()
            )
            self.linearizeBtn = pm.button( "linearize",
                command = lambda x: self.linearizeViaChannelBoxAndSelection()
            )
            self.linearizeBtn = pm.button( "cycle",
                command = lambda x: self.cycleViaChannelBoxAndSelection()
            )
            

            self.parentingSectionLabel = pm.text( "\n" + "Misc:" )            
            self.fromBtn = pm.button( "makeCamPlaneForDrawing",
                command = lambda x: self.makeCamPlaneForDrawing()
            )
          
            self.checkForUnfoldNodesBtn = pm.button( "check for unfold nodes",
                command = lambda x: self.checkForUnfoldNodes()
            )            
                        
            
            
            
        self.win.show()
예제 #54
0
windowNameTut = "Tutorial"
if (pma.window(windowNameTut, exists=True)):
    pma.deleteUI(windowNameTut)
windowTutorial = pma.window(windowNameTut, title=windowNameTut, width=400, height=300, backgroundColor=[0.2, 0.2, 0.2])
pma.columnLayout("testColumn", adjustableColumn=True)
pma.text("intro",
         label="This tool is a super tool to make booleans wrote by Leonardo Iezzi. To make it works correctly, you need to have your base mesh already even if just a cube. With your base mesh selected just press one of the three buttons on the windows to subtract or add those primitives. If you want to use a custom mesh for the operation: select your base mesh then the custom one (it's important to pick your base mesh first) and then press the 'Use custom mesh' button. After you have done, select your base mesh and press 'Clean Up.'",
         wordWrap=True, height=100, backgroundColor=[0.2, 0.2, 0.2], align='left', parent="testColumn")

# pma.text("first", label = "1- Select always your main mesh first",wordWrap= True, height = 40, backgroundColor = [0.2, 0.2, 0.2], align='left', parent = "testColumn")
# pma.text("secondo", label = "2- In case you want to use a custom mesh: Select first your main mesh then the mesh you want to add or subtract",wordWrap= True, height = 40, backgroundColor = [0.2, 0.2, 0.2], align='left', parent = "testColumn")
# pma.text("third", label = "3- Everythong should works",wordWrap= True, height = 40, backgroundColor = [0.2, 0.2, 0.2], align='left', parent = "testColumn")


pma.separator(parent="testColumn", height=20)
pma.button("goit", label="Got it", width=120, height=40, backgroundColor=[0.5, 0.5, 0.5], parent="testColumn",
           command="pma.deleteUI(windowNameTut)")

pma.showWindow()

################################################################################################UI#################################################
# pma.deleteUI(windowNameTut)
windowName = "SuperBool"
windowSize = (120, 200)
if (pma.window(windowName, exists=True)):
    pma.deleteUI(windowName)
window = pma.window(windowName, title=windowName, width=120, height=200)
pma.columnLayout("mainColumn", adjustableColumn=True)

################################################################################################UI#################################################
pma.gridLayout("nameGridLayout01", numberOfRowsColumns=(1, 4), cellWidthHeight=(40, 40), parent="mainColumn")
pma.symbolButton("nameButton1", image="polyCube.png", width=40, height=40, backgroundColor=[0.2, 0.2, 0.2],
예제 #55
0
    def __init__(self, parentRef=None):
        self.parentRef = parentRef
        #print( 'parent is:')
        #print( self.parentRef )
        self.win = pm.window("UV Xform Tools")
        with self.win:
            self.lay = pm.formLayout()
            with self.lay:
                labels_x = 0
                self.move_label = pm.text("Move UVs 1 Space Over")
                x = 0
                y = 0
                self.lay.attachForm(self.move_label, "left", labels_x)
                self.lay.attachForm(self.move_label, "top", y)

                x_orig = 20
                y_orig = 20
                x = x_orig
                y = y_orig
                x_offset_step = 80

                self.move_b1 = pm.button(
                    label="move up",
                    command=lambda x: self.parentRef.move_uvs(0, 1))
                self.move_b2 = pm.button(
                    label="move down",
                    command=lambda x: self.parentRef.move_uvs(0, -1))
                self.move_b3 = pm.button(
                    label="move left",
                    command=lambda x: self.parentRef.move_uvs(-1, 0))
                self.move_b4 = pm.button(
                    label="move right",
                    command=lambda x: self.parentRef.move_uvs(1, 0))

                self.lay.attachForm(self.move_b1, "left", x)
                self.lay.attachForm(self.move_b1, "top", y)
                x = x + x_offset_step
                self.lay.attachForm(self.move_b2, "left", x)
                self.lay.attachForm(self.move_b2, "top", y)
                x = x + x_offset_step
                self.lay.attachForm(self.move_b3, "left", x)
                self.lay.attachForm(self.move_b3, "top", y)
                x = x + x_offset_step
                self.lay.attachForm(self.move_b4, "left", x)
                self.lay.attachForm(self.move_b4, "top", y)

                x_orig = 20
                y_orig = 100
                x = x_orig
                y = y_orig
                offset_step_y = 25

                self.scale_label = pm.text("Scale UVs")
                self.lay.attachForm(self.scale_label, "left", labels_x)
                self.lay.attachForm(self.scale_label, "top", y - 20)

                self.shrink_b0 = pm.button(
                    label="0.5",
                    command=lambda x: self.parentRef.scale_uvs(s=0.5))
                self.shrink_b1 = pm.button(
                    label="0.9",
                    command=lambda x: self.parentRef.scale_uvs(s=0.9))
                self.shrink_b2 = pm.button(
                    label="0.99",
                    command=lambda x: self.parentRef.scale_uvs(s=0.99))
                self.shrink_b3 = pm.button(
                    label="0.999",
                    command=lambda x: self.parentRef.scale_uvs(s=0.999))

                x_orig = 20
                x = x_orig
                y = y_orig
                offset_step_y = 25

                self.lay.attachForm(self.shrink_b0, "left", x)
                self.lay.attachForm(self.shrink_b0, "top", y)

                x = x + 0
                y = y + offset_step_y
                self.lay.attachForm(self.shrink_b1, "left", x)
                self.lay.attachForm(self.shrink_b1, "top", y)

                x = x + 0
                y = y + offset_step_y
                self.lay.attachForm(self.shrink_b2, "left", x)
                self.lay.attachForm(self.shrink_b2, "top", y)

                x = x + 0
                y = y + offset_step_y
                self.lay.attachForm(self.shrink_b3, "left", x)
                self.lay.attachForm(self.shrink_b3, "top", y)

                self.grow_b0 = pm.button(
                    label="2", command=lambda x: self.parentRef.scale_uvs(s=2))
                self.grow_b1 = pm.button(
                    label="1.1",
                    command=lambda x: self.parentRef.scale_uvs(s=1.1))
                self.grow_b2 = pm.button(
                    label="1.01",
                    command=lambda x: self.parentRef.scale_uvs(s=1.01))
                self.grow_b3 = pm.button(
                    label="1.001",
                    command=lambda x: self.parentRef.scale_uvs(s=1.001))

                x_orig = 80
                x = x_orig
                y = y_orig
                offset_step_y = 25

                self.lay.attachForm(self.grow_b0, "left", x)
                self.lay.attachForm(self.grow_b0, "top", y)

                x = x + 0
                y = y + offset_step_y
                self.lay.attachForm(self.grow_b1, "left", x)
                self.lay.attachForm(self.grow_b1, "top", y)

                x = x + 0
                y = y + offset_step_y
                self.lay.attachForm(self.grow_b2, "left", x)
                self.lay.attachForm(self.grow_b2, "top", y)

                x = x + 0
                y = y + offset_step_y
                self.lay.attachForm(self.grow_b3, "left", x)
                self.lay.attachForm(self.grow_b3, "top", y)