Exemplo n.º 1
0
 def build(self):
     if mc.window( self.win, ex=1 ): mc.deleteUI( self.win )
     if mc.windowPref( self.win, ex=1 ): mc.windowPref( self.win, remove=1 )
     mc.window(self.win, title=self.title, wh=(410,378))
     mc.columnLayout( 'mainColumn', adj=True )
     mc.separator( h=10 )
     mc.rowLayout( numberOfColumns=2, columnWidth2=(200, 200), columnAttach=[(1, "both", 5),(2 ,"both", 5)] )
     mc.columnLayout( adj=True, columnAlign="center" )
     mc.text( l=self.textsk )
     self.skcharacterList = mc.textScrollList( numberOfRows=20, allowMultiSelection=True  )
     mc.setParent('..')
     mc.columnLayout( adj=True, columnAlign="center" )
     mc.text( l=self.textqp )
     self.qpcharacterList = mc.textScrollList( numberOfRows=20, allowMultiSelection=True  )
     mc.setParent( '..' )
     mc.setParent('..')
     mc.separator ( h=10 )
     mc.rowLayout( numberOfColumns=4, columnWidth4=(100, 100, 100, 100), columnAttach=[(1, "both", 1),(2 ,"both", 1), (3 ,"both", 1), (4 ,"both", 1)] )
     mc.button( l=self.buttonsk, c=self.selSKItem )
     mc.button( l=self.buttonAllSk, c=self.mainSK )
     mc.button( l=self.buttonqp, c=self.selQPItem )
     mc.button( l=self.buttonAllQp, c=self.mainQP )
     mc.setParent('..')
     mc.columnLayout( adj=True, columnAlign="center" )
     mc.separator ( h=10 )
     mc.setParent('..')
     self.addSKList()
Exemplo n.º 2
0
Arquivo: mayaUI.py Projeto: gj210/upy
    def startBlock(self,m=1,n=1):
        #currently i will just make basic layou using the rawLayout
#        columnWidth=[]
#        for i in range(1,m):
#            columnWidth.append([i,80])#[(1, 60), (2, 80), (3, 100)]
#        cmds.rowColumnLayout(numberOfColumns=m,columnWidth=columnWidth)
#        cmds.flowLayout(wr=True)
        if not self.inNotebook and self.notebook is not None:    
            if self.afterNoteBook is None:
                c=self.afterNoteBook = cmds.flowLayout(wr=True,p=self.form)
                cmds.formLayout( self.form, edit=True, attachForm=((c, 'left', 0),(c, 'bottom', 0),
                                              (c, 'right', 0)),attachControl = ((c,'top',5,self.notebook["id"])) )
            if m==0:
                c=cmds.flowLayout(wr=True,w=self.w*self.scale,p=self.afterNoteBook)
            else :
                c=cmds.rowLayout(numberOfColumns=m,w=self.w*self.scale,p=self.afterNoteBook)            
        else : 
#            if self.mainlayout is None:
#                c=self.mainlayout = cmds.scrollLayout('scrollLayout',p=self.form)#cmds.flowLayout(wr=True,p=self.form)
#                cmds.formLayout( self.form, edit=True, attachForm=((c, 'left', 0),(c, 'bottom', 0),
#                                              (c, 'right', 0),(c, 'top', 0),) )
                
            if m==0:
                cmds.flowLayout(wr=True,w=self.w*self.scale)#,p=self.mainlayout)
            else :
                cmds.rowLayout(numberOfColumns=m,w=self.w*self.scale)#,p=self.mainlayout)
Exemplo n.º 3
0
def j_MirrorBlendShape():
    '''
     UI
    '''
    global text1
    global text2 
    global text3
    j_MainWindow = ""
    if (mc.window(j_MainWindow, exists = 1 )):
        mc.deleteUI(j_MainWindow)
    j_MainWindow = mc.window(title = u"镜像表情", wh = (300,160))
    mc.columnLayout()
    mc.text(l = "")
    text1 = mc.textFieldButtonGrp( l = u"BaseObject:", buttonLabel = u"    < < < <    ", 
                          buttonCommand = 'xanthus.j_MirrorBlendShape.j_getObj(1)', cw3 = (90,120,100),h = 30)
    
    text2 = mc.textFieldButtonGrp(l = u"In-Between:", buttonLabel = u"    < < < <    ",
                          buttonCommand = "xanthus.j_MirrorBlendShape.j_getObj(2)", cw3 = (90,120,100),h = 30,enable = 0)
    
    text3 = mc.textFieldButtonGrp(l = u"BlendShape:", buttonLabel = u"    < < < <    ", 
                          buttonCommand = "xanthus.j_MirrorBlendShape.j_getObj(3)", cw3 = (90,120,100),h = 30)
    
    mc.text(l = "",h = 10)
    mc.setParent('..')
    mc.rowLayout(nc = 2 ,cw2= (150,150),ct2 = ("left","left") ,co2 = (8,0) )
    mc.button(l = u" 镜    像 ", w = 135, h= 30,c = "xanthus.j_MirrorBlendShape.j_MakeMirror()")
    mc.button(l = u" 重    置 ", w = 135, h= 30,c = "xanthus.j_MirrorBlendShape.j_Reset()")
    mc.setParent('..')
    mc.columnLayout
    mc.text(l = "                        copyright@ xanthus by Jiangjishi ", enable = 0)
    mc.showWindow(j_MainWindow)
Exemplo n.º 4
0
    def __init__(self):
        winName = "Size set"
        global typeMenu
        winTitle = winName
        if cmds.window(winName, exists=True):
                cmds.deleteUI(winName)

#         self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=150, h=100 )
        window = cmds.window(winName, title=winTitle, tbm=1, w=250, h=100 )

        cmds.menuBarLayout(h=30)
        cmds.rowColumnLayout  (' selectArrayRow ', nr=1, w=250)

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')
        
        cmds.rowLayout  (' rMainRow ', w=300, numberOfColumns=6, p='selectArrayRow')
        cmds.columnLayout ('selectArrayColumn', parent = 'rMainRow')
        cmds.setParent ('selectArrayColumn')
        cmds.separator(h=10, p='selectArrayColumn')
        cmds.gridLayout('listBuildButtonLayout', p='selectArrayColumn', numberOfColumns=2, cellWidthHeight=(100, 20))
        typeMenu=cmds.optionMenu( label='ctrl size')
        cmds.menuItem( label="Large" )
        cmds.menuItem( label="Med" )
        cmds.menuItem( label="Small" )           
        cmds.button (label='Change Selection', p='listBuildButtonLayout', command = lambda *args:self.controllerSize())
        cmds.showWindow(window)    
Exemplo n.º 5
0
Arquivo: mayaUI.py Projeto: gj210/upy
    def drawFrame(self,bloc,x,y):
        """
        Function to draw a block as a collapsable frame layout of the gui. 
        
        @type  block: array or dictionary
        @param block: list or dictionary of item dictionary
        @type  x: int
        @param x: position on x in the gui windows, used for blender
        @type  y: int
        @param y: position on y in the gui windows, used for blender
        
        @rtype:   int
        @return:  the new horizontal position, used for blender
        """    
        
#        cmds.scrollLayout(bloc["name"]+"_scrol",w=self.w*self.scale)
        cmds.frameLayout( label=bloc["name"], collapsable=True,
                             cl=bloc["collapse"],borderVisible=False,
                             w=self.w*self.scale*2.5)#borderStyle='in' ,
        for k,blck in enumerate(bloc["elems"]):
#            print bloc["name"],len(blck),blck
            if len(blck) == 0 :
                continue
            kw = {}
            N = len(blck)
            if N < 6 :
                kw ["columnAlign"+str(N)] = "left" if N == 1 else ["left",]*N
            cmds.rowLayout(numberOfColumns=N,w=self.w*self.scale*2.5,**kw)
            for index, item in enumerate(blck):
                self._drawElem(item,x,y)
            self.endBlock()
        self.endBlock()
#        self.endBlock()
        return y
Exemplo n.º 6
0
    def createBrushSettingsGroup(self,parent):
        group = self.createUIGroup(parent, 'Brush Settings')

        self.createTitledRow(group, 'Brush Shape')
        brushWidth = 35;
        cmds.rowLayout(nc=4,cw4=[brushWidth,brushWidth,brushWidth,brushWidth])
        self.createBrushShapeButtons()
        cmds.setParent("..")
        
        def innerLayout():
            return cmds.rowColumnLayout( numberOfColumns=2,columnWidth=[(1,100),(2,100)])

        self.createTitledRow(group, 'Mode',innerContentConstructor=innerLayout)

        cmds.radioCollection()
        for index,i in enumerate(['Replace','Add','Scale','Smooth']):
            ctrl = self.controls.__dict__['paintMode'+i] = RadioButtonField(self.VAR_PREFIX+'paintMode'+i,defaultValue=1 if index==0 else 0,label=i)
            ctrl.changeCommand.addHandler(self.paintValuesChanged)
            
        
        self.controls.intensitySlider = FloatSliderField()
        self.controls.intensitySlider.flexibleRange = True
        self.createTitledRow(group, 'Intensity',self.controls.intensitySlider.create)
        self.controls.intensitySlider.onChange.addHandler(self.paintValuesChanged)

        self.controls.brushRadiusSlider = FloatSliderField(range=[0,30])
        self.controls.brushRadiusSlider.flexibleRange = True
        self.createTitledRow(group, 'Brush Radius',self.controls.brushRadiusSlider.create)
        self.controls.brushRadiusSlider.onChange.addHandler(self.changeBrushRadius)
Exemplo n.º 7
0
	def create(self):
		if cmds.window('uvShellAlignWindow', exists = True):
			cmds.deleteUI('uvShellAlignWindow')

		self.window = cmds.window(self.window, title = self.title, widthHeight = self.size)
		self.frameForm = cmds.frameLayout(label = " 1. 基準とする UVShell を選択して登録", bgc = (0.5, 0.3, 0.2), cll = False)
		self.setUVSBtn1 = cmds.button(label = "基準 UVShell を登録"  , command = self.registUVBndBox1, height = 30 )
		cmds.rowLayout( numberOfColumns = 1, adj = True)					

				




		cmds.setParent("..")			
		self.frameForm = cmds.frameLayout(label = " 2. 位置を揃えたい UVShell を選択して実行", bgc = (0.2, 0.3, 0.5), cll = False)
		self.distDcheckBox = cmds.radioButtonGrp('radioBtn', label = "", numberOfRadioButtons = 4 ,
							 sl = 1, cl4 = ['left','left','left','left'] , la4 = [ 'Left', 'Right', 'Bottom', 'Top'], adj = True)

		self.backupPathText = cmds.text("※ 2016/1/5 現在、複数UVを選択した状態での位置揃えには対応していません", font = "smallBoldLabelFont", align = 'left');
		self.setUVSBtn2 = cmds.button(label = "選択した UVShell を揃える" , command = self.registUVBndBox2, height = 30 )
		cmds.setParent("..")	
		
		cmds.separator(width = self.width, style = 'in')
		
		cmds.text("【問い合わせ先】 : TAセクション.村岡", bgc = (0.2, 0.2, 0.2), align = 'left', width = self.width);

		cmds.setParent("..")	
		cmds.showWindow()
 def __init__(self):
     self.name = "rsSubstituteAttribute"
     self.title = "rs Substitute Attribute"
     i_windowSize = (300, 110)
     if (cmds.window(self.name, q=1, exists=1)):
         cmds.deleteUI(self.name)
     self.window = cmds.window(self.name, title=self.title)
     s_winColPro2 = cmds.columnLayout(adjustableColumn=True, parent=self.window)
     i_colum3 = (i_windowSize[0] / 6, i_windowSize[0] * 4 / 6, i_windowSize[0] / 6)
     s_winRowField1 = cmds.rowLayout(numberOfColumns=3, adjustableColumn3=2, columnWidth3=(i_colum3), columnAlign=(1, 'center'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)], parent=s_winColPro2)
     cmds.text(label='Source', align='center', parent=s_winRowField1)
     self.sourceText = cmds.textField(cmds.textField(), edit=True, parent=s_winRowField1)
     cmds.button(label='Pick up', c=self.rsPickUpSource, parent=s_winRowField1)
     s_winRowField2 = cmds.rowLayout(numberOfColumns=3, adjustableColumn3=2, columnWidth3=(i_colum3), columnAlign=(1, 'center'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)], parent=s_winColPro2)
     cmds.text(label='Target', align='center', parent=s_winRowField2)
     self.targetText = cmds.textField(cmds.textField(), edit=True, parent=s_winRowField2)
     cmds.button(label='Pick up', c=self.rsPickUpTarget, parent=s_winRowField2)
     cmds.separator(height=5, style="none", hr=True, parent=s_winColPro2)
     i_colum = i_windowSize[0] / 3
     s_winRow1 = cmds.rowLayout(numberOfColumns=3, adjustableColumn3=2, columnWidth3=(5, i_colum, i_colum), columnAlign=(1, 'center'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)], parent=s_winColPro2)
     cmds.separator(height=5, style="none", hr=True, parent=s_winRow1)
     self.delAttr = cmds.checkBox("rsDelSourceAttr", label='Delete Source Attribute', align='right', v=True, parent=s_winRow1)
     cmds.separator(height=5, style="none", hr=True, parent=s_winColPro2)
     self.rsSubs = cmds.button(label='Substitute or Clone', w=100, c=self.rsSubs, parent=s_winColPro2)
     cmds.window(self.window, e=1, w=430, h=103)
     cmds.showWindow(self.window)
     cmds.window(self.window, edit=True, widthHeight=(i_windowSize))
Exemplo n.º 9
0
 def AboutBox(self, *args):
     import os
     
     def GoToWebsite(site):
         cmds.launch( webPage = site)
     
     if cmds.window("AboutWindow", exists = True):
         cmds.deleteUI("AboutWindow")
     cmds.window("AboutWindow")
     cmds.rowLayout("MainLayout", nc = 3, cw3 = [10, 80, 200], rat = [[1, "top", 0],[2, "top", 0],[3, "top", 0]])
     cmds.columnLayout("EmptyColumn", p = "MainLayout")
     cmds.columnLayout("ImageColumn", p = "MainLayout")
     cmds.columnLayout("TextColumn", p = "MainLayout")
     
     cmds.separator(h = 30, p = "TextColumn")
     cmds.text(label = "TurboSquid CheckMate and Publishing Tools for Maya, v1.22", p = "TextColumn")
     cmds.separator(h = 55, p = "TextColumn")
     cmds.text(label = "Created by Titan Software Solutions", p = "TextColumn")
     cmds.separator(h = 55, p = "TextColumn")
     cmds.text(label = "Special thanks to Ashraf Aiad for the use of his UV texture templates", p = "TextColumn")
     
     cmds.separator(h = 10, p = "ImageColumn")
     cmds.iconTextButton(image = os.path.expanduser('~/maya/Turbosquid/CheckMate Tools For Maya/CM_Tools/') + "Logos/CheckMate.png", p = "ImageColumn", c = partial(GoToWebsite, "http://www.turbosquid.com"))
     cmds.separator(h = 20, p = "ImageColumn")
     cmds.iconTextButton(image = os.path.expanduser('~/maya/Turbosquid/CheckMate Tools For Maya/CM_Tools/') + "Logos/TSS.png", p = "ImageColumn", c = partial(GoToWebsite, "http://www.titansoftwaresolutions.net"))
     cmds.separator(h = 20, p = "ImageColumn")
     cmds.iconTextButton(image = os.path.expanduser('~/maya/Turbosquid/CheckMate Tools For Maya/CM_Tools/') + "Logos/PixelCG.png", p = "ImageColumn", c = partial(GoToWebsite, "http://www.pixelcg.com/blog"))
     cmds.separator(h = 10, p = "ImageColumn")
     cmds.showWindow("AboutWindow")
Exemplo n.º 10
0
def transfertSelectionToTarget_window():
	"""
	This definition creates the 'Transfert Selection To Target' main window.
	"""

	cmds.windowPref(enableAll=False)

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

	cmds.window("transfertSelectionToTarget_window",
		title="Transfert Selection To Target",
		width=320)

	spacing = 5

	cmds.columnLayout(adjustableColumn=True, rowSpacing=spacing)

	cmds.rowLayout(numberOfColumns=3, columnWidth3=(125, 150, 130), adjustableColumn=2, columnAlign=(2, "left"), columnAttach=[(1, "both", spacing), (2, "both", spacing), (3, "both", spacing)])
	cmds.text(label="Target:")
	sources_textField = cmds.textField("target_textField")
	cmds.button("pickTarget_button", label="Pick Target!", command=pickTarget_button_OnClicked)
	cmds.setParent(topLevel=True)

	cmds.separator(style="single")

	cmds.button("transfertSelection_button", label="Transfert Selection!", command=transfertSelection_button_OnClicked)

	setUnsetContextHotkeys()
	scriptJob = cmds.scriptJob(uiDeleted=("transfertSelectionToTarget_window", setUnsetContextHotkeys), runOnce=True)

	cmds.showWindow("transfertSelectionToTarget_window")

	cmds.windowPref(enableAll=True)
Exemplo n.º 11
0
def UI():
    mc.frameLayout('Furioso',w=ui.rowWidth,cll=1,bgc=[.2,.2,.2],fn='smallBoldLabelFont',bs='in',l='Furioso')
    
    mc.columnLayout('furiosoObjectConform',cal='center',w=ui.rowWidth-10)
    mc.rowColumnLayout(numberOfColumns=8)
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,ann="Create 10x10 Tile",l= "Tile" ,i= "polyPlane.png",c=partial(delay,'mel.eval','("polyPlane -w 10 -h 10 -sx 10 -sy 10 -ax 0 1 0 -cuv 2 -ch 1")'))	
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,ann="Create 1x1 Tile",l= "Tile" ,i= "plane.png",c=partial(delay,'mel.eval','("polyPlane -w 10 -h 10 -sx 1 -sy 1 -ax 0 1 0 -cuv 2 -ch 1;")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "cube.png",c=partial(delay,'mel.eval','("polyCube -w 10 -h 10 -d 10 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "historyPulldownIcon.png",bgc=[.5,0,0],c=partial(delay,'mel.eval','("DeleteHistory")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "",en=0,c=partial(delay,'mel.eval','("polyPlane -w 10 -h 10 -sx 1 -sy 1 -ax 0 1 0 -cuv 2 -ch 1;")'))  
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,ann="Set Camera to Meters",en=1,l= "Set Camera" ,i= "CameraAE.png",c=partial(delay,'mel.eval','("rcSetCameraClip .5 100000")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "polyQuad",c=partial(delay,'mel.eval','("TogglePolyCount")'))
    mc.iconTextCheckBox(w=ui.iconSize,h=ui.iconSize,ann="Snap",l= "Tile" ,i= "snapGrid.png",onc=partial(delay,'rc.stepSnap','(5,1)'),ofc=partial(delay,'rc.stepSnap','(5,0)'),v=mc.manipMoveContext('Move',q=1,s=1))    
    mc.setParent('..')

    mc.rowLayout(w=ui.rowWidth,numberOfColumns=3)
    mc.button(w=ui.rowWidth/3,h=ui.btn_large,al='left',l=' + ',c=partial(delay,'btnPlus','(mc.ls(sl=1))'))  #
    mc.button(h=ui.btn_large,w=ui.rowWidth/3,al='center',l=' - ',c=partial(delay,'btnDel','("sel")')) 
    mc.button(h=ui.btn_large,w=ui.rowWidth/3,al='right',l='NUKE',c=partial(delay,'btnDel','("all")'))
    mc.setParent('..')
    
    mc.checkBox('Object',vis=0,l='Object',v=int(furiosoPrefs.get('Object')),cc=partial(delay,'furiosoPrefs.checkBox',"('Object')"))
    mc.checkBox('Material',l='Material',vis=1,v=int(furiosoPrefs.get('Material')),cc=partial(delay,'furiosoPrefs.checkBox',"('Material')"))
    mc.checkBox('Flag',l='Flag',vis=0,v=int(furiosoPrefs.get('Flag')),cc=partial(delay,'furiosoPrefs.checkBox',"('Flag')"))
    mc.iconTextScrollList('FuriosoObjScroll',w=ui.rowWidth,h=500)
    mc.setParent('furiosoObjectConform')
    mc.setParent('..')
    
    buildUILists()
Exemplo n.º 12
0
    def createWin(self):

        # Creates window
        self.mainWin = cmds.window(self.winName, sizeable=True)

        # Main frame
        cmds.frameLayout(
            "mainFrameLayout",
            labelVisible=False,
            borderVisible=False,
            w=10,
            marginHeight=0,
            marginWidth=0,
            labelIndent=0,
            collapsable=False,
        )
        cmds.rowLayout(numberOfColumns=2, adjustableColumn=1, columnAttach=([2, "right", self.barOffset]), h=37)
        cmds.text(label="")
        self.subUIsLayout = cmds.rowLayout("mainLayout", numberOfColumns=len(SUB_UI_MODS) + 2)

        # subUIs
        self.uiList = [eval("%s.%s%s_Gui" % (loopUi, loopUi[0].upper(), loopUi[1:])) for loopUi in SUB_UI_MODS]
        # append general tools ui
        self.uiList.append(generalToolsUI.GeneralTools_Gui)
        # define subUis
        self.subUIs = [loopUi(self.subUIsLayout, self.buttonSize) for loopUi in self.uiList]

        self.addSubUIs()

        # shows toolbar
        cmds.toolBar(self.toolbarName, area="bottom", content=self.mainWin, allowedArea=["bottom"])
Exemplo n.º 13
0
 def installFalloffGradient(self):
     """"""
     layout = cmds.frameLayout( "falloffLayout",
                                l='Falloff:',
                                cl=True,
                                cll=True,
                                mw=5,
                                mh=5,
                                ec=lambda *args: self.resizeMainWindow(),
                                cc=lambda *args: self.resizeMainWindow())
     
     # Install falloff mode scroll List
     cmds.rowLayout(nc=2, adj=1)
     falloffMode = self.installFalloffOption()
     resetBtn = cmds.button(l='Reset', c=lambda *args: self.resetFalloff(), w=40)
     cmds.setParent( '..' )
     
     # Install falloff gradient control
     self.gradient = cmds.gradientControlNoAttr( 'falloffCurve', h=90)
     self.copyFromMayaFalloffCurve()
     cmds.gradientControlNoAttr( 'falloffCurve',
                                 e=True,
                                 optionVar='falloffCurveOptionVar',
                                 changeCommand=lambda *args: self.changeSoftSelectValue(),
                                 currentKeyChanged=lambda *args: self.softSelectCurveKeyChanged() )
     
     # Install interpolation scroll List
     interpolation = self.installInterpolationOption()
     
     cmds.setParent( '..' )
     return layout
Exemplo n.º 14
0
 def installConvertOption(self):
     """"""
     cmds.rowLayout(nc=2, adj=2)
     cmds.text(l=' Convert:', fn='boldLabelFont')
     self.keepCheck = cmds.iconTextCheckBox( st='textOnly', l='Keep original', v=True )
     cmds.setParent( '..' )
     cmds.separator( style='none' )
Exemplo n.º 15
0
def SundayGeometryCacheImportUI():
    global sundayGeometryCacheImportUI
    print 'SundayGeometryCacheImport'
    exportDir = cmds.workspace(q = True, rootDirectory = True) + 'data'
    cacheDir = os.listdir(exportDir)
    SundayMayaGuiPath = mel.eval('getenv SundayGui;')
    
    try:
        if cmds.window(sundayGeometryCacheImportUI, exists = True):
            cmds.deleteUI(sundayGeometryCacheImportUI)
        
        sundayGeometryCacheImportUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayGeometryCacheImport.ui')
    except:
        sundayGeometryCacheImportUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayGeometryCacheImport.ui')

    cmds.text('SundayGeometryCachePath', edit = True, label = exportDir)
    cmds.setParent(sundayGeometryCacheImportUI)
    cmds.setParent(cmds.button('SundayGeometryImportDummyButtonToGrabParent', query = True, fullPathName = True, parent = True))
    scrollLayout = cmds.scrollLayout(childResizable = True)
    for curCacheDir in cacheDir:
        if curCacheDir.split('.')[0] != '':
            cmds.rowLayout(numberOfColumns = 2, adjustableColumn = 1)
            cmds.button(height = 26, label = curCacheDir, command = 'import SundayGeometryCachePy\nreload(SundayGeometryCachePy)\nSundayGeometryCachePy.SundayGeometryCacheImportFile("' + exportDir + os.sep + curCacheDir + '")')
            cmds.button(height = 26, label = 'Delete', command = 'import SundayGeometryCachePy\nreload(SundayGeometryCachePy)\nSundayGeometryCachePy.SundayGeometryCacheDelete("' + exportDir + os.sep + curCacheDir + '")')
            cmds.setParent('..')
            continue
    
    cmds.setParent(sundayGeometryCacheImportUI)
    cmds.setParent(cmds.button('SundayGeometryImportDummyButtonToGrabParent', query = True, fullPathName = True, parent = True))
    cmds.text('sundayGeoCacheNodeLabel', edit = True, label = len(cmds.ls(type = 'cacheFile', long = True)))
    cmds.showWindow(sundayGeometryCacheImportUI)
    if platform.system() == 'Windows':
        cmds.window(sundayGeometryCacheImportUI, edit = True, topLeftCorner = [
            100,
            100])
Exemplo n.º 16
0
	def __init__(self): 
		### Initialize, definitions		
	    	if(mc.window("ms_orientJoint",exists=True)):
            	    mc.deleteUI("ms_orientJoint",window=True)
	    	mc.window("ms_orientJoint",title="Orient Joint v1.0",rtf=True)
	    	mc.columnLayout()
	    	
	    	mc.rowLayout(nc=2)
	    	mc.text(" ")
	    	mc.text("Orient joint A to joint B")
	    	mc.setParent("..")
	    	
	    	mc.separator(w=500)

		self.aimAxisField = mc.radioButtonGrp(label="Aim Axis",labelArray3=['x','y','z'],nrb=3,sl = 1)
		self.aimAxisPolField = mc.radioButtonGrp(label="Aim Axis Polarity",labelArray2=['+','-'],nrb=2,sl = 1)
		self.upAxisField = mc.radioButtonGrp(label="Up Axis",labelArray3=['x','y','z'],nrb=3,sl  = 2)
		self.upPolarityField = mc.radioButtonGrp(label="Up Axis Polarity",labelArray2=['+','-'],nrb=2,sl=1)
		
		mc.separator(w=500)
		
		mc.rowLayout(nc=3)
		mc.text(" ")
		mc.button(label="-=Orient=-",c=self.orient)
		mc.button(label="-=None Orient=-",c=self.noneOrient)
		
		mc.setParent("..")

	    	mc.showWindow("ms_orientJoint")
Exemplo n.º 17
0
    def createUI (self, *pArgs):
        if cmds.window(self.windowID, exists = True):
            cmds.deleteUI(self.windowID)
        # initialize window properties
        cmds.window(self.windowID, title = 'cleanupUI', sizeable = True, resizeToFitChildren = True)
        cmds.columnLayout(columnAttach = ('both', 5), columnWidth = 265)

        cmds.rowLayout(numberOfColumns = 3, columnWidth3 = (80, 100, 80))
        cmds.text(label = 'Threshold:', align = 'right', width = 80)
        threshold = cmds.floatField(visible = True, minValue = 0.001, value = 0.1, width = 50, pre = 3, step = 0.01)
        findFacesButton = cmds.button(label = 'findFaces', width = 70 , align = 'center')
        cmds.setParent('..')

        cmds.rowLayout(numberOfColumns = 1, columnWidth1 = (250))
        cmds.text(label = 'List of shells with number of triangles:', align = "center", width = 230)
        cmds.setParent('..')
        cmds.rowLayout(numberOfColumns = 1, columnWidth1 = (250))
        scrollList = cmds.textScrollList(width = 250)
        cmds.setParent('..')

        cmds.rowLayout(numberOfColumns = 1, columnWidth1 = (250))
        progress = cmds.text(label = "Press 'Find' to calculate shells", align = 'left', width = 200, height = 10)
        cmds.setParent('..')

        cmds.button(findFacesButton, e = 1, command = partial(self.__findFacesCallback, threshold, progress))

        cmds.rowLayout(numberOfColumns = 3, columnWidth3 = (80, 80, 80))
        cmds.button(label = 'Find', command = partial(self.__applyCallback, threshold, scrollList, progress), width = 70 , align = 'center')
        cmds.button(label = 'Select', command = partial(self.__applySelectCallback, scrollList, progress), width = 70, align = 'center')
        cmds.button(label = 'Cancel', command = self.__cancelCallback, width = 70, align = 'center')
        cmds.setParent('..')

        cmds.showWindow()
Exemplo n.º 18
0
	def __init__(self): #(Initialization)

		### Initialize, definitions		
		if(mc.window("ms_orientObject",exists=True)):
			mc.deleteUI("ms_orientObject",window=True)
		mc.window("ms_orientObject",title="Orient Object v1.0",rtf=True)
		mc.columnLayout()

		mc.text(" ")
		mc.rowLayout(nc=4,cw4=(25,130,150,200) )
		mc.text(" ")
		mc.text("Orient object A to object B.")
		mc.text("Unparents during operation, so ")
		mc.text("constraints should not be applied yet.")
		mc.setParent("..")
		mc.text(" ")

		mc.separator(w=500)
		self.aObjFld = mc.textFieldButtonGrp( label='Object A:',bl='Load',bc=self.loadAObj,text='pCube1')
		self.bObjFld = mc.textFieldButtonGrp( label='Object B:',bl='Load',bc=self.loadBObj,text='inside_cube_small')
		mc.separator(w=500)
		
		mc.rowLayout(nc=2,cw2=(200,300))
		mc.text(" ")
		mc.button(label="-=Match Orientation=-",c=self.orient)
		mc.setParent("..")

		mc.showWindow("ms_orientObject")
Exemplo n.º 19
0
 def build(self):
     if mc.windowPref(self.win, exists=1):
         mc.windowPref(self.win, remove=1)
     if mc.window(self.win,exists=1):
         mc.deleteUI(self.win)
     mc.window( self.win, title=self.title, widthHeight=(500, 210) )
     cl1 = mc.columnLayout( columnAttach=('both', 2), rowSpacing=3, columnWidth=500, adjustableColumn = True)
     mc.radioCollection()
     self.mouth = mc.radioButton( l='user import', select=1, p=cl1 )
     self.autoR = mc.radioButton( l='auto import', p=cl1 )
     mc.separator()
     mc.frameLayout('selected')
     mc.rowLayout(numberOfColumns=3, columnWidth3=(80, 75, 150), adjustableColumn=2, columnAlign=(1, 'right'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)] )
     mc.text(l='Mode')
     mc.columnLayout()
     mc.radioCollection()
     self.prop = mc.radioButton( l='Prop', select=1 )
     self.character = mc.radioButton( l='Character' )
     mc.setParent( '..' )
     mc.setParent( '..' )
     self.numText = mc.floatFieldGrp( l='Num' )
     self.txtProp = mc.textFieldButtonGrp( label='File Path', text='', buttonLabel='Browse', cw3 = (40,400,50), adjustableColumn3 = 2, cl3 = ('left', 'center', 'right'), bc = self.browse,cc=self.getPath )
     #mc.separator()
     #self.txtCharacter = mc.textFieldButtonGrp( label='Path', text='', buttonLabel='Browse', cw3 = (40,400,50), adjustableColumn3 = 2, cl3 = ('left', 'center', 'right'), bc = self.browse,cc=self.getPath )
     #mc.separator()
     mc.separator(p=cl1)
     mc.button( 'importR', l='Import   Reference   File', p=cl1 )
     mc.setParent( '..' )
Exemplo n.º 20
0
def snapOnClosestVertex_window():
	"""
	Creates the 'Snap On Closest Vertex' vertex window.
	"""

	cmds.windowPref(enableAll=False)

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

	cmds.window("snapOnClosestVertex_window",
		title="Snap On Closest Vertex",
		width=320)

	spacing = 5

	cmds.columnLayout(adjustableColumn=True, rowSpacing=spacing)

	cmds.rowLayout(numberOfColumns=3, columnWidth3=(125, 150, 130), adjustableColumn=2, columnAlign=(2, "left"), columnAttach=[(1, "both", spacing), (2, "both", spacing), (3, "both", spacing)])
	cmds.text(label="Reference Object:")
	referenceObject_textField = cmds.textField("referenceObject_textField")
	cmds.button("getReferenceObject_button", label="Get Reference Object!", command=getReferenceObject_button_OnClicked)
	cmds.setParent(topLevel=True)

	cmds.separator(style="single")

	cmds.button("snapIt_button", label="Snap It!", al="center", command=snapIt_button_OnClicked)

	cmds.showWindow("snapOnClosestVertex_window")
	cmds.windowPref(enableAll=True)
    def _namespace_window(self, path, sg_publish_data, importOrRef = True):
        """
        Create a reference with the same settings Maya would use
        if you used the create settings dialog.
        
        :param path: Path to file.
        :param sg_publish_data: Shotgun data dictionary with all the standard publish fields.
        """
        if not os.path.exists(path):
            raise Exception("File not found on disk - '%s'" % path)
        
        self.window = cmds.window( title="Enter Namespace/prefix to use", iconName='Short Name', sizeable=False, mnb=False,mxb=False,rtf=True)
        cmds.columnLayout( adjustableColumn=True, rs=10,columnAttach=('both', 2),height=10,width=250)
        cmds.setParent( '..' )
        layoutTest = cmds.columnLayout( adjustableColumn=True, rs=10, cal='center', co=('both',20))
        cmds.setParent( '..' )
        
        cmds.rowLayout( numberOfColumns=3, columnAlign3=('left','left','left'))
        cmds.button( label='Use as Namespace', command = partial(self._create_with_ns, path, importOrRef))
        cmds.button( label='Use as Prefix', command = partial(self._create_with_prefix, path, importOrRef))
        cmds.button( label='Cancel', command=('cmds.deleteUI(\"' + self.window + '\", window=True)') )
        cmds.setParent( layoutTest )
        
        cmds.rowLayout( numberOfColumns=2,columnAlign2=('left','left'))
        cmds.text( label='Namespace/prefix:')
        self.ns_win = cmds.textField(text='_')
        cmds.setParent( layoutTest )
        cmds.showWindow( self.window )

        # make a name space out of entity name + publish name
        # e.g. bunny_upperbody                
        namespace = "%s %s" % (sg_publish_data.get("entity").get("name"), sg_publish_data.get("name"))
        namespace = namespace.replace(" ", "_")
Exemplo n.º 22
0
    def AverageUI(self):
        import maya.cmds as cmds
	import maya.mel as mel
	import sys

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

        cmds.window('AverageTool') 
        grid=cmds.gridLayout( numberOfColumns=2, cellWidthHeight=(120, 150) )
        column=cmds.columnLayout()
        cmds.button('Creat',c='creat()',h=100)
        cmds.button('Key',c='key()',h=50)
        cmds.columnLayout(column,edit=1,columnAttach=('both',0),adj=1,co=('both',50),columnWidth=120)
        cmds.setParent(column)
        cmds.setParent( '..' )



        cmds.frameLayout( label='Average', borderStyle='in' )
        cmds.columnLayout()
        cmds.rowLayout( numberOfColumns=3, columnWidth3=(35, 30, 35), adjustableColumn=2, columnAlign=(1, 'right'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)] )
        cmds.intField('min',minValue=0,value=0)
        cmds.text('To')
        cmds.intField('max',minValue=0, value=0)
        cmds.setParent( '..' )
        cmds.setParent( '..' )

        cmds.frameLayout( label='Iterations', borderStyle='out' )
        cmds.intField('iterations',minValue=0,maxValue=10,value=0)


        cmds.frameLayout( label='Key', borderStyle='out' )
        cmds.button('Delect',c='Delect()')
        cmds.showWindow()
Exemplo n.º 23
0
 def __init__(self,*args):
     if(cmds.window("rbbnChainBuilder",exists=True)):
         cmds.deleteUI("rbbnChainBuilder",window=True)
 	
     cmds.window("rbbnChainBuilder",title="Build Ribbon Rig v1.0", rtf=True)
     cmds.columnLayout()
     
 	self.prefixFld = cmds.textFieldGrp(label='Prefix',text='L_upLegRbbn_')	        
     self.ribbonFld = cmds.textFieldButtonGrp( label="Ribbon:", buttonLabel="Load", bc = self.loadRibbon)#,text='main_plane'  )
     self.startFld = cmds.textFieldButtonGrp( label="Start Control:", buttonLabel="Load", bc = self.loadStart,text='cnt_1'  )
     self.endFld = cmds.textFieldButtonGrp( label="End Control:", buttonLabel="Load", bc = self.loadEnd,text='cnt_2' )
     self.numFld = cmds.intFieldGrp(label='Controls:',nf=1,v1=5)
     self.skinFld = cmds.intFieldGrp(label='Skin Joints:',nf=1,v1=5)
     self.buildFld = cmds.radioButtonGrp(nrb=2,labelArray2=('U','V'),label='Build along:',sl=1)
     
     
     cmds.frameLayout(label='Control Options: ',fn='boldLabelFont',cll=False)
     cmds.columnLayout()
     self.crvCreateFld = cmds.radioButtonGrp(nrb=2,labelArray2=('Yes','No'),label='Create bend-bo controls?',sl=1)
     self.radFld = cmds.floatFieldGrp(label='Radius:',nf=1,v1=0.2)
     self.crvNrFld = cmds.radioButtonGrp(nrb=3,labelArray3=('X','Y','Z'),label='Controller normal Axis:',sl=2)
     cmds.setParent("..")
     cmds.setParent("..")
     
     cmds.rowLayout(nc=2,cw2=(200,100))
     cmds.text(' ')
     cmds.button(label = "          Create", c = self.buildRig,w=100 )
 	cmds.setParent('..')
 		
     cmds.showWindow("rbbnChainBuilder")
def channelbox_command_freezeUI():
    with sysCmd.Undo(0):
        if cmds.window("freezeWindowBox", q=1, exists=1):
            cmds.deleteUI("freezeWindowBox")
        frz_window = cmds.window("freezeWindowBox", title="Freeze", rtf=1, s=0, tbm=1, tlb=1)
        layout = cmds.columnLayout(p=frz_window)
        layout_top = cmds.rowLayout(nc=4, p=layout)

        width = 25
        cmds.button(l="T", w=width, ann="Freeze Translate",
                    c=sysCmd.rpartial(channelbox_command_freezeTranslate, "", "", "Freeze Translate"), p=layout_top)
        cmds.button(l="R", w=width, ann="Freeze Rotate",
                    c=sysCmd.rpartial(channelbox_command_freezeRotate, "", "", "Freeze Rotate"), p=layout_top)
        cmds.button(l="S", w=width, ann="Freeze Scale",
                    c=sysCmd.rpartial(channelbox_command_freezeScale, "", "", "Freeze Scale"), p=layout_top)
        cmds.button(l="A", w=width, ann="Freeze All",
                    c=sysCmd.rpartial(channelbox_command_freezeAll, "", "", "Freeze All"), p=layout_top)

        layout_bot = cmds.rowLayout(nc=4, p=layout)
        cmds.button(l="TS", w=width, ann="Freeze Translate / Scale",
                    c=sysCmd.rpartial(channelbox_command_freezeTranslateScale, "", "", "Freeze Translate / Scale"),
                    p=layout_bot)
        cmds.button(l="TR", w=width, ann="Freeze Translate / Rotate",
                    c=sysCmd.rpartial(channelbox_command_freezeTranslateRotate, "", "", "Freeze Translate / Rotate"),
                    p=layout_bot)
        cmds.button(l="RS", w=width, ann="Freeze Rotate / Scale",
                    c=sysCmd.rpartial(channelbox_command_freezeRotateScale, "", "", "Freeze Rotate / Scale"),
                    p=layout_bot)
        cmds.button(l="JO", w=width, ann="Freeze Joint Orient",
                    c=sysCmd.rpartial(channelbox_command_freezeJointOrient, "", "", "Freeze Joint Orient"),
                    p=layout_bot)
        cmds.window(frz_window, e=1, wh=(1, 1), rtf=1)
        cmds.showWindow(frz_window)
        def populate_render_layer_layout(self, attr):
            if self.render_layer_layout is not None:
                node = attr.split('.')[0]  
                # delete old ui
                children = cmds.columnLayout(self.render_layer_layout, q=True, childArray=True)
                if children is not None:
                    for name in children:
                        cmds.deleteUI(name)

                for i in range(50):
                    i += 1

                    layer_name = 'render_layer_{0}_name'.format(i)

                    if cmds.attributeQuery(layer_name, exists=True, node=node):
                        cmds.setParent(self.render_layer_layout)
                        current_render_layer_layout = cmds.rowLayout(nc=5)
                        for n, width in enumerate(self.render_layer_layout_widths):
                            cmds.rowLayout(current_render_layer_layout, e=True, cw=[n + 1, width])
                        cmds.textField(cc=partial(self.set_render_layer_name, node, i), text=cmds.getAttr('{0}.render_layer_{1}_name'.format(node, i)))
                        entity_type_menu = cmds.optionMenu(cc=partial(self.set_render_layer_type, node, i))
                        for entity_type in ms_commands.RENDER_LAYER_ENTITY_TYPES:
                            cmds.menuItem(label=entity_type)
                        cmds.optionMenu(entity_type_menu, e=True, v=cmds.getAttr('{0}.render_layer_{1}_type'.format(node, i)))
                        pattern_text_field = cmds.textField(cc=partial(self.set_render_layer_pattern, node, i), text=cmds.getAttr('{0}.render_layer_{1}_pattern'.format(node, i)))
                        cmds.textField(cc=partial(self.set_render_layer_order, node, i), text=cmds.getAttr('{0}.render_layer_{1}_order'.format(node, i)))
                        cmds.button(' - ', height=20, command=partial(self.remove_render_layer, node, i))
                
                cmds.setParent(self.render_layer_layout)
                current_render_layer_layout = cmds.rowLayout(nc=2)
                cmds.button(' + ', command=partial(self.add_render_layer, node))
Exemplo n.º 26
0
    def postInstallDialog():
        '''
        Displays a dialog window to confirm the installation for MRT.
        '''

        dialogWin = cmds.window(title='MRT Start Up', resizeToFitChildren=True, 
                                        maximizeButton=False, minimizeButton=False, sizeable=False)
        
        mainCol = cmds.columnLayout(width=500, rowSpacing=15)
        
        cmds.separator(style='none')
        cmds.text(label='Modular rigging tools has been installed.', align='center', width=400)
        cmds.text(label='Please restart maya.', font='boldLabelFont', align='center', width=400)
        
        cmds.rowLayout(numberOfColumns=2, columnWidth=[(1, 150), (2, 100)])
        
        cmds.separator(style='none')
        cmds.button(label='OK', command=('import maya.cmds; maya.cmds.deleteUI(\"'+dialogWin+'\")'), width=100, align='center')
        
        cmds.setParent(mainCol)
        cmds.separator(style='none')
        cmds.showWindow(dialogWin)
        
        try: cmds.windowPref(dialogWin, remove=True) 
        except: pass
Exemplo n.º 27
0
def setUIObjectVisibility(item, visState):
    """
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    DESCRIPTION:
    Toggle for turning off and on the visibility of a menu section

    ARGUMENTS:
    stateToggle(string) - this should point to the variable holding a (bool) value
    listOfItems(list) - list of menu item names to change

    RETURNS:
    locatorName(string)
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """
    uiType = mc.objectTypeUI(item)

    if uiType == 'staticText':
        mc.text(item, edit = True, visible = visState)
    elif uiType == 'separator':
        mc.separator(item, edit = True, visible = visState)
    elif uiType == 'rowLayout':
        mc.rowLayout(item, edit = True, visible = visState)
    elif uiType == 'rowColumnLayout':
        mc.rowColumnLayout(item, edit = True, visible = visState)
    elif uiType == 'columnLayout':
        mc.columnLayout(item, edit = True, visible = visState)
    elif uiType == 'formLayout':
        mc.formLayout(item, edit = True, visible = visState)
        #print ('%s%s%s%s%s%s%s' % ('"python(mc.',uiType,"('",item,"', edit = True, visible = ",visState,'))"'))
        #mel.eval(('%s%s%s%s%s%s%s' % ('"python(mc.',uiType,"('",item,"', edit = True, visible = ",visState,'))"')))
        #mc.separator(item, edit = True, visible = visState)
    else:
        warning('%s%s%s' %('No idea what ', item, ' is'))
	def displayUI(self):
		
		windowName = 'LCMTUIWindow'
		if cmds.window(windowName, exists=True):
			cmds.deleteUI(windowName)
		window = cmds.window(windowName, menuBar = True,t="LCMT v3.1.1")
		fileMenu = cmds.menu( label='Manage Light Types')
		cmds.menuItem( label='Add More Light Types',command=lambda *args:self.addLightTypes()) 
		cmds.menuItem( label='See Current Light Types', command=lambda *args:self.displayLightTypes()) 
		cmds.menuItem( label='Reset Light Types to Default Values', command=lambda *args:self.resetLightTypesToDefault()) 
		
		cmds.paneLayout( configuration='vertical2' )
		lightStageColumn = cmds.columnLayout(adjustableColumn=True)
		cmds.text('Lights in the SCENE')
		lights = cmds.ls(dag =True,visible=True,lights=True, type='mentalrayIblShape')  
		lightList = cmds.iconTextScrollList(allowMultiSelection=True,  append=lights)
		cmds.rowLayout(numberOfColumns = 2)
		useGroupLights = cmds.checkBox( label='Group Lights', onCommand = lambda *args: self.updateScollList(True, lightList), offCommand = lambda *args: self.updateScollList(False, lightList))    
		cmds.checkBox( label='Save Images?', cc = lambda *args: self.toggleSaveImages())  
		cmds.setParent('..')
		cmds.iconTextScrollList(lightList,edit=True,selectCommand=lambda *args: cmds.select(self.getElementsFromLightScrollList(lightList,useGroupLights),vis=True))    
		cmds.button(label='Render Lights!', command = lambda *args: self.renderAllLights(self.getElementsFromLightScrollList(lightList,useGroupLights),cmds.checkBox(useGroupLights, query=True, value=True)))  
		cmds.setParent('..')
		renderLayersColumn = cmds.columnLayout(adjustableColumn=True)
		#new column    
		cmds.text('Geometry in the SCENE')
		geometry =  cmds.ls(geometry=True)
		#take out the ibl shapes from the geo selection
		geometry = list(set(geometry) - set(lights))   
		geoList = cmds.iconTextScrollList(allowMultiSelection=True, append=geometry,selectCommand=lambda *args: cmds.select(cmds.iconTextScrollList(geoList, query=True, si=True )) )
		cmds.text('Create Render Layers from selected geometry and lights')      
		cmds.button(label='Create Render Layers!', command = lambda *args: self.createLayersFromLights(cmds.iconTextScrollList(geoList, query=True, si=True ),self.getElementsFromLightScrollList(lightList,useGroupLights)))  
		cmds.setParent('..')
		cmds.showWindow()
Exemplo n.º 29
0
    def __init__(self):
        if cmds.window('ms_info_window', query=True, exists=True):
            cmds.deleteUI('ms_info_window')

        window = cmds.window('ms_info_window', title='About Mayaseed', sizeable=False)

        cmds.columnLayout(rs=10, columnOffset=['both', 20], width=600)

        cmds.rowLayout(numberOfColumns=2)
        cmds.text('', width=30)
        cmds.image(image=os.path.join(ROOT_DIRECTORY, 'graphics', 'mayaseed.png'))
        cmds.setParent('..')

        cmds.text('Version ' + MAYASEED_VERSION)
        cmds.text('Mayaseed is a Maya plugin for exporting scenes to the appleseed renderer.')
        cmds.text('Written by Jonathan Topf.')

        cmds.rowLayout(numberOfColumns=4)
        cmds.button(label='Mayaseed website', command=('import webbrowser\nwebbrowser.open_new_tab("' + MAYASEED_URL + '")'))
        cmds.button(label='appleseed website', command=('import webbrowser\nwebbrowser.open_new_tab("' + APPLESEED_URL + '")'))
        cmds.text('', width=166)
        cmds.button(label='Close', command=('import maya.cmds as cmds\ncmds.deleteUI(\"' + window + '\", window=True)'), width=100)
        cmds.setParent('..')

        cmds.text('')

        cmds.setParent('..')

        cmds.showWindow(window)
Exemplo n.º 30
0
def objectChooseWin():
    name = "transferAttrs"
    windowSize = (300, 100)
    if (cmds.window(name, exists=True)):
        cmds.deleteUI(name)
    window = cmds.window(name, title=name, width=100, height=50)
    cmds.columnLayout("mainColumn", adjustableColumn=True)
    cmds.rowLayout("nameRowLayout01", numberOfColumns=2, parent="mainColumn")
    cmds.text(label="mast_obj  ")
    pathMatchObject = cmds.textField(tx="VRayMtl1")
    cmds.rowLayout("nameRowLayout02", numberOfColumns=2, parent="mainColumn")
    cmds.text(label="child_obj")
    pathChildObject = cmds.textField(tx="VRayMtl2")
    cmds.rowLayout("nameRowLayout2.5", numberOfColumns=10, parent="mainColumn")
    cmds.rowLayout("nameRowLayout4.5", numberOfColumns=10, parent="mainColumn")
    cmds.rowLayout("nameRowLayout05", numberOfColumns=1, parent="mainColumn")
    cmds.button(label="xfer attrs",
                command=partial(xferNode, pathMatchObject, pathChildObject))
    cmds.showWindow()
Exemplo n.º 31
0
 def buildList(self):
     # separate lights to different groups
     lightGroupList = [[] for x in xrange(self.lightGroupAmount+1)]
     displayList = []
     sceneLights = self.getSceneLights()
     for lgt in sceneLights:
         if lgt.hasAttr("mtoa_constant_lightGroup"):
             groupId = lgt.getAttr("mtoa_constant_lightGroup")
             if groupId > self.lightGroupAmount or groupId < 0:
                 lgt.setAttr('mtoa_constant_lightGroup', 0)
                 lightGroupList[0].append(lgt.name())
             else:
                 lightGroupList[groupId].append(lgt.name())
         else:
             lightGroupList[0].append(lgt.name())
     # build light list and group number
     mc.rowLayout(nc = 2,cw = [(1,30),(2,240)],cal = [(1,'right'),(2,'left')], rat = [(1,'top',0),(2,'top',0)])
     mc.rowColumnLayout(nc = 1, cw = (1,30),cal = (1,'center'))
     # build the light list with the group number > 0 
     for i in range(1,self.lightGroupAmount+1):
         for obj in lightGroupList[i]:
             shortName = mc.listRelatives(obj,p=True)
             longName = mc.listRelatives(obj,p=True,f=True)
             splitVar = len(longName[0].split('|'))
             if splitVar <= 2:
                 mc.text(l=i,bgc = self.colorList[(i-1)-(i/10)*10])
                 displayList.append(shortName[0])
             else :
                 mc.text(l=i,bgc = self.colorList[(i-1)-(i/10)*10])
                 displayList.append(longName[0])
     # build the light list with group number = 0
     for obj in lightGroupList[0]:
         shortName = mc.listRelatives(obj,p=True)
         longName = mc.listRelatives(obj,p=True,f=True)
         splitVar = len(longName[0].split('|'))
         if splitVar <= 2:
             mc.text(l='')
             displayList.append(shortName[0])
         else:
             mc.text(l='')
             displayList.append(longName[0])
     mc.setParent('..')
     mc.textScrollList('mainList', ams = True, w = 240, h = 360, append = displayList)
Exemplo n.º 32
0
    def createMakePruneWeightsGroup(self, layout):
        self.controls.pruneWeightsGroup = group = self.createUIGroup(
            layout, 'Prune Small Weights')

        self.createFixedTitledRow(group, title="Prune elements")
        self.controls.pruneWeights = CheckBoxField(
            self.VAR_PRUNE_PREFIX + "pruneWeights", "Influence weights", True)
        self.controls.pruneMask = CheckBoxField(
            self.VAR_PRUNE_PREFIX + "pruneMask", "Mask", True)

        self.createFixedTitledRow(group, title="Prune influences below")
        self.controls.pruneWeightsThreshold = FloatField(
            self.VAR_PRUNE_PREFIX + 'pruneWeightsThreshold',
            minValue=0,
            maxValue=1,
            step=0.001,
            defaultValue=0.01,
            annotation=
            'Influence weights lower than this value will be set to zero')

        self.createFixedTitledRow(group, title="Prune mask below")
        self.controls.pruneMaskThreshold = FloatField(
            self.VAR_PRUNE_PREFIX + 'pruneMaskThreshold',
            minValue=0,
            maxValue=1,
            step=0.001,
            defaultValue=0.01,
            annotation='Mask values lower than this value will be set to zero')

        cmds.setParent(group)

        cmds.rowLayout(nc=2,
                       adjustableColumn=2,
                       columnWidth2=[Constants.BUTTON_WIDTH_SMALL, 50],
                       columnAttach2=["both", "both"],
                       columnAlign2=["center", "center"])
        BaseTab.createHelpButton(
            SkinToolsDocs.ASSIGNWEIGHTS_MAKERIGID_INTERFACE)
        cmds.button(height=Constants.BUTTON_HEIGHT,
                    label='Prune',
                    command=lambda *args: self.execPruneWeights())

        cmds.setParent(layout)
Exemplo n.º 33
0
def showBuildWindow(arg):
    labelWidth = 100
    fieldWidth = 100

    cmds.window(uiWindowName, title = 'SSDS')
    cmds.formLayout(uiFormName)
    cmds.columnLayout(uiFormLayoutName, rowSpacing = 5)

    # joints
    cmds.rowLayout(uiNumJointsName[0], numberOfColumns = 2,
                   columnWidth2 = (labelWidth, fieldWidth),
                   columnAlign2 = ('right', 'right'))
    cmds.text(label = '# Joints')
    cmds.intField(uiNumJointsName[1], minValue = 0, maxValue = 100, value = 0, width = fieldWidth)
    cmds.setParent('..')

    # max influences
    cmds.rowLayout(uiMaxInfluenceName[0], numberOfColumns = 2,
                   columnWidth2 = (labelWidth, fieldWidth),
                   columnAlign2 = ('right', 'right'))
    cmds.text(label = 'Max Influences')
    cmds.intField(uiMaxInfluenceName[1], minValue = 1, maxValue = 8, value = 4, width = fieldWidth)
    cmds.setParent('..')

    # iterations
    cmds.rowLayout(uiNumIterationsName[0], numberOfColumns = 2,
                   columnWidth2 = (labelWidth, fieldWidth),
                   columnAlign2 = ('right', 'right'))
    cmds.text(label = '# Iterations')
    cmds.intField(uiNumIterationsName[1], minValue = 0, maxValue = 100, value = 10, width = fieldWidth)
    cmds.setParent('..')

    # transform type
    cmds.rowLayout('SsdsTransformTypeLayout', numberOfColumns = 2,
                   columnWidth2 = (labelWidth, fieldWidth),
                   columnAlign2 = ('right', 'right'))
    cmds.text(label = 'Transform Type')
    cmds.columnLayout('temporary', rowSpacing = 3)
    cmds.radioCollection(uiTransformRadioCollectionName)
    cmds.radioButton(uiTransformNames[0], label = 'T')
    cmds.radioButton(uiTransformNames[1], label = 'R+T')
    cmds.radioButton(uiTransformNames[2], label = 'S+R+T')
    cmds.radioCollection(uiTransformRadioCollectionName, edit = True, select = uiTransformNames[2])
    cmds.setParent(uiFormLayoutName)

    # build
    cmds.button(uiBuildButtonName, label='Build', command = invokeBuild, width = labelWidth + fieldWidth)
    
    cmds.formLayout(uiFormName, edit = True,
                    attachForm = [(uiFormLayoutName, 'top', 5),
                                  (uiFormLayoutName, 'left', 5),
                                  (uiFormLayoutName, 'right', 5)])
    cmds.showWindow(uiWindowName)
Exemplo n.º 34
0
 def show_UI(self):
     self.findSelectionToGroup()
     
     if len(self.objectsToGroup) == 0:
         return
     
     self.UIElements = {}
     
     if cmds.window("groupSelected_UI_window", exists=True):
         cmds.deleteUI("groupSelected_UI_window")
         
     windowWidth = 300
     windowHeight = 180
     self.UIElements["window"] = cmds.window("groupSelected_UI_window", width=windowWidth, height=windowHeight, title="Group Selected", sizeable=False)
     
     self.UIElements["topLevelColumn"] = cmds.columnLayout(adj=True, columnAlign="center", rs=3)
    
     # Sets up a text field for naming the group
     self.UIElements["groupName_rowColumn"] = cmds.rowColumnLayout(nc=2, columnAttach=(1, "right", 0), columnWidth=[(1, 80), (2,windowWidth-90)])
     cmds.text(label="Group Name :")
     self.UIElements["groupName"] = cmds.textField(text="group")
     
     cmds.setParent(self.UIElements["topLevelColumn"])
     
     self.UIElements["createAt_rowColumn"] = cmds.rowColumnLayout(numberOfColumns=3, columnAttach=(1, "right", 0), columnWidth=[(1, 80), (2, windowWidth-170), (3, 80)])
     cmds.text(label="Position at :")
     cmds.text(label="")
     cmds.text(label="")
     
     cmds.text(label="")
     self.UIElements["createAt_lastSelected"] = cmds.button(label="Last Selected", c=self.createAtLastSelected)
     cmds.text(label="")
     
     cmds.text(label="")
     self.UIElements["createAt_averagePosition"] = cmds.button(label="Average Position", c=self.createAtAveragePosition)
     cmds.text(label="") 
     
     cmds.setParent(self.UIElements["topLevelColumn"]) 
     
     cmds.separator()   
     
     columnWidth = (windowWidth/2) - 5
     self.UIElements["button_row"] = cmds.rowLayout(nc=2, columnWidth=[(1, columnWidth), (2, columnWidth)], cat=[(1, "both", 10), (2, "both", 10)], columnAlign=[(1, "center"), (2, "center")])
     cmds.button(label="Accept", c=self.acceptWindow ) 
     cmds.button(label="Cancel", c=self.cancelWindow) 
             
     
     cmds.showWindow(self.UIElements["window"])
     
     # 063
     self.createTemporaryGroupRepresentation()
     self.createAtLastSelected()
     # Select new translate control
     cmds.select(self.tempGroupTransform)
     cmds.setToolTo("moveSuperContext")
Exemplo n.º 35
0
    def populateSelSetsButtons(self):
        # + button
        self.plusBtn = cmds.iconTextButton(
            style='iconAndTextVertical',
            h=25,
            w=25,
            image=uiMod.getImagePath("specialTools_select_sets_+"),
            highlightImage=uiMod.getImagePath(
                "specialTools_select_sets_+ copy"),
            command=self.turnOnCreateNewSetField,
            annotation="Create new select set",
            parent=self.mainLayout)

        self.selSetsLayout = cmds.rowLayout(numberOfColumns=200,
                                            parent=self.mainLayout)

        # create UI
        fieldUI = self.createTextField("create", self.createNewSelectSet,
                                       self.turnOffCreateNewSetField)
        self.createNewSetLayout = fieldUI["mainLayout"]
        self.createNewSetTextField = fieldUI["textField"]

        #rename UI
        fieldUI = self.createTextField("rename", self.renameSelectSet,
                                       self.turnOffRenameSetField)
        self.renameSetLayout = fieldUI["mainLayout"]
        self.renameSetTextField = fieldUI["textField"]

        #sel sets buttons
        for loopSet in self.aToolsSets:
            self.createSelSetButton(loopSet)

        # Show All Button
        self.showAllColorsButton = cmds.iconTextButton(
            style='iconOnly',
            h=25,
            w=1,
            image=uiMod.getImagePath("specialTools_select_sets_show_all"),
            highlightImage=uiMod.getImagePath(
                "specialTools_select_sets_show_all copy"),
            command=self.showAllColors,
            annotation="Show all colors",
            parent=self.mainLayout,
            visible=False)

        # X button
        cmds.iconTextButton(
            style='iconOnly',
            h=25,
            w=25,
            image=uiMod.getImagePath("specialTools_x"),
            highlightImage=uiMod.getImagePath("specialTools_x copy"),
            command=self.toggleToolbar,
            annotation="Hide toolbar",
            parent=self.mainLayout)
Exemplo n.º 36
0
 def __init__(self):
    
     self.list_emitter_delete = []
     if cmds.window('main_random_win',q=1,ex=1):
         cmds.deleteUI('main_random_win')
     cmds.window('main_random_win',menuBar=True,t='random_plan    ---GCX',w=300,h=300,s=1)
     cmds.menu(l='help',tearOff=True)
     self.main_lay = cmds.columnLayout(adj=1)
     cmds.separator(style='in' )
     self.title_lay = cmds.rowLayout(p=self.main_lay,numberOfColumns=5,vis=0)
     cmds.button(l='help',vis=0)
     cmds.text(l='    ')
     self.close_emitter_btn = cmds.button(l='CloseEmitter',vis=1,c=partial(self._delete_emitter),ann='清除发射器(一般用不到)')
     cmds.text(l='    ')
     self.ShowNewObjectList = cmds.button(l='ShowNewObjectList',c=partial(self._hide_show_new_list,1),vis=1,ann='显示新创建物体列表')
     cmds.rowLayout(p=self.main_lay,numberOfColumns=3)
     cmds.text(l=' Plan:',ann='地面')
     self.plan_text = cmds.textField(w=200,ed=0,ann='放入需要产生随机点的地面')
     cmds.button(l='SelectPlan', c=partial(self._sel_plan),ann='添加地面')
     scroll_layout = cmds.rowLayout(p=self.main_lay,numberOfColumns = 3)
     cmds.text(l=' OBJ: ',ann='添加的物体列表')
     self.obj_list = cmds.textScrollList(w=200,ann='放入需要进行随机的模型')
     cmds.columnLayout(p=scroll_layout)
     cmds.button(l='+',w=30,c=partial(self._add_obj),ann='添加需要进行随机的模型')
     cmds.text(l='')
     cmds.button(l='-',w=30,c=partial(self._remove_obj),ann='清除列表里选择的模型')
     cmds.text(l='')
     cmds.button(l='clear',w=30, c=partial(self._remove_all),ann='清除列表里所有的模型')
     
     cmds.text(p=self.main_lay,l='')
     self.trans_item_ui = XYZItem(0,0,0,name='Translate:',string_name='位移属性',parent=self.main_lay)
     cmds.text(p=self.main_lay,l='')
     self.rotate_item_ui = XYZItem(0,360,0,name='Rotate:   ',string_name='旋转属性',parent=self.main_lay)
     cmds.text(p=self.main_lay,l='')
     self.scale_item_ui = XYZItem(0,0,0,name='Scale:      ',string_name='缩放属性',parent=self.main_lay)
     cmds.text(p=self.main_lay,l='')
     
     cmds.rowLayout(p=self.main_lay,numberOfColumns=2)
     self.point_number = cmds.intSliderGrp(l='PointNumber:',field=True,cw3=[73,80,130],minValue=2, 
                         maxValue=999, fieldMinValue=0, 
                         fieldMaxValue=99999, value=200,
                         ann='输入需要随机产生的数量 ')
     cmds.button(p=self.main_lay,l='RandomPoint',w=295,c=partial(self._random_point),
                                                 ann='点击在选择的面上随机复制列表里的模型')
     
     self.list_new_obj = cmds.rowLayout(p=self.main_lay,numberOfColumns=3,vis=0)
     cmds.text(l='New\nObject:')
     self.new_obj_list = cmds.textScrollList(w=200,ann='新创建模型列表')
     cmds.columnLayout(p=self.list_new_obj)
     cmds.button(l='Hide',c=partial(self._hide_show_new_list,0),ann='隐藏新创建物体列表')
     cmds.text(l='')
     cmds.button(l='Select\n new \n object', c=partial(self._random_new_obj),ann='选择列表里的模型')
     
     cmds.button(p=self.main_lay,l='test',c=partial(self.test),vis=0)
     self.progress = cmds.progressBar(p=self.main_lay,w=300,vis=0)
     cmds.helpLine(p=self.main_lay,w=300,bgc=[0.1,0.1,0.1])
     cmds.showWindow()
Exemplo n.º 37
0
    def __init__(self,*args):
        """
        Initialize the Maya gui.
        """
        if(cmds.window("SmartOpenWin", exists=True)):
            cmds.deleteUI("SmartOpenWin", window=True)
        cmds.window("SmartOpenWin", title="Smart Open",menuBar=True,                                   
                                                        rtf=1,w=200,h=300)
        
        cmds.columnLayout()
        
        cmds.frameLayout(cl=True,cll=True,l="About",w=300)
        cmds.columnLayout()
        cmds.text('   ')
        cmds.text('   Select Maya .ma file to open. The file will be edited')
        cmds.text('   if it requires a different version of Maya than the one')
        cmds.text('   currently running so that it can be open by the current')
        cmds.text('   version.')
        cmds.text('   ')
        cmds.text('   ')
        cmds.text('   You may be prompted by SmartOpen and Maya to find a') 
        cmds.text('   reference file. This is normal.')
        cmds.text('   ')
        cmds.text('   ')
        cmds.text('   All reference files in the file will also be') 
        cmds.text('   updated.')
        cmds.text('   ')
        cmds.text('   Does not support Maya 2011.')
        cmds.text('   ')
        cmds.setParent('..')
        cmds.setParent('..')
        
        self.fileField = cmds.textFieldButtonGrp(l='File',bl="Browse",
                                                 bc=self.pickFile,ed=False,
                                                 cw3=[50,200,100])
        
        cmds.rowLayout(nc=2,cw2=(100,100))
        cmds.text('..')
        cmds.button(l='           Open',c=self.openFile,w=100)
        cmds.setParent('..')

        cmds.showWindow("SmartOpenWin")
Exemplo n.º 38
0
    def createUI(self, tab, parent):
        LayerEvents.currentLayerChanged.addHandler(self.update, parent)
        LayerEvents.layerListUpdated.addHandler(self.update, parent)
        MayaEvents.undoRedoExecuted.addHandler(self.update, parent)

        group = tab.createUIGroup(parent, "Layer Properties")
        cmds.setParent(group)

        cmds.rowLayout(parent=group,
                       nc=2,
                       adjustableColumn=2,
                       columnWidth2=[Constants.MARGIN_COLUMN2, 50],
                       columnAttach2=["both", "left"],
                       columnAlign2=["right", "left"])
        TextLabel('Layer name:')
        self.controls.layerName = TextEdit()
        self.controls.layerName.changeCommand.addHandler(self.layerNameChanged)

        cmds.rowLayout(parent=group,
                       adjustableColumn=3,
                       nc=3,
                       columnWidth3=[Constants.MARGIN_COLUMN2, 50, 100],
                       columnAttach3=["both", "left", "both"],
                       columnAlign3=["right", "left", "center"])
        TextLabel('Opacity:')
        self.controls.layerOpacity = FloatField(
            None,
            minValue=0.0,
            maxValue=1.0,
            step=0.1,
            defaultValue=1.0,
            annotation="overall intensity of this layer")
        self.controls.layerOpacity.changeCommand.addHandler(
            self.layerOpacityChanged)
        self.controls.sliderIntensity = cmds.floatSlider(
            min=0,
            max=1,
            step=0.05,
            value=1.0,
            cc=self.layerOpacitySliderChanged,
            dc=self.layerOpacitySliderChanged,
            annotation='Drag slider to change layer opacity')
Exemplo n.º 39
0
def build_ui():
    name_ui = 'variableKinematicsUI'
    mainDir = findFile('rigtools/variableKinematics.py')
    if cmds.window(name_ui, ex=1): cmds.deleteUI(name_ui)
    mainwin = cmds.window(name_ui, title='Variable Kinematics Window')
    cmds.formLayout(numberOfDivisions=100)
    cmds.columnLayout(adjustableColumn=True)
    cmds.intSliderGrp('intJoints_ISG_UI',
                      field=True,
                      label='joints',
                      minValue=10,
                      maxValue=100,
                      fieldMaxValue=1000,
                      value=20,
                      step=1)
    cmds.separator()
    cmds.intSliderGrp('intControl_ISG_UI',
                      field=True,
                      label='controls',
                      minValue=1,
                      maxValue=25,
                      fieldMaxValue=1000,
                      value=2,
                      step=1)
    cmds.separator()
    cmds.rowLayout('rl', nc=2, adjustableColumn=2)
    cmds.iconTextButton(label='FK',
                        w=200,
                        h=180,
                        style='iconOnly',
                        c=lambda: run_command(1),
                        i1='%s/rigtools/images/vfk.png' % mainDir)
    cmds.iconTextButton(label='IK',
                        w=200,
                        h=180,
                        style='iconOnly',
                        c=lambda: run_command(0),
                        i1='%s/rigtools/images/vik.png' % mainDir)
    cmds.intSliderGrp('intJoints_ISG_UI', e=1, cw3=(50, 30, 320), adj=3, h=35)
    cmds.intSliderGrp('intControl_ISG_UI', e=1, cw3=(50, 30, 320), adj=3, h=35)
    cmds.window(name_ui, e=True, w=360, h=50)
    cmds.showWindow(mainwin)
def localGlobalWindow():
	#checking for duplicate windows
	windowID = 'localGlobalWindow'
	if cmds.window(windowID, exists = True):
		cmds.deleteUI(windowID)
		cmds.windowPref( 'localGlobalWindow', remove=True )
	
	#creating window
	cmds.window(windowID, title = 'SER Tools 1.0 | 2018/02/13', widthHeight = (300,60))
	cmds.columnLayout( 'columnLayout01' )
	cmds.rowLayout( 'row1', nc = 5 )
	
	
	#buttons for first row
	cmds.button( 'SER export', label = 'SER 出力', width = 160, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row1', command = 'export = Exporter_001.main()')
	#cmds.button( 'SER whipmake', label = 'SER 鞭リッグ作る', width = 200, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'row1', command = 'ChewTools.GlobalLocalSwitch2.global_to_local()')
	'''
	#buttons for 2nd row
	cmds.rowLayout( 'wristTranslateControllers', nc = 2, parent = 'columnLayout01' )
	cmds.button( 'Wrist loc to gbl', label = 'Left hand Global controller', width = 160, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'wristTranslateControllers', command = 'ChewTools.GlobalLocalSwitch2.L_local_to_global()')
	cmds.button( 'Wrist gbl to loc', label = 'Remove: Left hand Global controller', width = 200, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'wristTranslateControllers', command = 'ChewTools.GlobalLocalSwitch2.L_global_to_local()')
	
	cmds.rowLayout('L_Hand_to_Weapon_Row', nc = 2, parent = 'columnLayout01' )
	cmds.button( 'L_Hand_to_Weapon_Row', label = '左手を武器にbindする', width = 150, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'L_Hand_to_Weapon_Row', command = 'ChewTools.LeftHand_to_Weapon.Weapon_Bind()')
	
	
	
	cmds.rowLayout( 'separator', nc = 2, parent = 'columnLayout01' )
	cmds.separator(height = 10, style = 'in')
	#buttons for 3rd row, Mocap Transfer
	cmds.rowLayout( 'mocapTransfer1', nc = 4, parent = 'columnLayout01' )
	cmds.button( 'bone_import', label = 'Bone Import', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer1', command = 'ChewTools.importBones()' )
	cmds.button( 'bocap_import', label = 'Mocap Import', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer1', command = 'ChewTools.importMocap()' )
	
	
	#buttons for 4th row, Mocap Transfer
	cmds.rowLayout( 'mocapTransfer2', nc = 4, parent = 'columnLayout01' )
	cmds.button( 'Mocap Zero ', label = 'Zero out Mocap', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer2', command = 'ChewTools.mocapZeroOut()' )
	cmds.button( 'mocap Transfer', label = 'Mocap Copy', width = 100, height = 20, backgroundColor = ( 0.6, 0.6, 0.6), parent = 'mocapTransfer2', command = 'ChewTools.mocapButton()' )
	'''
	cmds.showWindow()
	cmds.window(windowID, edit = True, widthHeight = (400,150))
Exemplo n.º 41
0
 def simpleCheckWidget(self, myLabel, flag):
     self.tempLayout = mc.rowLayout(nc=2, h=self.widgetHeight, p=self.form)
     myCheckBox = mc.checkBox('%sCheckBox' % myLabel,
                              ann=flag,
                              l='',
                              w=self.checkBoxLenght,
                              p=self.tempLayout)
     mc.text('%sText' % myLabel,
             l=' '.join(myLabel.split('_')),
             p=self.tempLayout)
     self.simpleCheckBoxes.append(myLabel)
Exemplo n.º 42
0
def create_customUI():
    cmds.button("rigg_button", label="Rigg", w=window_w, h=40)

    cmds.frameLayout("control_scale frame",
                     label="control Scale",
                     w=window_w,
                     parent="main_column",
                     bgc=(0.5, 0.5, 0.0))
    cmds.rowLayout("control_scale_row", nc=3, w=window_w)

    cmds.floatField(precision=2, w=window_w / 3)
    cmds.button("small_button", label="Small", w=window_w / 3)
    cmds.button("bugg_button", label="Big", w=window_w / 3)

    cmds.frameLayout("control_color_frame",
                     label="control color",
                     w=window_w,
                     parent="main_column")
    cmds.colorIndexSliderGrp(max=20, value=18)
    cmds.button("set_color", label="set color", h=30)
Exemplo n.º 43
0
def singleButtonWrapper(parent, calledFunction, argList, label):
    if parent == "":
        cmds.rowLayout(numberOfColumns=1,
                       columnAttach=(1, 'both', 15),
                       columnWidth=(1, 550),
                       height=35)
        cmds.button(label=label,
                    width=520,
                    command=partial(calledFunction, argList=argList))
        cmds.setParent("..")
    else:
        cmds.rowLayout(numberOfColumns=1,
                       columnAttach=(1, 'both', 15),
                       columnWidth=(1, 550),
                       height=35,
                       parent=parent)
        cmds.button(label=label,
                    width=520,
                    command=partial(calledFunction, argList=argList))
        cmds.setParent("..")
Exemplo n.º 44
0
def ui():
    if cmds.window("Del_line", exists=True):
        cmds.deleteUI("Del_line")

    cmds.window("Del_line")
    cmds.columnLayout()
    cmds.button('Create Set', c='sort_set()')
    cmds.rowLayout(numberOfColumns=2)
    cmds.text('Line Numbers:')
    cmds.textField('sel_str')
    cmds.setParent('..')

    cmds.rowLayout(numberOfColumns=3)
    cmds.text('set_name:')
    cmds.textField('set_name')
    cmds.button('del_line', c='unit()')
    cmds.setParent('..')

    cmds.setParent('..')
    cmds.showWindow("Del_line")
Exemplo n.º 45
0
def resultDialogue(attributesList):

    if cmds.window('attributeCompareWindow', ex=True):
        cmds.deleteUI('attributeCompareWindow')

    cmds.window('attributeCompareWindow', t='Compare Results', w=500, h=500)
    cmds.scrollLayout()
    mainLayout = cmds.rowLayout(nc=3)
    col1 = cmds.columnLayout(w=150, p=mainLayout)
    cmds.textField(w=150, tx='Object/Attribute', p=col1)
    col2 = cmds.columnLayout(w=150, p=mainLayout)
    cmds.textField(w=150, tx=cmds.ls(sl=True)[0], p=col2)
    col3 = cmds.columnLayout(w=150, p=mainLayout)
    cmds.textField(w=150, tx=cmds.ls(sl=True)[1], p=col3)

    for attribute in attributesList:
        aError_Code = 'Null'
        bError_Code = 'Null'

        if (cmds.attributeQuery(attribute, ex=True,
                                n=cmds.ls(sl=True)[0]) == False):
            aError_Code = 'Attribute Not Exist'

        if (cmds.attributeQuery(attribute, ex=True,
                                n=cmds.ls(sl=True)[1]) == False):
            bError_Code = 'Attribute Not Exist'

        try:
            cmds.textField(w=150,
                           tx=str(
                               cmds.getAttr(cmds.ls(sl=True)[0] + '.' +
                                            attribute,
                                            asString=True)),
                           bgc=[0.767, 0, 0],
                           p=col2)
        except:
            cmds.textField(w=150, tx=aError_Code, bgc=[0.3, 0.3, 0.3], p=col2)
        try:
            cmds.textField(w=150,
                           tx=str(
                               cmds.getAttr(cmds.ls(sl=True)[1] + '.' +
                                            attribute,
                                            asString=True)),
                           bgc=[0, 0.767, 0],
                           p=col3)
        except:
            cmds.textField(w=150,
                           tx=bError_Code,
                           bgc=[0.27, 0.27, 0.27],
                           p=col3)

        cmds.textField(w=150, tx=attribute, bgc=[0.3, 0.3, 0.3], p=col1)

    cmds.showWindow('attributeCompareWindow')
Exemplo n.º 46
0
def selectedDisplayUI(*args):
	ui = cmds.columnLayout(adj=True)
	row = cmds.rowLayout(nc=2)
	cmds.text(l='Selected: ')
	updateSelectedTextUI = cmds.text(l=len(cmds.ls(sl=True)))
	cmds.setParent('..')
	cmds.setParent('..')

	cmds.scriptJob(p=row, protected=True, e=['SelectionChanged', lambda *_: cmds.text(updateSelectedTextUI, e=True,
	                                                                                  l=len(cmds.ls(sl=True)))])
	return ui
Exemplo n.º 47
0
	def ui(self, cl=True, h=100, *args):
		cmds.columnLayout(adj=True)
		cmds.frameLayout(l='List Objects in Scene', cl=cl, mh=mar, mw=mar, bgs=True, cll=False,
		                 ann='Find all nodes in the scene by type.')

		cmds.rowLayout(nc=2, ad2=1, rat=[1, 'both', -2], cat=[1, 'left', -2])
		self.getAllInSceneOptionUI = cmds.optionMenu(cc=self.get)
		nodeList = ['transform', 'locator', 'mesh', 'joint', 'network', 'nurbsSurface', 'nurbsCurve']
		for opt in sorted(nodeList):
			cmds.menuItem(l=opt, p=self.getAllInSceneOptionUI)
		b1 = cmds.button(l='Find Duplicates', c=lambda *x: self.get(dupe=True))
		cmds.setParent('..')

		self.getAllInSceneListUI = cmds.textScrollList(h=h,
		                                               sc=lambda *x: self.selectTextScrollObject(
				                                               self.getAllInSceneListUI))
		cmds.setParent('..')
		cmds.setParent('..')

		self.get()
Exemplo n.º 48
0
    def buildUI(self):
        column = cmds.columnLayout(rowSpacing=10)

        cmds.text(
            label=
            "Rename: adds object type to end of name. (ie. sphere -> sphere_geo"
        )
        cmds.text(
            label=
            "Select an object in the outliner to rename. If nothing is selected, it will rename all objects."
        )
        cmds.text(label="Organize: reorders outliner by object type")
        cmds.text(label="Group: groups objects of the same type")
        # set space to put buttons on the same row
        cmds.rowLayout(numberOfColumns=3)
        # create buttons for UI
        cmds.button(label="RENAME", command=self.rename)
        cmds.button(label="ORGANIZE", command=self.reorderItems)
        cmds.button(label="GROUP", command=self.groupItems)
        cmds.setParent(column)
Exemplo n.º 49
0
def UI():
    bdWin = "FootballUtils"
    if cmds.window(bdWin, q=True, ex=True):
        cmds.deleteUI(bdWin)

    cmds.window(bdWin, title="Football Utils")
    cmds.scrollLayout(horizontalScrollBarThickness=16)
    bdMainCL = cmds.columnLayout(columnAttach=("both", 5),
                                 rowSpacing=10,
                                 columnWidth=320)
    #Bip List
    bdFL1 = cmds.frameLayout(label="Bips",
                             bs="etchedOut",
                             w=300,
                             mw=5,
                             cll=1,
                             p=bdMainCL)
    bdRL = cmds.rowLayout(numberOfColumns=2, columnWidth2=(150, 150), p=bdFL1)

    bdBipList = cmds.textScrollList('bipList',
                                    numberOfRows=10,
                                    allowMultiSelection=True,
                                    height=100,
                                    sc=bdSelectBip,
                                    p=bdRL)
    bdGenericList = cmds.textScrollList('genericList',
                                        numberOfRows=10,
                                        allowMultiSelection=True,
                                        height=100,
                                        sc=bdSelectGeneric,
                                        p=bdRL)

    bdPopulateBipList()
    cmds.button(l="Rename Bips", c=bd_renameBips, p=bdFL1)

    bdFL2 = cmds.frameLayout(label="Generic",
                             bs="etchedOut",
                             w=300,
                             mw=5,
                             cll=1,
                             p=bdMainCL)
    cmds.button(l="Import Generic Character", al="right", c=bdImportGeneric)
    cmds.button(l="Duplicate Generic Character",
                al="right",
                c=bdDuplicateGeneric)
    cmds.text(
        l='Note: Even if there is only one Generic, click Duplicate Generic\n Use the Global_Scale_Anim to scale the Generic chars'
    )
    cmds.button(l="Copy Anim ", al="right", c=bd_mocapToCotrollers)
    cmds.button(l="Bake Anim", al="left", c=bd_bakeControllers)
    cmds.button(l="Remove Mocap data", c=bdRemoveMocapData)
    #END JOINTS CREATION

    cmds.showWindow(bdWin)
Exemplo n.º 50
0
def build(parent,
          imagesPath,
          iconSize=25,
          height=20,
          marginSize=5):
    """
    build widget
    @param parent : parent layout in maya
    @imagesPath : str path
    """
    cmds.rowLayout(numberOfColumns=2, parent=parent)
    cmds.iconTextButton(style='iconOnly',
                        image1=os.path.join(imagesPath, 'justin.png'),
                        hi=os.path.join(imagesPath, 'justin_hi.png'),
                        width=35, mw=marginSize, height=35, mh=marginSize,
                        label='Justin',
                        npm=1,
                        annotation=' Menu for Justin rig',
                        c = expandToolBar)
    cmds.setParent("..")
Exemplo n.º 51
0
    def __init__(self, *args):
        if (mc.window('fkInitialWin', exists=True)):
            mc.deleteUI('fkInitialWin', window=True)

        mc.window('fkInitialWin', title='FK Atts To Control v1.1', rtf=True)
        mc.columnLayout()

        mc.text('                    How many joint chains?.')

        mc.rowLayout(nc=2, cw2=(100, 100))
        mc.text(" ")
        self.numChains = mc.intField()
        mc.setParent("..")

        mc.rowLayout(nc=2, cw2=(80, 100))
        mc.text(" ")
        mc.button(label='    -=Continue=-', w=80, c=self.secondWindow)
        mc.setParent("..")

        mc.showWindow('fkInitialWin')
Exemplo n.º 52
0
def filePath_Replace(nodeAttr, new):
    frameLayoutName = 'AEpxrUsdReferenceAssemblyTemplate_filePath_Layout'
    if new == True:
        with SetUITemplatePushTemplate():
            cmds.rowLayout(numberOfColumns=3)
            cmds.text(label='File Path')
            cmds.textField('usdFilePathField')
            cmds.symbolButton('usdFileBrowserButton', image='navButtonBrowse.xpm')
            cmds.setParent('..')

    def tmpShowUsdFilePathBrowser(*args):
        filePaths = cmds.fileDialog2(
            caption="Specify USD File",
            fileFilter="USD Files (*.usd*) (*.usd*);;Alembic Files (*.abc)",
            fileMode=1)
        if filePaths:
            cmds.setAttr(nodeAttr, filePaths[0], type='string')
    cmds.button('usdFileBrowserButton', edit=True, command=tmpShowUsdFilePathBrowser)

    cmds.evalDeferred(functools.partial(cmds.connectControl, 'usdFilePathField', nodeAttr))
Exemplo n.º 53
0
    def buildUI(self):
        column = cmds.columnLayout()
        cmds.text(label="Use this slider to set the tween amount")

        row = cmds.rowLayout(numberOfColumns=2)

        self.slider = cmds.floatSlider(min=0, max=100, value=50, step=1, changeCommand=tween)
        cmds.button(label="Reset", command=self.reset)

        cmds.setParent(column)
        cmds.button(label="Close", command=self.close)
Exemplo n.º 54
0
 def Ui(self):
     self.UiN = 'DataSaveUi'
     UiN = self.UiN
     if cmds.window(UiN, q=1, ex=1):
         cmds.deleteUI(UiN)
     cmds.window(UiN, t=UiN, rtf=1, mb=1, mxb=0, wh=(250, 150))
     cmds.columnLayout('%s_MaincL' % UiN,
                       cat=('both', 2),
                       rs=2,
                       cw=250,
                       adj=1)
     cmds.rowLayout(nc=2, adj=1)
     cmds.text(l='', w=225)
     cmds.iconTextButton(i='addClip.png',
                         w=20,
                         h=20,
                         c=lambda *args: self.addUiComponent())
     cmds.setParent('..')
     cmds.showWindow(UiN)
     self.addUiComponent()
Exemplo n.º 55
0
def build(parent, imagesPath, iconSize=25, height=20, marginSize=5):
    """
      build widget
      @param parent : parent layout in maya
      @imagesPath : str path
      """
    #- Reset It---------------------------------------------------------------
    cmds.rowLayout(numberOfColumns=1, parent=parent)
    cmds.iconTextButton(
        style='iconOnly',
        image1=os.path.join(imagesPath, 'reset.png'),
        hi=os.path.join(imagesPath, 'reset_hi.png'),
        width=iconSize,
        mw=marginSize,
        height=iconSize,
        mh=marginSize,
        label='reset',
        annotation='Resets values of current selected controller or any object',
        c=resetIt)
    cmds.setParent("..")
Exemplo n.º 56
0
def Material_Network_initializeUI():
    if cmds.window('MaterialNetwork_UI',ex=True):
        cmds.deleteUI('MaterialNetwork_UI')
    cmds.window('MaterialNetwork_UI',w=350,t='Material_Network_UI')
    mainLayout = cmds.columnLayout()
    cmds.rowLayout(nc=8)
    cmds.button(l='Create AOVs',c=lambda args:genPresetAOVs())
    cmds.button(l='Create Mats',c=lambda args:genMaterialNetwork())
    cmds.checkBox('Line_Checkbox',l='Line',v=1)
    cmds.checkBox('Spec_Checkbox',l='Spec',v=0)
    cmds.button(l='Set Maps',c=lambda args:fileUI())
    cmds.button(l='Mask_Shader',c=lambda args:globalRGBMaskUtility())
    cmds.button(l='sRGB',bgc=[0.5,0.0,0.0],c=lambda args:setFileColorSpace('sRGB'))
    cmds.button(l='Raw',bgc=[0.25,0.0,0.0],c=lambda args:setFileColorSpace('Raw'))
    cmds.setParent(u=True)
    cmds.rowLayout(nc=8)
    cmds.button(l='Select Similar',c=lambda args:compareMeshs())
    cmds.button(l='SplitSG',w=40,c=lambda args:splitSG())
    cmds.setParent(u=True)
    cmds.showWindow('MaterialNetwork_UI')
Exemplo n.º 57
0
def er_MIs(slmod = 'Animation'):
    bs = mc.scrollLayout('Er_CheckSL',q = True,ca = True)
    if bs:
        mc.deleteUI(bs)
    #slmod = mc.optionMenu('yy_Er_Mods_OM',q = True,v = True)
    num = 0
    er_Checks = er_TypeChecks(slmod)
    if er_Checks:
        for er_Check in er_Checks:
            er_LayoutLabel = er_Check[0].split('(')[0]
            mc.rowLayout(er_LayoutLabel,p = 'Er_CheckSL',h = 30,nc = 4,cw4 = [50,80,200,100],co4 = [0,10,20,20],cl4 = ['right','center','center','center'],ct4 = ['right','both','both','both'])
            mc.iconTextButton('%s_icon'%er_LayoutLabel,style='iconOnly', image1='check_Right.png', vis = False,label='')
            if er_Check[2] and er_Check[3]:
                mc.button('%s_solve'%er_LayoutLabel,en = False,w = 50,vis = True,l = er_Check[3],c = 'er_Solves(solName = [%s])'%er_Check)
            else:
                mc.button('%s_solve'%er_LayoutLabel,en = False,w = 50,vis = False,l = '')
            mc.checkBox('%s_checkBox'%er_LayoutLabel,l = er_Check[1],ann = er_Check[5],v = 1)
            mc.button('%s_checkButton'%er_LayoutLabel,w = 50, l = '检查', c = 'er_CheckCmd(checkName =[%s])'%er_Check)
            print er_Check
            mc.setParent('..')
Exemplo n.º 58
0
	def UI(self):

		# Check if UI window already exists
		if mc.window(self.winName, exists=True):
			mc.deleteUI(self.winName)

		# Create window
		mc.window(self.winName, title=self.winTitle, sizeable=False)

		# Create controls
		#setUITemplate -pushTemplate gpsToolsTemplate;
		mc.columnLayout("windowRoot")
		self.commonOptUI("commonOptPanel", "windowRoot")
		mc.separator(height=8, style="none")
		mc.rowLayout(numberOfColumns=2)
		mc.button("btnSubmit", width=198, height=28, label="Create", command=lambda *args: self.createCameraOptions())
		mc.button("btnClose", width=198, height=28, label="Close", command=lambda *args: mc.deleteUI(self.winName))
		#setUITemplate -popTemplate;

		mc.showWindow(self.winName)
Exemplo n.º 59
0
def build(parent, imagesPath, iconSize=25, height=20, marginSize=5):
    """
      build widget
      @param parent : parent layout in maya
      @imagesPath : str path
      """
    cmds.rowLayout(numberOfColumns=1, parent=parent)
    cmds.iconTextButton(
        style='iconOnly',
        image1=os.path.join(imagesPath, 'snapit.png'),
        hi=os.path.join(imagesPath, 'snapit_hi.png'),
        width=iconSize,
        mw=marginSize,
        height=iconSize,
        mh=marginSize,
        label='manager',
        annotation=
        'second selected thing will be snapped to the first selected thing',
        c=snapIt)
    cmds.setParent("..")
Exemplo n.º 60
-2
    def __enter__(self):
        '''
        Initialize the UI
        '''
        if mc.window(self.name, exists=True):
            mc.deleteUI(self.name)

        mc.window(self.name, title='ml :: '+self.title, iconName=self.title, width=self.width, height=self.height, menuBar=self.menu)
        
        
        if self.menu:
            self.createMenu()
        
        self.form = mc.formLayout()
        self.column = mc.columnLayout(adj=True)

        
        mc.rowLayout( numberOfColumns=2, columnWidth2=(34, self.width-34), adjustableColumn=2, 
                    columnAlign2=('right','left'),
                    columnAttach=[(1, 'both', 0), (2, 'both', 8)] )

        #if we can find an icon, use that, otherwise do the text version
        if self.icon:
            mc.iconTextStaticLabel(style='iconOnly', image1=self.icon)
        else:
            mc.text(label=' _ _ |\n| | | |')
            
        if not self.menu:
            mc.popupMenu(button=1)
            mc.menuItem(label='Help', command=(_showHelpCommand(wikiURL+'#'+self.name)))
        
        mc.text(label=self.info)
        mc.setParent('..')
        mc.separator(height=8, style='single')
        return self