예제 #1
0
    def toolGrid(self, UIparent):

        toolList = [
            'buildConstaint2by2', 'buildConstaintOneMaster',
            'buildConstraintProxy', 'deleteConstraint', 'resetConstraints',
            'selectConstraintMasters', 'selectConstraintSlaves'
        ]

        toolGridName = 'toolGridLayout'

        mc.gridLayout(toolGridName,
                      numberOfColumns=5,
                      cellWidthHeight=[50, 50],
                      bgc=[0.27, 0.27, 0.27],
                      p=UIparent)

        for tool in toolList:

            exec('import {0}.{1}.{1}'.format(self.modulPathInGlobal,
                                             tool)) in globals()
            cmds = ('{0}.{1}.{1}.{1}()'.format(self.modulPathInGlobal, tool))
            path = (self.globalPath + '/' + tool + '/' + tool + '.jpg')

            mc.symbolButton((tool + '_button'),
                            c=cmds,
                            i=path,
                            ann=tool,
                            p=toolGridName)
예제 #2
0
def create_clip_row(custom_animation_column):
    clip_layout = cmds.columnLayout(parent=custom_animation_column, bgc=(.2, .2, .2))
    cmds.rowLayout(parent=clip_layout, numberOfColumns=4, columnAlign4=('center','center','center','center'))
    cmds.text(label='', width = 20)
    cmds.text(label='Clip Name', width=110)
    cmds.text(label='Start', width = 40)
    cmds.text(label='End', width = 40)
    
    cmds.rowLayout(parent=clip_layout, numberOfColumns=5)
    play_button = cmds.symbolButton(image='playClip.png', h=20, w=20, c=lambda *args: play_clip(play_button, cmds.textField(start_field, q=True, tx=True), cmds.textField(end_field, q=True, tx=True)))
    cmds.textField(width=110)
    start_field = cmds.textField(width=40, cc=lambda *args: change_range(clip_frame_list, cmds.textField(start_field, q=True, tx=True), cmds.textField(end_field, q=True, tx=True)))
    end_field = cmds.textField(width=40, cc=lambda *args: change_range(clip_frame_list, cmds.textField(start_field, q=True, tx=True), cmds.textField(end_field, q=True, tx=True)))
    delete_button = cmds.symbolButton(image='deleteActive.png', h=20, w=20, c=lambda *args: delete_row(delete_button, False) )
    
    cmds.separator(parent=clip_layout)
    cmds.text(parent=clip_layout, label='Keyframes', width=250)
    
    clip_frame_list = cmds.textScrollList(parent=clip_layout, selectCommand=lambda *args: frame_select(clip_frame_list, 
        cmds.textField(start_field, q=True, tx=True), cmds.textField(end_field, q=True, tx=True)))
        
    right_click_menu = cmds.popupMenu(parent=clip_layout)
    cmds.menuItem(parent=right_click_menu, sh=True, label='Set Key', command=lambda *args: mel.eval('SetKey'))
    cmds.menuItem(parent=right_click_menu, label='Set Key on Animated', command=lambda *args: mel.eval('SetKeyAnimated'))
    cmds.menuItem(parent=right_click_menu, label='Set Breakdown', command=lambda *args: mel.eval('ColorPreferencesWindow'))  
    
    right_click_ctrl_menu = cmds.popupMenu(parent=clip_layout, sh=True)
    cmds.menuItem(parent=right_click_ctrl_menu, label='Normal Key', command=lambda *args: change_to_breakdown(False))
    cmds.menuItem(parent=right_click_ctrl_menu, label='Special Key', command=lambda *args: change_key_color(True))
    cmds.menuItem(parent=right_click_ctrl_menu, label='Breakdown Key', command=lambda *args: change_to_breakdown(True)) 
    
    right_click_shift_menu = cmds.popupMenu(parent=clip_layout, ctl=True)
    cmds.menuItem(parent=right_click_shift_menu, label='Key Translate', command=lambda *args: mel.eval('SetKeyTranslate'))
    cmds.menuItem(parent=right_click_shift_menu, label='Key Rotate', command=lambda *args: mel.eval('SetKeyRotate'))
    cmds.menuItem(parent=right_click_shift_menu, label='Key Scale', command=lambda *args: mel.eval('SetKeyScale'))     
예제 #3
0
	def fileOptUI(self, name, parent, collapse=False):
		""" Create panel UI controls.
		"""
		if mc.optionVar(exists="GPSTerrainDataFile"):
			filePathText = mc.optionVar(query="GPSTerrainDataFile")
		else:
			filePathText = ""

		mc.frameLayout(width=400, collapsable=False, cl=collapse, borderStyle="etchedIn", label=name.replace("_", " "))
		mc.columnLayout(name)
		mc.separator(height=4, style="none")

		mc.rowLayout(numberOfColumns=1, columnAttach1="left", columnAlign1="both", columnOffset1=4)
		mc.text(label="Data file:", wordWrap=True, align="left", width=392)
		mc.setParent(name)
		mc.separator(height=2, style="none")
		mc.rowLayout(numberOfColumns=2, columnAttach2=["left", "left"], columnAlign2=["both", "both"], columnOffset2=[4, 0])
		mc.textField("filePath", text=filePathText, width=360, height=24, changeCommand=lambda *args: self.checkDataFile())
		mc.symbolButton(image="fileOpen.png", width=26, height=26, command=lambda *args: self.fileBrowse("filePath", self.dataFormats))
		mc.setParent(name)

		mc.rowLayout(numberOfColumns=1, columnAttach1="left", columnAlign1="both", columnOffset1=142)
		mc.checkBox("prv", label="Preview", value=1, onCommand=lambda *args: self.togglePreviewOptions(True), offCommand=lambda *args: self.togglePreviewOptions(False), annotation="Generate a low-resolution preview of the terrain.")
		mc.setParent(name)
		mc.intFieldGrp("prvSubds", numberOfFields=2, label="Preview subdivisions: ", value=[50, 50, 0, 0])
		mc.setParent(name)

		mc.separator(height=4, style="none")
		mc.rowLayout(numberOfColumns=1, columnAttach1="left", columnOffset1=142)
		mc.button("btnReadFile", width=116, label="Read data file", command=lambda *args: self.readFile(mc.textField("filePath", q=True, tx=True)), enable=False)
		mc.setParent(name)

		mc.separator(height=8, style="none")
		mc.setParent(parent)
예제 #4
0
 def updateLine(self, nodeName, metadata, index):
     # Attribute controls will be created with the current metadata content
     result = metadata.split(' ', 2 )
     result += [""] * (3-len(result))
     
     # Attribute Name
     attrNameText = cmds.textField("MtoA_exrMAttributeName", text=result[1])
     cmds.textField(attrNameText, edit=True, changeCommand=pm.Callback(self.changeAttrName, nodeName, attrNameText, index))
     
     # Attribute Type
     menu = cmds.optionMenu("MtoA_exrMAttributeType")
     cmds.menuItem( label='INT', data=0)
     cmds.menuItem( label='FLOAT', data=1)
     cmds.menuItem( label='POINT2', data=2)
     cmds.menuItem( label='MATRIX', data=3)
     cmds.menuItem( label='STRING', data=4)
     if result[0] == 'INT':
         cmds.optionMenu(menu, edit=True, select=1)
     elif result[0] == 'FLOAT':
         cmds.optionMenu(menu, edit=True, select=2)
     elif result[0] == 'POINT2':
         cmds.optionMenu(menu, edit=True, select=3)
     elif result[0] == 'MATRIX':
         cmds.optionMenu(menu, edit=True, select=4)
     elif result[0] == 'STRING':
         cmds.optionMenu(menu, edit=True, select=5)
     cmds.optionMenu(menu, edit=True, changeCommand=pm.Callback(self.changeAttrType, nodeName, menu, index))
     
     # Attribute Value
     attrValueText = cmds.textField("MtoA_exrMAttributeValue", text=result[2])
     cmds.textField(attrValueText, edit=True, changeCommand=pm.Callback(self.changeAttrValue, nodeName, attrValueText, index))
     
     # Remove button
     cmds.symbolButton(image="SP_TrashIcon.png", command=pm.Callback(self.removeAttribute, nodeName, index))
예제 #5
0
파일: Ui.py 프로젝트: wangqinghuaTudou/test
    def mainModule(self):
        cmds.rowColumnLayout(nc=2,cw =[(1,130),(2,285)]) #etchedOut rowlumnLayout.str#
        cmds.frameLayout(label=self.moduleLabel,mw =1 ,mh =3,bs="etchedOut",cl= 0,cll=0 ,h=self.hgt)
        cmds.symbolButton(h= 80,image= 'sphere.png' )
        #cmds.rowColumnLayout( numberOfRows=1 ) #Side rowlumnLayout.str#

        #cmds.setParent('..')   #Side rowlumnLayout.end#
        cmds.setParent('..')   #etchedOut rowlumnLayout.end#

        cmds.frameLayout(label='options:',mw =1 ,mh =3,bs="etchedOut",cl= 0,cll=0 ,h= self.hgt)
        #optionsForm = cmds.formLayout()
        cmds.rowColumnLayout(nc=5,cw =[(1,50),(2,50),(3,50),(4,50),(5,50)])
        cmds.text(l='joint:')
        cmds.text(l='fingers:')
        cmds.text(l='no:')
        cmds.text(l='segment:')
        cmds.text(l='symmetry:')
        cmds.textField()
        cmds.checkBox(l ="" )
        cmds.textField()
        cmds.textField()
        cmds.checkBox(l ="" )
        #cmds.formLayout(optionsForm ,e=1,)
        cmds.setParent('..')

        cmds.rowColumnLayout( numberOfRows=1 )#Side: .str
        cmds.text(l=' Side: ')
        cmds.radioButtonGrp(nrb=2 ,la2=["L","R"] ,cw2=[30 ,30],sl =1)
        cmds.scrollField(wordWrap =1,text ="creates arm skeleton template setup. ideal use: any arm Humans, Insects.." ,editable= 0,h=80,w=180)
        cmds.setParent('..')##Side: .end

        cmds.setParent('..')
        cmds.setParent('..')
        cmds.separator(height =3 ,style= "none" )
예제 #6
0
    def _addTab(self, name):
        '''
        Adds an additional tab to the system.
        '''
        
        # Make sure that a tab exists!
        # scroll = cmds.scrollLayout( h=450, parent=self.mainTab )       
        col = cmds.columnLayout(parent=self.mainTab)

        frm = cmds.formLayout( w=450 )
        path = os.path.split(__file__)[0]
	fullPath = lambda x : os.path.join( path, "icons", x )
	
	btn1 = cmds.symbolButton( image=fullPath('plus_16b.xpm'), h=20, 
			    command=Callback(self.addFramePrompt)) # self._attrGUI )
	
	btn2 = cmds.symbolButton( image=fullPath('delete_16b.xpm'), h=20, 
			    command=Callback(self._removeTab ))#command=self._removeAttrs )
			 
	btn3 = cmds.symbolButton( image=fullPath('save_16.xpm'), h=20, 
			    command=Callback(self._saveTab)) # self._attrGUI )
        
	txt = cmds.text( l="" )
	
	cmds.formLayout( frm, e=1, af=[[btn1, "top", 5],[btn1, "left", 5], [btn2, "top", 5],[btn3, "top", 5], [txt, "top", 5], [txt, "right", 0]],
		ac=[[btn2, "left", 0, btn1],[btn3, "left", 0, btn2]])
        cmds.setParent( col )
        # frm = cmds.formLayout( parent=self.mainTab, w=300, h=300 )
        
        
        cmds.tabLayout( self.mainTab, e=1, tl=[col, name])
        self.tabs[col] = []
        self.tabNames.append(col)
        return col
    def columnForFolderUI(botonesArray=[],sideFace='l_ojo', controlAttributos='L_EYE_PUPILA_CNT',sideParent=None):
        # Creo una columna para los botones columnAttach=[(1, 'both', 0),(2, 'right', 0)],
        cl1 = cmds.columnLayout(adjustableColumn=True,columnAttach=['left', 0],parent=sideParent)
        frameIn = cmds.frameLayout(label=sideFace.upper(), collapsable=True, bgc=color3, parent=cl1)
        cl2 = cmds.columnLayout(cal='left', cat=['both', 0], columnOffset=[ 'left', 0],  adjustableColumn=True, parent=frameIn)
        cmds.button(label='DisplayLayer', command=partial( displayLayer, sideFace, controlAttributos))
        cmds.rowColumnLayout(numberOfRows=1,adjustableColumn=True)
        barraRotacion=cmds.floatSlider('barra-'+sideFace,min=-180, max=180, value=0, step=1)
        cmds.floatSlider(barraRotacion,edit=True,changeCommand=partial(rotLayer, sideFace, controlAttributos,barraRotacion),dragCommand=partial( rotLayer, sideFace, controlAttributos,barraRotacion))
        cmds.button( label ='R', bgc=[0.5,0.5,0.4],height=30,width=30,command=partial(resetSlide,sideFace,controlAttributos,0,barraRotacion),annotation='Resetea la rotacion de la capa.')
        cmds.setParent( '..' )
        f3=cmds.frameLayout(  label='Expresiones', collapsable=True, collapse=False)
        scroll2 = cmds.scrollLayout( childResizable=True,height=110)
        rcl1=cmds.rowColumnLayout(numberOfRows=3, bgc=color2)
        uis.setdefault('scrolles', []).append(frameIn)
        uis.setdefault('scrolles', []).append(f3)



        # Para diferenciar las carpeas o frames le pongo diferentes colores
        # r,g,b=random.uniform(0.0,1.0),random.uniform(0.0,1.0),random.uniform(0.0,1.0)
        # creo por cada file un boton
        for ctrl in botonesArray:
            # valFrame=[s.zfill(2) for s in re.findall(r'\b\d+\b', img)]
            val = [int(s) for s in re.findall(r'\b\d+\b', ctrl)][0]
            nameImg=ctrl
            # Solo si existe algo escrito en la variable nameSpace y si es asi
            # le agrego el nameSpace al control.
            if nameSpace is not '':
                ctrl = nameSpace + ctrl
            # Agrego el boton y la funcion, con el nombre del value del
            # diccionario
            cmds.symbolButton(ctrl, image=key + '\\' + nameImg, width=sizeButtons, height=sizeButtons, backgroundColor=color2,
                              annotation=('Frame Num: '+str(val)+'\n Shift + Click: Lado Opuesto.'), command=partial(getFrame, val, sideFace, controlAttributos))
예제 #8
0
def visCntrls(curParent):
	'''
	Different visibility controls for character.
	'''

	imgDef = lambda x: os.path.join( iconPath, x )
	
	visRC = cmds.rowColumnLayout( nc=5, cw=[[1,60],[2,60],[3,60],[4,60],[5,60]], parent=curParent)
	cmds.symbolButton( image=imgDef( 'outliner.xpm' ), w=60, h=45 )
	cmds.symbolButton( image=imgDef( 'mainRig.xpm' ), w=60, h=45 )
	
	jointVis = cmds.symbolCheckBox(image=imgDef("JointVis_On.xpm"), w=60, h=45,
		oni=imgDef("JointVis_On.xpm") ,
		ofi=imgDef("JointVis_Off.xpm") )
	# cmds.connectControl( jointVis, "rig.v")
	
	ctrlVis = cmds.symbolCheckBox(image=imgDef("ctrlVis_On.xpm"), w=60, h=45,
		oni=imgDef("ctrlVis_On.xpm") ,
		ofi=imgDef("ctrlVis_Off.xpm") )
	cmds.symbolCheckBox(image=imgDef("keySel_on.xpm"), w=60, h=45,
		oni=imgDef("keySel_on.xpm") ,
		ofi=imgDef("keySel_off.xpm") )

	# cmds.connectControl( ctrlVis, "move_all_control.visibility")
	
	# Row and High Rez
	
	# Dress
	
	# Face Controls
	
	# T-Pose

	cmds.setParent(curParent)
예제 #9
0
 def refreshAnimationModuleList(self, index=1):
     cmds.textScrollList(self.UIElements["animationModule_textScroll"], edit=True, removeAll=True)
     
     cmds.symbolButton(self.UIElements["deleteModuleButton"], edit=True, enable=False)
     cmds.symbolButton(self.UIElements["duplicateModuleButton"], edit=True, enable=False)
     
     selectedBlprnModule = cmds.textScrollList(self.UIElements["blueprintModule_textScroll"], q=True, selectItem=True)
     self.selectedBlueprintModule = self.blueprintModules[selectedBlprnModule[0]]
     
     self.setupActiveModuleControls()
     
     cmds.namespace(setNamespace=self.selectedBlueprintModule)
     controlModuleNamespaces = cmds.namespaceInfo(listOnlyNamespaces=True)
     cmds.namespace(setNamespace=":")
     
     if controlModuleNamespaces != None:
         for module in controlModuleNamespaces:
             moduleName = utils.stripAllNamespaces(module)[1]
             cmds.textScrollList(self.UIElements["animationModule_textScroll"], edit=True, append=moduleName)
             
         cmds.textScrollList(self.UIElements["animationModule_textScroll"], edit=True, selectIndexedItem = index)
         
         cmds.symbolButton(self.UIElements["deleteModuleButton"], edit=True, enable=True)
         cmds.symbolButton(self.UIElements["duplicateModuleButton"], edit=True, enable=True)
         cmds.symbolButton(self.UIElements["zeroModulesButton"], edit=True, enable=True)
      
     self.setupModuleSpecificControls()    
     self.previousBlueprintListEntry = selectedBlprnModule
예제 #10
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))
def stabilizer ():
	global _camera_
	_point = cmds.ls (selection = True)
	
	if cmds.objExists ('stabilizator_expression') == False and len(_point) > 0:
		_camera_	= Camera()
		_point		= _point[0]

		if (cmds.nodeType (_point) == 'mesh' or cmds.nodeType (_point) == 'transform') and _camera_.transform != 'empty':
			_expression	=	r'''
$pos=`python "fmmu.get_normalized_screen_position(\"'''	+	_point	+	r'''\")"`;
setAttr "'''	+	_camera_.shape	+	r'''.horizontalFilmOffset" $pos[2];
setAttr "'''	+	_camera_.shape	+	r'''.verticalFilmOffset" $pos[3];'''

			print "=================================="
			print _expression
			cmds.expression		(name = 'stabilizator_expression', string = _expression)
			cmds.frameLayout	('adjustCam_frml', edit = True, visible = True)
			cmds.symbolButton	('button_stabilizer', edit = True, image = 'ford_matchMoveUtilities__deStabilize.xpm', annotation = 'deStabilizer')
			cmds.floatField		('field_overscan', edit = True, value = _camera_.overscan)

	else:
		if cmds.objExists ('stabilizator_expression') == True:
			cmds.delete ('stabilizator_expression')
		
		cmds.symbolButton	('button_stabilizer', edit = True, image = 'ford_matchMoveUtilities__stabilize.xpm', annotation = 'deStabilizer')
		cmds.frameLayout	('adjustCam_frml', edit = True, collapse = True, visible = False)
		
		try:
			_camera_.reset_camera()
		except:
			pass
예제 #12
0
    def UI(self):
        if cmds.window(self.winName, q=True, exists=True):
            cmds.deleteUI(self.winName, window=True)
        if cmds.windowPref(self.winName, exists=True):
            cmds.windowPref(self.winName, remove=True)
        cmds.window(self.winName, widthHeight=(415, 200), s=False, bgc=[0.2, 0.2, 0.2])
        self.form = cmds.formLayout()
        self.tabs = cmds.tabLayout(innerMarginWidth=5, innerMarginHeight=5)
        cmds.formLayout(self.form, edit=True, attachForm=(
        (self.tabs, 'top', 0), (self.tabs, 'left', 0), (self.tabs, 'bottom', 0), (self.tabs, 'right', 0)))

        self.child1 = cmds.formLayout(numberOfDivisions=700)
        lghtBtn = [0.45, 0.45, 0.45]
        medBtn = [0.25, 0.25, 0.25]
        darkBtn = [0.15, 0.15, 0.15]

        self.wb = cmds.symbolButton(image='posAir.png', c=self.createWCTRL, w=80, h=58, bgc=[0.22, 0.22, 0.2],
                                    ann="Create Wind CTRL")
        self.gb = cmds.symbolButton(image='posGravity.png', c=self.createGCTRL, w=80, h=58, bgc=[0.2, 0.22, 0.22],
                                    ann="Create Gravity CTRL")
        self.queryList = ['nRigid', 'nucleus', 'nCloth', 'dynamicConstraint']
        footerText1 = cmds.text(label='"点击"下方标志,生成风向或重力控制器,此控制器可以随意的移动缩放大小', )
        footerText2 = cmds.text(label='注意当"旋转"它的时候,Nucleus的风向或重力会随控制器的方向而改变', )

        cmds.formLayout(self.child1, edit=True, attachForm=[
        ],
                        attachPosition=[
                            (self.wb, 'left', 70, 0), (self.wb, 'top', 0, 300),
                            (self.gb, 'left', 260, 0), (self.gb, 'top', 0, 300),
                            (footerText2, 'top', 0, 70), (footerText2, 'left', 0, 3)])
        cmds.setParent('..')
        cmds.tabLayout(self.tabs, edit=True, tabLabel=((self.child1, '风向和重力')), bgc=[0.2, 0.2, 0.2])
        cmds.showWindow(self.winName)
def ArnoldGpuCacheTemplateReplace(plugName) :
    AttrName = plugName.split('.')[-1]
    cmds.connectControl('GpuCache%sPath'%AttrName,plugName,fileName=True )

    cmds.textField( 'GpuCache%sPath'%AttrName, edit=True, changeCommand=lambda *args: ArnoldGpuCacheEdit(plugName, *args))
    cmds.textField( 'GpuCache%sPath'%AttrName, edit=True, text=cmds.getAttr(plugName) )
    
    cmds.symbolButton('GpuCache%sPathButton'%AttrName, edit=True, command=lambda *args: LoadGpuCacheButtonPush(plugName))
예제 #14
0
 def updateIconList(self):
     for i, sb in enumerate(self.symbolButtons):
         if i >= len(self.resList[self.iconsOffset:self.numIcons + self.iconsOffset]):
             cmds.symbolButton(sb, edit=True, image='', command='',
                               annotation='', visible=False)
         else:
             r = self.resList[self.iconsOffset:self.numIcons + self.iconsOffset][i]
             cmds.symbolButton(sb, edit=True, image=r, annotation=r, visible=True,
                               command=partial(self.setCurrent_iconList, r))
예제 #15
0
def toggleL2F(opt):
	if opt==True:
		mc.checkBox('EnableAbsRenderFolder',e=1,v=0)
		mc.textField('absoluteFolder',e=1,en=0)
		mc.symbolButton('absFolderButton',e=1,en=0)
	if opt==False:
		mc.checkBox('EnableAbsRenderFolder',e=1,v=1)
		mc.textField('absoluteFolder',e=1,en=1) 
		mc.symbolButton('absFolderButton',e=1,en=1)
예제 #16
0
 def toggleComponentControls(self, componentType, option):
     mc.optionMenuGrp("%sItems" % componentType, edit=True, enable=option)
     if option == True:
         self.toggleComponentSubControls(componentType)
     else:
         mc.textField("%sInstObj" % componentType, edit=True, enable=False)
         mc.symbolButton("%sLoadSel" % componentType,
                         edit=True,
                         enable=False)
예제 #17
0
def ArnoldVolumeTemplateDsoReplace(plugName):
    cmds.textField("arnoldVolumeDsoPath", edit=True, changeCommand=lambda *args: ArnoldVolumeDsoEdit(plugName, *args))
    cmds.textField("arnoldVolumeDsoPath", edit=True, text=cmds.getAttr(plugName))
    cmds.symbolButton(
        "arnoldVolumeDsoPathButton",
        edit=True,
        image="navButtonBrowse.png",
        command=lambda *args: LoadVolumeDsoButtonPush(plugName),
    )
예제 #18
0
def iconButton(ann, icon, command, wh=ICONWIDTH, *args):
    """
    Make a single icon button
    :param ann: annotation
    :param icon: icon name
    :param wh: width and high
    :return: an icon button
    """
    image = geticon(icon)
    cmds.symbolButton(ann=ann, i=image, c=command, h=wh, w=wh)
def play_clip(play_button, start, end):
    if not start == '' and not end == '':       
        if cmds.play(q=True, state=True):
            cmds.play(state=False)
            cmds.symbolButton(play_button, e=True, image='playClip.png')
        else:
            cmds.play(state=False) 
            cmds.playbackOptions(min=start, ast=start)
            cmds.playbackOptions(max=end, aet=end)
            cmds.play()
            cmds.symbolButton(play_button, e=True, image='stopClip.png')
예제 #20
0
 def editSBsize(self):
     whsize=cmds.intSlider('picSize',q=True,value=True)
     #contrlsName=cmds.rowColumnLayout('RowL',q=True,ca=True)
     contrlsName=cmds.formLayout('RowL',q=True,ca=True)    
     for i in range(len(contrlsName)):
         j=i+1
         if j%2==0:
             #cmds.text(contrlsName[i],e=True,w=whsize)
             cmds.iconTextButton(contrlsName[i],e=True,w=whsize)
         else:  
             cmds.symbolButton(contrlsName[i],e=True,w=whsize,h=whsize)
예제 #21
0
    def toggle_btn(self, *args):
        if self.state:
            cmds.symbolButton(self.btn, e=1, bgc=[0, 1, 0])
            cmds.text(self.text, e=1, bgc=[0, 1, 0])

            self.state = False
            print '%s: State True' % self.label
        else:
            cmds.symbolButton(self.btn, e=1, bgc=[1, 0, 0])
            cmds.text(self.text, e=1, bgc=[1, 0, 0])
            self.state = True
            print '%s: State False' % self.label
예제 #22
0
def createArnoldLogSettings():

    pm.setUITemplate("attributeEditorTemplate", pushTemplate=True)
    pm.columnLayout(adjustableColumn=True)

    logToFile = cmds.getAttr("defaultArnoldRenderOptions.log_to_file")
    logToConsole = cmds.getAttr("defaultArnoldRenderOptions.log_to_console")

    pm.attrControlGrp(
        "log_verbosity",
        label="Verbosity Level",
        enable=logToConsole,
        attribute="defaultArnoldRenderOptions.log_verbosity",
    )

    pm.checkBoxGrp("log_to_console", label="Console", changeCommand=ChangeLogToConsole)

    pm.connectControl("log_to_console", "defaultArnoldRenderOptions.log_to_console", index=1)
    pm.connectControl("log_to_console", "defaultArnoldRenderOptions.log_to_console", index=2)

    pm.checkBoxGrp("log_to_file", label="File", changeCommand=ChangeLogToFile)

    pm.connectControl("log_to_file", "defaultArnoldRenderOptions.log_to_file", index=1)
    pm.connectControl("log_to_file", "defaultArnoldRenderOptions.log_to_file", index=2)

    cmds.rowLayout(
        numberOfColumns=2, columnWidth2=(80, 220), adjustableColumn=2, columnAttach=[(1, "left", 0), (2, "left", -10)]
    )
    path = cmds.textFieldGrp("ls_log_filename", label="Filename", enable=logToFile, cc=updateLogSettings, width=325)
    cmds.symbolButton(
        "ls_log_filename_button", image="navButtonBrowse.png", command=LoadFilenameButtonPush, enable=logToFile
    )
    pm.connectControl("ls_log_filename", "defaultArnoldRenderOptions.log_filename", index=1)
    pm.connectControl("ls_log_filename", "defaultArnoldRenderOptions.log_filename", index=2)
    pm.setParent("..")

    """
    pm.attrControlGrp('log_filename',
                        label="Filename",
                        attribute='defaultArnoldRenderOptions.log_filename',
                        cc=updateLogSettings)
    """

    pm.attrControlGrp(
        "log_max_warnings",
        label="Max. Warnings",
        enable=logToConsole or logToFile,
        attribute="defaultArnoldRenderOptions.log_max_warnings",
    )

    pm.setParent("..")

    pm.setUITemplate(popTemplate=True)
 def filenameNew(self, nodeName):
     cmds.rowLayout(nc=2,
                    cw2=(360, 30),
                    cl2=('left', 'left'),
                    adjustableColumn=1,
                    columnAttach=[(1, 'left', -4), (2, 'left', 0)])
     path = cmds.textFieldGrp("filenameGrp",
                              label="Photometry File",
                              changeCommand=self.filenameEdit)
     cmds.textFieldGrp(path, edit=True, text=cmds.getAttr(nodeName))
     cmds.symbolButton(image='navButtonBrowse.png',
                       command=self.LoadFilenameButtonPush)
예제 #24
0
 def toggle_btn(self, *args):
     if self.state:
         cmds.symbolButton(self.btn, e=1, bgc=[0, 1, 0])
         cmds.text(self.text, e=1, bgc=[0, 1, 0])
         
         self.state = False
         print '%s: State True' % self.label
     else:
         cmds.symbolButton(self.btn, e=1, bgc=[1, 0, 0])
         cmds.text(self.text, e=1, bgc=[1, 0, 0])
         self.state = True
         print '%s: State False' % self.label
예제 #25
0
def	setButtonIcon	():
	_width			=	cmds.gridLayout			(	'grid_selectAxis',		query	=	True,	width	=	True	)
	_axis			=	cmds.radioCollection	(	'radioCollection_axis',	query	=	True,	select	=	True	)
	_keepShape		=	cmds.checkBox			(	'check_keepShape',		query	=	True,	value	=	True	)
	
	if	_keepShape:	_keepShape	=	'KeepShape'
	else:			_keepShape	=	''
	
	cmds.symbolButton		(	'orientMinusButton',	edit	=	True,	width	=	_width	/	2,
								image	=	'ford_riggingAid__orient'+_axis+'minus'+_keepShape+'.xpm'	)
	cmds.symbolButton		(	'orientPlusButton',		edit	=	True,	width	=	_width	/	2,
								image	=	'ford_riggingAid__orient'+_axis+'plus'+_keepShape+'.xpm'	)
예제 #26
0
	def setCommand(self, cmd, cmdOff=False):
		if( self.ctrlType == "ctrl" ):
			cmds.symbolButton( self.gui, edit=True, command=cmd)
		elif( self.ctrlType == "chk"):
			cmds.symbolCheckBox( self.gui, edit=True, command=cmd)
			cmds.symbolCheckBox( self.gui, edit=True, onCommand=cmd)
			if( cmdOff ):
				cmds.symbolCheckBox( self.gui, edit=True, offCommand=cmdOff)
		if( cmdOff ):
			self.command = [cmd, cmdOff]
		else:
			self.command = cmd
예제 #27
0
def play_clip(play_button, start, end):
    if not start == '':
        if not end == '':
            change_range_start(start)
            change_range_end(end)

            if cmds.play(q=True, state=True):
                cmds.play(state=False)
                cmds.symbolButton(play_button, e=True, image='playClip.png')
            else:
                cmds.play()
                cmds.symbolButton(play_button, e=True, image='stopClip.png')
예제 #28
0
 def setCommand(self, cmd, cmdOff=False):
     if (self.ctrlType == "ctrl"):
         cmds.symbolButton(self.gui, edit=True, command=cmd)
     elif (self.ctrlType == "chk"):
         cmds.symbolCheckBox(self.gui, edit=True, command=cmd)
         cmds.symbolCheckBox(self.gui, edit=True, onCommand=cmd)
         if (cmdOff):
             cmds.symbolCheckBox(self.gui, edit=True, offCommand=cmdOff)
     if (cmdOff):
         self.command = [cmd, cmdOff]
     else:
         self.command = cmd
예제 #29
0
def ArnoldVolumeTemplateDsoReplace(plugName):
    cmds.textField(
        'arnoldVolumeDsoPath',
        edit=True,
        changeCommand=lambda *args: ArnoldVolumeDsoEdit(plugName, *args))
    cmds.textField('arnoldVolumeDsoPath',
                   edit=True,
                   text=cmds.getAttr(plugName))
    cmds.symbolButton('arnoldVolumeDsoPathButton',
                      edit=True,
                      image='navButtonBrowse.png',
                      command=lambda *args: LoadVolumeDsoButtonPush(plugName))
예제 #30
0
def launchFromCmdWndIcon():
    '''launch from maya command line script editor icon.'''
    def cmdWnd(arg=None):
        cmds.ScriptEditor()
        highlightCmdReporter()

    # get command line formLayout
    gCommandLineForm = mel.eval('$tempVar = $gCommandLineForm')
    commandLineForm = cmds.formLayout(gCommandLineForm, q=1, ca=1)[0]
    # get cmdWndIcon button
    cmdWndIcon = cmds.formLayout(commandLineForm, q=1, ca=1)[-1]
    # change the command of the button
    cmds.symbolButton(cmdWndIcon, e=1, c=cmdWnd)
    def wireProfilesLayoutConnect(self, fakeFullAttributeName):
        # CONNECT COMMAND WITH BUTTONS
        for (key, value) in self.wireProfilesControlsMap.items():
            cmds.symbolButton(
                value[0], 
                edit =          True,
                command =       partial(self._selectWireProfiles, fakeFullAttributeName, key)
            )

        # HIGHLIGHT ACTIVE WIRE PROFILE SHAPE
        self.activeWireProfilesIndex = cmds.getAttr(fakeFullAttributeName)
        self._resetWireProfilesControls()
        self._highlightWireProfilesControls(self.activeWireProfilesIndex)
def launchFromCmdWndIcon():
    '''launch from maya command line script editor icon.'''
    def cmdWnd(arg=None):
        cmds.ScriptEditor()
        highlightCmdReporter()

    # get command line formLayout
    gCommandLineForm = mel.eval('$tempVar = $gCommandLineForm')
    commandLineForm = cmds.formLayout(gCommandLineForm, q=1, ca=1)[0]
    # get cmdWndIcon button
    cmdWndIcon = cmds.formLayout(commandLineForm, q=1, ca=1)[-1]
    # change the command of the button
    cmds.symbolButton(cmdWndIcon, e=1, c=cmdWnd)
 def _resetWireProfilesControls(self):
     for (key, value) in self.wireProfilesControlsMap.items():
         cmds.symbolButton(
             value[0], 
             edit =              True,
             enableBackground =  False
         )                
         cmds.text(
             value[1],
             edit =              True,
             backgroundColor =   AEwireMeshCreatorTemplate.textBackgroundColorInactive,
             highlightColor =    (255.0/255.0, 255.0/255.0, 255.0/255.0)  
         )
예제 #34
0
def create_clip_row(custom_animation_column):
    clip_layout = cmds.columnLayout(parent=custom_animation_column,
                                    bgc=(.2, .2, .2))
    cmds.rowLayout(parent=clip_layout,
                   numberOfColumns=4,
                   columnAlign4=('center', 'center', 'center', 'center'))
    cmds.text(label='', width=20)
    cmds.text(label='Clip Name', width=110)
    cmds.text(label='Start', width=40)
    cmds.text(label='End', width=40)

    cmds.rowLayout(parent=clip_layout, numberOfColumns=6)
    delete_button = cmds.symbolButton(
        image='deleteActive.png',
        h=20,
        w=20,
        c=lambda *args: delete_row(delete_button, False))
    cmds.textField(width=110)
    start_field = cmds.textField(
        width=40,
        cc=lambda *args: change_range_start(
            cmds.textField(start_field, q=True, tx=True)))
    end_field = cmds.textField(width=40,
                               cc=lambda *args: change_range_end(
                                   cmds.textField(end_field, q=True, tx=True)))
    play_button = cmds.symbolButton(
        image='playClip.png',
        h=20,
        w=20,
        c=lambda *args: play_clip(play_button,
                                  cmds.textField(start_field, q=True, tx=True),
                                  cmds.textField(end_field, q=True, tx=True)))
    add_frame_button = cmds.symbolButton(
        image='addClip.png',
        h=20,
        w=30,
        c=lambda *args: create_frame_row(clip_frame_list))

    cmds.separator(parent=clip_layout)
    cmds.rowLayout(parent=clip_layout,
                   numberOfColumns=3,
                   columnAlign3=('center', 'center', 'center'))
    cmds.text(label='S', width=13)
    cmds.text(label='B', width=13)
    cmds.text(label='Keyframe', width=220)

    clip_frame_list = cmds.textScrollList(
        parent=clip_layout,
        height=400,
        selectCommand=lambda *args: frame_select(clip_frame_list),
        deleteKeyCommand=lambda *args: outliner_remove(clip_frame_list))
def ArnoldGpuCacheTemplateNew(plugName) :
    AttrName = plugName.split('.')[-1]
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1 \2', AttrName)
    s2 = re.sub('(.)(file+)', r'\1 \2', s1)
    NiceName = re.sub('([a-z0-9])([A-Z])', r'\1 \2', s2).title()

    cmds.setUITemplate('attributeEditorTemplate',pst=True)
    cmds.rowLayout( numberOfColumns=3 )
    cmds.text(label=NiceName)
    path = cmds.textField('GpuCache%sPath'%AttrName) # ,changeCommand=lambda *args: ArnoldGpuCacheEdit(plugName, *args)
    cmds.symbolButton('GpuCache%sPathButton'%AttrName, image='navButtonBrowse.png')
    cmds.setUITemplate(ppt=True)

    ArnoldGpuCacheTemplateReplace(plugName)
 def _highlightWireProfilesControls(self, wireProfileShapeIndex):
     (buttonID, textID) = self.wireProfilesControlsMap[wireProfileShapeIndex]
     cmds.symbolButton(
         buttonID, 
         edit =              True,
         enableBackground =  True,
         backgroundColor =   AEwireMeshCreatorTemplate.imageBackgroundColorActive
     )                
     cmds.text(
         textID,
         edit =              True,
         backgroundColor =   AEwireMeshCreatorTemplate.textBackgroundColorActive,
         highlightColor =    (255.0/255.0, 56.0/255.0, 56.0/255.0)  
     )
예제 #37
0
def create_asset_entry(asset):
    form_layout = cmds.formLayout(width=asset_size, height=asset_size)

    if "otl_file" in asset:
        license = get_asset_license(asset["otl_file"])

        otl_file = os.path.join(get_store_otls_path(), asset["otl_file"])

        m = re.match("([^:]*)::(.*)", asset["node_type_name"])
        asset_name = "{0}::{1}/{2}".format(
            m.group(1),
            license["category_name"],
            m.group(2),
        )

        cmds.symbolButton(
            annotation=asset["descriptive_name"],
            image=os.path.join(get_store_icons_path(), asset["icon"]),
            width=asset_size,
            height=asset_size,
            command=lambda *args: load_asset(otl_file, asset_name))
    elif "update_available" in asset and asset["update_available"]:
        cmds.symbolButton(
            annotation=asset["descriptive_name"],
            image=os.path.join(get_store_icons_path(), asset["icon"]),
            width=asset_size,
            height=asset_size,
        )
        cmds.text(
            label="Update available. Use Houdini to update asset.",
            width=asset_size,
            height=asset_size,
            wordWrap=True,
        )

    text = cmds.text(
        label=asset["descriptive_name"],
        backgroundColor=[0, 0, 0],
        align="right",
    )
    cmds.formLayout(
        form_layout,
        edit=True,
        width=asset_size,
        height=asset_size,
        attachForm=[[text, "left", 0], [text, "right", 0], [text, "bottom",
                                                            0]],
    )

    cmds.setParent(upLevel=True)
예제 #38
0
 def toggleComponentSubControls(self, componentType):
     selOpt = mc.optionMenuGrp("%sItems" % componentType,
                               query=True,
                               value=True)
     if selOpt == "Instance of...":
         mc.textField("%sInstObj" % componentType, edit=True, enable=True)
         mc.symbolButton("%sLoadSel" % componentType,
                         edit=True,
                         enable=True)
     else:
         mc.textField("%sInstObj" % componentType, edit=True, enable=False)
         mc.symbolButton("%sLoadSel" % componentType,
                         edit=True,
                         enable=False)
예제 #39
0
def ArnoldGpuCacheTemplateReplace(plugName):
    AttrName = plugName.split('.')[-1]
    cmds.connectControl('GpuCache%sPath' % AttrName, plugName, fileName=True)

    cmds.textField(
        'GpuCache%sPath' % AttrName,
        edit=True,
        changeCommand=lambda *args: ArnoldGpuCacheEdit(plugName, *args))
    cmds.textField('GpuCache%sPath' % AttrName,
                   edit=True,
                   text=cmds.getAttr(plugName))

    cmds.symbolButton('GpuCache%sPathButton' % AttrName,
                      edit=True,
                      command=lambda *args: LoadGpuCacheButtonPush(plugName))
예제 #40
0
def ArnoldGpuCacheTemplateNew(plugName):
    AttrName = plugName.split('.')[-1]
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1 \2', AttrName)
    s2 = re.sub('(.)(file+)', r'\1 \2', s1)
    NiceName = re.sub('([a-z0-9])([A-Z])', r'\1 \2', s2).title()

    cmds.setUITemplate('attributeEditorTemplate', pst=True)
    cmds.rowLayout(numberOfColumns=3)
    cmds.text(label=NiceName)
    cmds.textField('GpuCache{}Path'.format(AttrName))
    cmds.symbolButton('GpuCache{}PathButton'.format(AttrName),
                      image='navButtonBrowse.png')
    cmds.setUITemplate(ppt=True)

    ArnoldGpuCacheTemplateReplace(plugName)
예제 #41
0
def ArnoldVolumeTemplateDsoNew(nodeName):
    cmds.rowColumnLayout(numberOfColumns=3,
                         columnAlign=[(1, 'right'), (2, 'right'), (3, 'left')],
                         columnAttach=[(1, 'right', 0), (2, 'both', 0),
                                       (3, 'left', 5)],
                         columnWidth=[(1, 145), (2, 220), (3, 30)])
    cmds.text(label='DSO ')
    path = cmds.textField(
        'arnoldVolumeDsoPath',
        changeCommand=lambda *args: ArnoldVolumeDsoEdit(nodeName, *args))
    cmds.textField(path, edit=True, text=cmds.getAttr(nodeName))
    cmds.symbolButton('arnoldVolumeDsoPathButton',
                      height=20,
                      image='navButtonBrowse.png',
                      command=lambda *args: LoadVolumeDsoButtonPush(nodeName))
예제 #42
0
    def create_module_install_button(self, module):

        mod = __import__("blueprint." + module, {}, {}, [module])
        reload(mod)

        title = mod.TITLE
        description = mod.DESCRIPTION
        icon = mod.ICON

        # Create UI

        button_size = 64
        row = cmds.rowLayout(numberOfColumns=2,
                             columnWidth=([1, button_size]),
                             adjustableColumn=2,
                             columnAttach=([1, "both", 0], [2, "both", 5]))

        self.ui_elements["module_button_" + module] = cmds.symbolButton(
            width=button_size,
            height=button_size,
            image=icon,
            command=partial(self.install_module, module))

        text_column = cmds.columnLayout(columnAlign="center", adj=True)

        cmds.text(align="center",
                  width=self.scroll_width - button_size + 300,
                  label=title)

        cmds.scrollField(text=description,
                         editable=False,
                         width=self.scroll_width - button_size + 300,
                         height=button_size,
                         wordWrap=True)
예제 #43
0
def ArnoldVolumeTemplateDsoNew(nodeName):
    cmds.rowColumnLayout(
        numberOfColumns=3,
        columnAlign=[(1, "right"), (2, "right"), (3, "left")],
        columnAttach=[(1, "right", 0), (2, "both", 0), (3, "left", 5)],
        columnWidth=[(1, 145), (2, 220), (3, 30)],
    )
    cmds.text(label="DSO ")
    path = cmds.textField("arnoldVolumeDsoPath", changeCommand=lambda *args: ArnoldVolumeDsoEdit(nodeName, *args))
    cmds.textField(path, edit=True, text=cmds.getAttr(nodeName))
    cmds.symbolButton(
        "arnoldVolumeDsoPathButton",
        height=20,
        image="navButtonBrowse.png",
        command=lambda *args: LoadVolumeDsoButtonPush(nodeName),
    )
예제 #44
0
 def symbol_button(*args, **kwargs):
     try:
         return cmds.symbolButton(*args, **kwargs)
     except Exception as exp:
         LOG.debug("MayaAPI exception in 'symbol_button': {0}".format(
             exp).strip())
         return None
예제 #45
0
def populateIcons():

    iconPath = cmds.internalVar(upd=True) + "/icons/Tools/"

    icons = os.listdir(iconPath)

    categories = []
    for icon in icons:
        categoryName = icon.partition("__")[0]
        categories.append(categoryName)

    # print set(categories)
    categoryNames = list(set(categories))
    # print categoryNames

    for name in categoryNames:
        # create frameLayout
        widget[(name + "_frameLayout")] = cmds.frameLayout(label=name,
                                                           collapsable=True,
                                                           parent=widget["mainLayout"])
        widget[(name + "_rowColumnLayout")] = cmds.rowColumnLayout(nc=3,
                                                                  parent=widget[(name + "_frameLayout")])


    for icon in icons:
        iconName = icon.partition(".")[0]
        category = icon.partition("__")[0]
        command = icon.partition("__")[2].partition(".")[0]
        # print command
        widget[(iconName +"_button")] = cmds.symbolButton(w=50, h=50,
                                                          image=(iconPath + icon),
                                                          parent=widget[category + "_rowColumnLayout"],
                                                          c=partial(runMethod, command))
예제 #46
0
def populateToolbar( *args ):

	iconPath = os.path.join ( ehsan_script_directory , 'ui', 'icons' )
	icons = os.listdir( iconPath )
	
	# find categories
	rawCategories = []
	for icon in icons:
		if '__' in str(icon): # ignore files other than ones with '__' in their names
			rawCategories.append( icon.partition('__')[0] )
	categories = list( set( rawCategories ) )
	categories.sort()
	
	# create frame layout for each category
	for category in categories:
		widgets[ category+'_frameLayout' ] = cmds.frameLayout( label=category,w=150, collapsable=True, parent=widgets['mainLayout'] )
		widgets[ category+'layout' ] = cmds.rowColumnLayout( nc=3 )
	
	
	# create icons
	for icon in icons:
		iconName = icon.partition('.')[0]
		category = icon.partition('__')[0]
		command = iconName.partition('__')[2]
		if '__' in str(icon): # ignore files other than ones with '__' in their names		
			widgets[ icon + '_button'] = cmds.symbolButton( c=partial(runMethod,category,command) , w=50, h=50, image=(os.path.join (iconPath,icon)), parent=widgets[ category+'layout' ], annotation= command )
예제 #47
0
파일: guide.py 프로젝트: MagSec-Arts/mgear
    def __init__(self):

        # Remove existing window
        if cmds.window(GUIDE_UI_WINDOW_NAME, exists=True):
            cmds.deleteUI(GUIDE_UI_WINDOW_NAME)

        # Create Window and main tab
        self.ui_window = cmds.window(GUIDE_UI_WINDOW_NAME, width=400, height=600, title="Guide Tools", sizeable=True)
        self.ui_topLevelColumn = cmds.columnLayout(adjustableColumn=True, columnAlign="center")

        self.ui_tabs = cmds.tabLayout(width=300, height=600, innerMarginWidth=5, innerMarginHeight=5)
        tabWidth = cmds.tabLayout(self.ui_tabs, q=True, width=True)

        #
        self.ui_compColumn = cmds.columnLayout(adj=True, rs=3)
        self.ui_compFrameLayout = cmds.frameLayout(height=300, collapsable=False, borderVisible=False, labelVisible=False)
        self.ui_compList_Scroll = cmds.scrollLayout(hst=0)
        self.ui_compList_column = cmds.columnLayout(columnWidth=300, adj=True, rs=2)
        cmds.separator()

        # List of components
        import mgear.maya.rig.component as comp
        path = os.path.dirname(comp.__file__)
        for comp_name in os.listdir(path):

            if not os.path.exists(os.path.join(path, comp_name, "__init__.py")):
                continue

            module = __import__("mgear.maya.rig.component."+comp_name, globals(), locals(), ["*"], -1)
            reload(module)

            buttonSize = 32
            row = cmds.rowLayout(numberOfColumns=2, columnWidth=([1, buttonSize]), adjustableColumn=2, columnAttach=([1, "both", 0], [2, "both", 5]))
            cmds.symbolButton(width=buttonSize, height=buttonSize, bgc=[1,1,1])

            textColumn = cmds.columnLayout(columnAlign="center")
            cmds.text(align="center", width=250, label=module.NAME)

            cmds.scrollField(text=module.DESCRIPTION, editable=False, width=250, height=50, wordWrap=True)

            cmds.setParent(self.ui_compList_column)
            cmds.separator()

        # Display the window
        cmds.tabLayout(self.ui_tabs, edit=True, tabLabelIndex=([1, "Modules"]))
        cmds.showWindow(self.ui_window)
예제 #48
0
파일: wendyUI.py 프로젝트: jbltx/wendyUI
 def populateModifiersButtons(self, namespace, *args):
     iconPath = cmds.internalVar(upd = True) + "icons/wendyUI/"
     icons = os.listdir(iconPath)
     for icon in icons:
         if icon.partition("_")[0] == "mod":
             niceName = icon.partition(".")[0].partition("_")[2]
             print niceName
             self.widgets[niceName + "_button"] = cmds.symbolButton(w = 50, h = 50, image = (iconPath + icon), c= partial(self.runModifier, niceName), parent = self.widgets[namespace + "_modifiers_mainLayout"])
예제 #49
0
 def button(text, command, icon):
     image = os.path.join(os.path.dirname(os.path.realpath(__file__)), "images", "icons", icon)
     ui = []
     ui.append(cmds.rowLayout(ad2=2, nc=2))
     ui.append(cmds.symbolButton(image=image, h=50, w=50, c=command))
     ui.append(cmds.button(label=text, h=50, c=command))
     cmds.setParent("..")
     return ui
예제 #50
0
 def __init__(self, label, image, width=128, height=128, parent=None):
     self.label = label
     self.image = image
     self.state = True
     self.main = cmds.columnLayout()
     self.btn = cmds.symbolButton(bgc=[1, 0, 0], i=self.image, w=width, h=height,
         c=self.toggle_btn)
     self.text = cmds.text(l=self.label, bgc=[1, 0, 0], w=width)
     cmds.setParent(parent)
예제 #51
0
	def playblastHUD(self):
		if cmds.window('pb', exists = True):
			cmds.deleteUI('pb')
		window = cmds.window('pb', titleBar = 0, sizeable = False)
		icon = cmds.internalVar(upd = True) + 'icons/JR_icons/folder.jpg' # FOLDER ICON
		mainLayout = cmds.columnLayout(w = 180, h = 80)
		# Row and Column Layout Setup
		cmds.rowColumnLayout(nc = 3, cw = [(1, 50), (2, 60), (3, 60)] , columnOffset = [(1, 'both', 5), (2, 'both', 5), (3, 'both', 5)]   ) # first section relates to 1 and 2 columb widths
		# Radio Button Collection For 1080 and 720
		cmds.radioCollection()
		frameSize = cmds.text( label='Frame:', align = 'left' )
		i1080 = cmds.radioButton( label='1080', onc = partial( self.playblastSize, '1080' ) )
		i720 = cmds.radioButton( label='720',  onc = partial( self.playblastSize, '720'  ) )
		if Cache.playblastSize == [1920, 1080]:
			cmds.radioButton ( i1080, edit = True, select = True )
		elif Cache.playblastSize == [1280, 720]:
			cmds.radioButton ( i720, edit = True, select = True )
		# Radio Button Collection For AVI and MOV
		formatType = cmds.radioCollection()
		cmds.text( label='Format:', align = 'left' )
		avi = cmds.radioButton( label='avi', onc = partial( self.playblastFormat, 'avi' ) )
		qt = cmds.radioButton( label='mov', onc = partial( self.playblastFormat, 'qt' ) )
		if Cache.playblastFormat == 'qt':
			cmds.radioButton ( qt, edit = True, select = True )
		elif Cache.playblastFormat == 'avi':
			cmds.radioButton ( avi, edit = True, select = True )
		# Codec Section
		codecOptionMenu = cmds.optionMenu ('codecOptionMenu', width = 160, label = 'Codec:    ' ); cmds.text( label=''); cmds.text( label='' )
		self.playblastFormat(Cache.playblastFormat)
		menuItems = cmds.optionMenu('codecOptionMenu', query = True, itemListLong = True)
		if Cache.playblastCodec in menuItems:
			cmds.optionMenu ('codecOptionMenu', e=True, v=Cache.playblastCodec)
		# Custom Width and Height Area
		#cmds.text( label='Custom:', align = 'left' ); customWidth = cmds.textField(text = 'W'); customHeight = cmds.textField(text = 'H')
		# Location of Playblasts
		inputField = cmds.textField( w =120, text = 'Change Location')
		cmds.text( label='')
		cmds.symbolButton(w=20, h=20, image = icon )
		# focus on input field so when enter is pressed it can just begin
		cmds.setFocus(inputField) 
		# Button to start the playblast
		cmds.button(w=180, h=30, label = 'PLAYBLAST', parent = mainLayout, c= partial( self.playblastExecute ) )
		#cmds.textField(inputField, edit = True, alwaysInvokeEnterCommandOnReturn = True, enterCommand = partial( self.playblastExecute ) )
		cmds.showWindow(window)
예제 #52
0
def iconViewer(fileName, fileType):

	# print(fileName, fileType)
	iconPath = lambda type, path="" : os.path.join( fileName, path, "*.%s" %type )

	iconType = "xpm"

	paths = glob.glob(iconPath( iconType ))

	print(iconPath(iconType), fileName, paths )

	cmds.window( title="Icon Viewer", w=300, h=300 )
	cmds.scrollLayout()
	cmds.rowColumnLayout( nc=10 )
	for path in paths:
		pathPieces = os.path.split(path)
		cmds.symbolButton( i=path, c=(lambda x: punched(path, pathPieces[1])))
	
	cmds.showWindow()
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))
예제 #54
0
	def createControl(self):
		filePath = os.path.join( self.path, self.iconName ) 
		print(filePath)
		if( self.controlType == "img" ):
			# Creating an picture
			if( self.controlType == "xpm"):
				self.element = cmds.picture( image=filePath, p=self.parent )
			else:
				self.element = cmds.image( image=filePath, p=self.parent )
		elif( self.controlType == "ctrl" ):
			# Creating a symbol button
			self.element = cmds.symbolButton( image=filePath, p=self.parent )
 def __init__(self):
     
     #get access to our maya tools
     toolsPath = cmds.internalVar(usd = True) + "mayaTools.txt"
     if os.path.exists(toolsPath):
         
         f = open(toolsPath, 'r')
         self.mayaToolsDir = f.readline()
         f.close()
         
         
     #check to see if window exists, if so, delete
     if cmds.window("fortniteHuskChooser_UI", exists = True):
         cmds.deleteUI("fortniteHuskChooser_UI")
         
     
     self.widgets = {}
     #build window
     self.widgets["window"] = cmds.window("fortniteHuskChooser_UI", w = 612, h = 350, title = "Choose Your Husk!", mnb = False, mxb = False, sizeable = False)
     
     #create the main layout
     self.widgets["topLevelLayout"] = cmds.formLayout(w = 612, h = 350)
     
     #add background image
     self.widgets["background"] = cmds.image(w = 612, h = 350, parent = self.widgets["topLevelLayout"], image = self.mayaToolsDir + "/General/Icons/Fortnite/huskChooser.jpg")
     
     #add the four husk buttons
     self.widgets["husk_Normal"] = cmds.symbolButton(w = 145, h = 287, image = self.mayaToolsDir + "/General/Icons/Fortnite/husk_normal.bmp", c = partial(self.chooseHusk, None))
     self.widgets["husk_Pitcher"] = cmds.symbolButton(w = 145, h = 287, image = self.mayaToolsDir + "/General/Icons/Fortnite/husk_pitcher.bmp", c = partial(self.chooseHusk, "pitcher"))
     self.widgets["husk_Female"] = cmds.symbolButton(w = 145, h = 287, image = self.mayaToolsDir + "/General/Icons/Fortnite/husk_female.bmp", c = partial(self.chooseHusk, "female"))
     self.widgets["husk_Fat"] = cmds.symbolButton(w = 145, h = 287, image = self.mayaToolsDir + "/General/Icons/Fortnite/husk_fat.bmp", c = partial(self.chooseHusk, "fat"))
     
     #place buttons
     cmds.formLayout(self.widgets["topLevelLayout"], edit = True, af = [(self.widgets["husk_Normal"], "top", 57),(self.widgets["husk_Normal"], "left", 7)])
     cmds.formLayout(self.widgets["topLevelLayout"], edit = True, af = [(self.widgets["husk_Pitcher"], "top", 57),(self.widgets["husk_Pitcher"], "left", 159)])
     cmds.formLayout(self.widgets["topLevelLayout"], edit = True, af = [(self.widgets["husk_Female"], "top", 57),(self.widgets["husk_Female"], "left", 310)])
     cmds.formLayout(self.widgets["topLevelLayout"], edit = True, af = [(self.widgets["husk_Fat"], "top", 57),(self.widgets["husk_Fat"], "left", 461)])
     
     #show the window
     cmds.showWindow(self.widgets["window"])
def channelbox_command_Symbol_update(box, key, *args):
    with sysCmd.Undo(0):
        if key == "manipsState":
            if box.saved_states[key][0] == 1:
                image = "channelBoxNoManips.png"
            elif box.saved_states[key][0] == 2:
                image = "channelBoxInvisibleManips.png"
            else:
                image = "channelBoxUseManips.png"
        elif key == "speedState":
            if box.saved_states[key][0] == 1:
                image = "channelBoxSlow.png"
            elif box.saved_states[key][0] == 2:
                image = "channelBoxMedium.png"
            else:
                image = "channelBoxFast.png"
        else:
            if box.saved_states[key][0] == 1:
                image = "channelBoxHyperbolicOn.png"
            else:
                image = "channelBoxHyperbolicOff.png"

        cmds.symbolButton(box.symbols[key], e=1, image=image)
예제 #57
0
def bldTargetList_column(source):#init and proc change
	apply_commitUI=partial(runMethod,'commitUI','()')
	mc.setParent('target')
	opt=mc.optionMenu('targetOpt',q=1,sl=1)
	#Delete
	if mc.columnLayout('targetColumn',q=1,ex=1):mc.deleteUI('targetColumn')
	#Build
	mc.columnLayout('targetColumn')
	#Decide
	if opt==1:
		mc.rowColumnLayout(numberOfColumns=3,columnWidth=[(1,55),(2,15),(3,275)])

		mc.setParent('..')
		mc.rowColumnLayout(numberOfColumns=4,columnWidth=[(1, 55),(2,15), (3, 275), (4, 25)])
		mc.text(al='right',font='tinyBoldLabelFont',label='Shot: ')
		mc.text('')
		mc.textField('renderFolder',font='tinyBoldLabelFont',text=mc.getAttr('renderLayerManager.shotName'),cc=apply_commitUI)#,en=mc.getAttr('renderLayerManager.EnableRenderFolder')
		mc.symbolButton('renderFolderButton',w=25,h=25,image=iconPath+'openFolder_30.png',c=partial(runMethod,'browse','(\'renderFolder\')'))#,en=mc.getAttr('renderLayerManager.EnableRenderFolder'),
		
		mc.text(al='right',font='tinyBoldLabelFont',label='Custom: ') 
		mc.checkBox('EnableAbsRenderFolder',l='',onc=partial(runMethod,'toggleL2F','(0)'),ofc=partial(runMethod,'toggleL2F','(1)'),v=mc.getAttr('renderLayerManager.enableAbsoluteRenderFolder'),cc=apply_commitUI)	
		mc.textField('absoluteFolder',font='tinyBoldLabelFont',en=mc.getAttr('renderLayerManager.enableAbsoluteRenderFolder'),text=mc.getAttr('renderLayerManager.absoluteRenderFolder'), h=15,cc=apply_commitUI)
		mc.symbolButton('absFolderButton',w=25,h=25,image=iconPath+'openFolder_30.png',en=mc.getAttr('renderLayerManager.enableAbsoluteRenderFolder'),c=partial(runMethod,'browse','(\'absoluteFolder\')'))
		mc.setParent('..')
		mc.rowColumnLayout('optList',numberOfColumns=3,columnWidth=[(1,55),(2,15),(3,275)])#,bgc=[0.105,0.105,0.105]
		mc.text(al='right',font='tinyBoldLabelFont',label='  Prefix: ')
		mc.checkBox('EnablePrefixName',l='',v=mc.getAttr('renderLayerManager.enablePrefixRenderLayer'),onc=partial(runMethod,'mc.textField','("Prefix",e=1,en=1)'),ofc=partial(runMethod,'mc.textField','("Prefix",e=1,en=0)'),cc=apply_commitUI)	
		mc.textField('Prefix',font=fieldFont,en=mc.getAttr('renderLayerManager.enablePrefixRenderLayer'),text=mc.getAttr('renderLayerManager.prefixRenderLayer'),cc=apply_commitUI)
		mc.text(al='right',font='tinyBoldLabelFont',label=' One File: ')
		mc.checkBox('EnableSingleFile',l='',v=mc.getAttr('renderLayerManager.enableSingleFileName'),onc=partial(runMethod,'mc.textField','("singleFile",e=1,en=1)'),ofc=partial(runMethod,'mc.textField','("singleFile",e=1,en=0)'),cc=apply_commitUI)
		mc.textField('singleFile',font='tinyBoldLabelFont',en=mc.getAttr('renderLayerManager.enableSingleFileName'),text=mc.getAttr('renderLayerManager.singleFileName'),cc=apply_commitUI)
		mc.setParent('..')
		bldTargetList_scroll(source)
	if opt==2:
		AE.UI()
	else:
		bldTargetList_scroll(source)
예제 #58
0
def GenerateTextureUI(*args):
    log.info("@ui")
    #Create a window
    win = "textureRefresher"
    if cmds.window(win, exists=True):
        cmds.deleteUI(win, window=True)

    win = cmds.window(win, title="Texture Refresher", wh=(545, 350), sizeable=False, mxb=False)
    _mainForm = cmds.formLayout("mainForm", nd=100)
    width = (545 /3) - 15
    cmds.rowColumnLayout( numberOfColumns=3, columnWidth=[(1, width), (2, width), (3, width)])
    #get path from current Directory
    path = cmds.workspace(q=True, rd=True) + "images/"
    #create image buttons using icons exported from @psdFile
    for i in range(0, len(layerNames)):
        cmds.symbolButton(image=(path + layerNames[i] + "Icon." + imageExt), w=width, h=width, c=functools.partial(SetLayerForPSD, i), ann="Swap Texture with Blood_Splatter %s" % str(i+1))

    #create a button to refresh thumbnails
    cmds.button(l="Refresh", c=SetupNetwork, bgc=(0.2,0.0,0), ebg=True, ann="Refresh Thumbnails")


    cmds.showWindow(win)
    cmds.window(win, edit=True, wh=(545, 350))
    pass