コード例 #1
0
	def buildGUI(self):
	
		if cmds.window(self.name, q=True, exists=True):
			cmds.deleteUI(self.name)
		cmds.window(self.name, title=self.title, sizeable=False, mxb=False, mnb=False, toolbox=False, w=100, h=30)
		cmds.columnLayout("mainLayout", adj=True, parent=self.name, co=("left", 5))

		# Add onClose Event
		cmds.scriptJob(uiDeleted=(self.name, self.onClose))
		
		# Help Menu
		cmds.menuBarLayout("menuBar")
		cmds.menu(label="Show Help", helpMenu =True, pmc=self.showHelp)

		# Import paths
		cmds.textFieldButtonGrp("tfbDBPath", label="Links: ", bl="Set Link Path", cw=(1,50), parent="mainLayout", bc=self.setDBPath)
		cmds.textFieldButtonGrp("tfbShaderPath", label="Shaders: ", bl="Set Shader Path", cw=(1,50), parent="mainLayout", bc=self.setShaderPath)
		
		cmds.checkBox("cbSelection", label="Use Selection", parent="mainLayout")
		cmds.checkBox("cbSubstring", label="Substring prefix", parent="mainLayout", value=True)
		cmds.textField("tfSubstring", parent="mainLayout", text="s100_char")

		cmds.separator(h=10, style="none", parent="mainLayout")

		# Buttons
		cmds.rowColumnLayout("buttonsLayout", numberOfColumns=2, parent="mainLayout")
		cmds.button("bExportLinks", label = "Export Links", w=200, h=30, parent="buttonsLayout", c=self.exportLinks)
		cmds.button("bImportShader", label="Link Shaders", w=200, h=30, parent="buttonsLayout", c=self.linkShaders)

		cmds.showWindow(self.name)
コード例 #2
0
ファイル: FinallingRig.py プロジェクト: edeglau/storage
    def create_controller_window(self, winName="Controller"):
        global colMenu
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

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

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

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')


        getCtrlType=["cluster", "circle"]        
        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=1, cellWidthHeight=(150, 20))
#         colMenu=cmds.optionMenu( label='ControllerType')
#         for each in getCtrlType:
#             cmds.menuItem( label=each)            
        cmds.button (label='make cluster control', p='listBuildButtonLayout', command = self.make_cluster_ctrl)
        cmds.button (label='make circle control', p='listBuildButtonLayout', command = self.make_circle_ctrl)
        cmds.button (label='make locator control', p='listBuildButtonLayout', command = self.make_loc_ctrl)
        cmds.showWindow(self.window)    
コード例 #3
0
ファイル: FBXExport.py プロジェクト: Jamesgary2015/FBXExport
def UI():
	if cmds.window('FBXExport',ex=True):
		cmds.deleteUI('FBXExport',wnd=True)
	window = cmds.window('FBXExport',t='FBX Export Version 1.0.0',wh=(450,300),sizeable=False)

	mainLayout = cmds.columnLayout(w=450, h=300)
	cmds.menuBarLayout()
	# cmds.menu(label ='About Me',helpMenu=True)
	cmds.menu(label='File')
	cmds.menuItem(label='About Me',c=AboutMe)
	cmds.menuItem(label='Help',c=Help)
	cmds.separator(st='in')
	cmds.columnLayout(columnAlign='left', columnAttach=('both', 50), rowSpacing=30, columnWidth=420)
	cmds.text(l='')
	cmds.optionMenu(label ='ExportType:',changeCommand=printNewMenuItem)
	cmds.menuItem( label='Export Selection' )
	cmds.menuItem( label='Export All' )
	
	cmds.rowColumnLayout(numberOfColumns=2)
	cmds.textField("filepath",w=270,pht=configpath, bgc=(0.2,0.2,0.2))
	cmds.button(l='path',w =50,h=20,c=browseFilePath)
	cmds.setParent( '..' )

	cmds.rowColumnLayout(numberOfColumns=2)
	cmds.button(l='Name:',w =50,h=20,en=False)
	cmds.textField('FileName',pht='Enter a filename',ed =True,w=270,bgc=(0.2,0.2,0.2))
	cmds.setParent( '..' )
	cmds.button(l='Export',bgc=(0.3,0.7,0.7),c=ExportFBX)

	cmds.showWindow(window)
コード例 #4
0
def jointMakeWin():
    ##== Create Main Window ==##

    if mc.window('jointMake', exists=True):
        mc.deleteUI('jointMake')

    createWin = mc.window('jointMake', t='jointMake', w=250, h=150)
    mc.columnLayout(adj=True)

    mc.separator(h=5)
    mc.text('Arm Joint')
    mc.separator(h=5)
    mc.rowLayout(nc=2)
    mc.button(l='Set Arm Position', w=150, h=50, c='createArmLoc()')
    mc.button(l='Create Arm Joint', w=150, h=50, c='createArmJnt()')
    mc.setParent('..')

    mc.separator(h=5)
    mc.text('Leg Joint')
    mc.separator(h=5)
    mc.rowLayout(nc=2)
    mc.button(l='Set Leg Position', w=150, h=50, c='createLegLoc()')
    mc.button(l='Create Leg Joint', w=150, h=50, c='createLegJnt()')
    mc.setParent('..')

    mc.menuBarLayout()
    mc.menu(label='Edit', to=False)
    mc.menuItem(label='Twist -> Bend', c='TtoB()')
    mc.menuItem(label='Bend -> Twist', c='BtoT()')
    mc.menuItem(label='Angle Diver', c='AngleD()')

    mc.showWindow(createWin)
コード例 #5
0
ファイル: HoofRig_Toe.py プロジェクト: edeglau/storage
    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)    
コード例 #6
0
ファイル: MayaSelectArray.py プロジェクト: edeglau/storage
    def create_select_array_window(self):
        
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

        self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=270, h=550 )

        cmds.menuBarLayout(h=30)
        self.fileMenu = cmds.menu( label='Clean Interface', pmc=self.clear_superflous_windows)
        cmds.rowColumnLayout  (' selectArrayRow ', nr=1, w=200)

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')

        cmds.rowLayout  (' rMainRow ', w=350, 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=(80, 20))
        cmds.button (label='Grab Node', p='listBuildButtonLayout', command = self._get_node_property)
        cmds.button (label='Grab Name', p='listBuildButtonLayout', command = self._get_name_property)
        cmds.button (label='Filter Node', p='listBuildButtonLayout', command = self._create_list_by_node_filter)
        cmds.popupMenu(button=1)
        cmds.menuItem  (label='filter selected by type and make list', command = self._create_list_by_node_filter)
        cmds.menuItem  (label='filter selected by type and add to list', command = self._add_list_by_node_filter)
        cmds.button (label='Filter Name', p='listBuildButtonLayout', command = self._create_list_by_name_filter)
        cmds.popupMenu(button=1)
        cmds.menuItem  (label='filter selected by name and make list', command = self._create_list_by_name_filter)
        cmds.menuItem  (label='filter selected by name and add to list', command = self._add_list_by_name_filter)
        cmds.button (label='All Node', p='listBuildButtonLayout', command = self._create_list_by_all_node)
        cmds.popupMenu(button=1)
        cmds.menuItem  (label='select all scene by type and make list', command = self._create_list_by_all_node)
        cmds.menuItem  (label='select all scene by type and add to list', command = self._add_list_by_all_node)
        cmds.button (label='All Name', p='listBuildButtonLayout', command = self._create_list_by_all_name)
        cmds.popupMenu(button=1)
        cmds.menuItem  (label='select all scene by name and make list', command = self._create_list_by_all_name)
        cmds.menuItem  (label='select all scene by name and add to list', command = self._add_list_by_all_name)
        cmds.text (label='Name or node type field',  p='selectArrayColumn')
        cmds.gridLayout('searchLayout', p='selectArrayColumn', numberOfColumns=2, cellWidthHeight=(80, 25))
        self.nodeName=cmds.textField(w=120, h=25, p='searchLayout')
        cmds.button (label='Find', command = self._find_in_list, p='searchLayout', w=20, ann='find this name in list below')
        cmds.popupMenu(button=1)
        cmds.menuItem  (label='Select in list only', command = self._find_in_list)
        cmds.menuItem  (label='Select in list and scene', command = self._find_in_listAndSelect)
        self.listCountLabel=cmds.text (label='Selection list', p='selectArrayColumn')
        self.nodeList=cmds.textScrollList( numberOfRows=8, ra=1, allowMultiSelection=True, sc=self.list_item_selectability, io=True, w=220, h=300, p='selectArrayColumn')
        cmds.gridLayout('listArrangmentButtonLayout', p='selectArrayColumn', numberOfColumns=4, cellWidthHeight=(40, 20))
        cmds.button (label='clr', command = self._clear_list, p='listArrangmentButtonLayout')
        cmds.button (label='+', command = self._add_selected_to_list, p='listArrangmentButtonLayout')
        cmds.button (label='-', command = self._remove_from_list, p='listArrangmentButtonLayout')
        cmds.button (label='><', command = self._swap_with_selected, p='listArrangmentButtonLayout', ann='swap out selected in list with selected in scene')
        cmds.button (label='sel all', command = self._select_all_in_list, p='listArrangmentButtonLayout', w=50, ann='select all')
        cmds.button (label='sel- ', command = self._clear_selection, p='listArrangmentButtonLayout', w=40, ann='select none')
        cmds.button (label='sort', command = self._sort_list, p='listArrangmentButtonLayout', w=40, ann='sort alphabetically-numerally')
        cmds.button (label='set', command = self._make_set_from_selection_list, p='listArrangmentButtonLayout', w=40, ann='create set from selected in list')
        cmds.text (label='Author: Elise Deglau',w=120, al='left', p='selectArrayColumn')
        cmds.text (label="elisedeglau.wordpress.com/2014/03/25/select-palette/", hl=1, w=300, al='left', p='selectArrayColumn')
        cmds.text (label='This work is licensed under a Creative Commons License', hl=1, w=300, al='left', p='selectArrayColumn')
        cmds.text (label='http://creativecommons.org/licenses/by/4.0/', hl=1, w=350, al='left', p='selectArrayColumn')        
        cmds.showWindow(self.window)
コード例 #7
0
ファイル: ziva_mirror.py プロジェクト: mortensm/maya-scripts
def ziva_mirrorUI():
    if (cmds.window('window1_ui', q=True, ex=True)):
        cmds.deleteUI('window1_ui')
    cmds.window('window1_ui', t=u'Ziva_Mirror')
    cmds.columnLayout(adj=True)
    cmds.menuBarLayout()
    cmds.button(l=u'L--->R', c=lefttoright)
    cmds.button(l=u'R--->L', c=righttoleft)
    cmds.showWindow('window1_ui')
コード例 #8
0
ファイル: editor.py プロジェクト: McManning/shaders
def addMenuBar(window):
    """Add dropdown menu bar"""
    cmds.menuBarLayout()
    # cmds.menu(label="File")
    # cmds.menu(label="Display")
    # cmds.menuItem(label="")

    cmds.menu(label="Help", helpMenu=True)
    cmds.menuItem(label="About", command="about(\"" + window + "\")")
    cmds.setParent("..")
コード例 #9
0
ファイル: ui.py プロジェクト: artbycrunk/maya-git
def createUI():

	preUI()

	mc.window( 'gitMayaWin', title="Git Tools", iconName='', widthHeight=(200, 55) )
	mc.menuBarLayout()
	mc.menu( label='File' )
	mc.menuItem( label='Create Repo', c=lambda *args: createRepo() )
	mc.setParent( '..' )
	mc.columnLayout( adjustableColumn=True )
	mc.rowLayout( numberOfColumns=3, columnWidth3=(80, 80, 80))
	mc.button( label='Create Repo', w=80, h=80)
	mc.button( label='Clone Repo', w=80, h=80)
	mc.setParent( '..' )
	mc.separator(h=10, style='none')
	mc.textFieldButtonGrp( 'repoPath', label='Repo Path', text='', buttonLabel='Browse', bc=lambda *args: getFolder() )
	mc.button( label='Refresh', c=lambda *args: initRepo() )
	mc.separator(h=10, style='none')
	mc.tabLayout(innerMarginWidth=5, innerMarginHeight=5)
	mc.columnLayout( 'Files', adjustableColumn=True )
	mc.rowColumnLayout(nc=5)
	mc.separator(h=20, style='none')
	mc.text(l='Working Copy Changes')
	mc.separator(h=20, style='none')
	mc.separator(h=20, style='none')
	mc.text(l='Staged Changes')
	mc.columnLayout( 'workingChangesColor', adjustableColumn=True)
	mc.setParent( '..' )
	mc.textScrollList( 'workingChanges', numberOfRows=16, allowMultiSelection=True)
	mc.columnLayout( adjustableColumn=True )
	mc.button( label='>>', c=lambda *args: addChanged())
	mc.button( label='>' )
	mc.separator(h=30, style='none')
	mc.button( label='<', c=lambda *args: remSelected())
	mc.button( label='<<' )
	mc.setParent( '..' )
	mc.columnLayout( 'stagedChangesColor', adjustableColumn=True )
	mc.setParent( '..' )
	mc.textScrollList( 'stagedChanges', numberOfRows=16, allowMultiSelection=True)
	mc.setParent( '..' )
	mc.textFieldButtonGrp( 'commitMessage', label='Message', text='', buttonLabel='Commit', bc=lambda *args: doCommit() )
	mc.separator(h=20)
	mc.setParent( '..' )

	mc.columnLayout( 'History', adjustableColumn=True )
	mc.intFieldGrp( 'commitCount', numberOfFields=1, label='Number of Commits', value1=10, cc=lambda *args: getCommits())
	mc.scrollLayout(h=250, horizontalScrollBarThickness=16, verticalScrollBarThickness=16)
	mc.rowColumnLayout( 'commitsGrid', numberOfColumns=2, cw=([1,450],[2,150]) )
	mc.setParent( '..' )
	mc.setParent( '..' )
	mc.text(l='Commited Changes')
	mc.textScrollList( 'commitChanges', numberOfRows=16, allowMultiSelection=True)
	mc.showWindow( 'gitMayaWin' )

	postUI()
コード例 #10
0
ファイル: Colours.py プロジェクト: edeglau/storage
    def create_colour_window(self, winName="Colors"):
        global colMenu
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

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

        cmds.menuBarLayout(h=30)
        stringField='''"Colours"  (launches window)colour multiple objects(controllers) without having to go through
    attribute editor
        * Step 1: select object(s)
        * Step 2: launch window
        * Step 3: set colour from dropdown menu
        * Step 4: press "go" will change the display colors of all selected items'''
        self.fileMenu = cmds.menu( label='Help', hm=1, pmc=lambda *args:toolClass.helpWin(stringField))        
        cmds.rowColumnLayout  (' selectArrayRow ', nr=1, w=150)

        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=(150, 20))
        colMenu=cmds.optionMenu( label='Colors', w=150)
        cmds.menuItem( label='Bright Red' )#1
        cmds.menuItem( label='Bright Blue' )#2
        cmds.menuItem( label='Bright Green' )#3
        cmds.menuItem( label='Bright Yellow' )#4
        cmds.menuItem( label='Dark Yellow' )#5    
        cmds.menuItem( label='Dull Green' )#6     
        cmds.menuItem( label='Dark Red' )#7  
        cmds.menuItem( label='Dark Purple' )#8 
        cmds.menuItem( label='Darkest Blue' ) #9
        cmds.menuItem( label='Dark Green' ) #10
        cmds.menuItem( label='Dark Blue' )#11
        cmds.menuItem( label='Darkest Blue' )#12
        cmds.menuItem( label='Light Pink' ) #13 
        cmds.menuItem( label='Light Brown' )#14
        cmds.menuItem( label='Light Blue' )#15
        cmds.menuItem( label='Maroon' )#16
        cmds.menuItem( label='Torquise' )#17             
        cmds.menuItem( label='Skin' )#18
        cmds.menuItem( label='Brown' )#19
        cmds.menuItem( label='White' )#20     
        cmds.menuItem( label='Pink' )#21
        cmds.menuItem( label='Forest Green' )#22
        cmds.menuItem( label='Teal Green' )#23
        cmds.menuItem( label='Purple' )#24
        cmds.menuItem( label='Black' ) #25
        cmds.menuItem( label='Grey' ) #26
        cmds.button (label='Go', w=150, p='listBuildButtonLayout', command = self._change_colour)
        cmds.showWindow(self.window)
コード例 #11
0
ファイル: rcFileManager.py プロジェクト: RobRuckus/rcTools
def UI():
        rlmAttrs()
        images=os.path.join(mc.workspace(q=1,rd=1),"images",mc.getAttr("renderLayerManager.shotName"))
        if (mc.window('rcFileManage',exists=True)): mc.deleteUI('rcFileManage')
        mc.window('rcFileManage', mxb=0,title=' ',tlb=False,)

        ###Main
        mc.columnLayout('renderLayers2Files')#,bgc=[0.2,0.2,0.2] 
        mc.image(image=iconPath+'toptitle.png')
        mc.cmdScrollFieldReporter(clr=1,hf=0,w=700,h=80,bgc=[0,0,0])
        print '//rc.Tools'
	mc.setParent('..')

	mc.rowColumnLayout(numberOfColumns=3,columnWidth=[(1,row1),(2,row2),(3,480)])
	
	mc.text(al='right',font=ui.titleFont,label='  Image Prefix: ')
	mc.menuBarLayout()
	mc.menu(label='Shot Name/')
	mc.menuItem(label='<RenderLayer>/<RenderLayer>',c=partial(runMethod,'set.imagePrefix','("S__L__L")'))
	mc.menuItem(label='<RenderLayer>/<RenderLayer>.<RenderPass>',c=partial(runMethod,'set.imagePrefix','("S__L__L.P")'))
	mc.menuItem(label='<RenderLayer>/<RenderPass>/<RenderLayer>.<RenderPass>',c=partial(runMethod,'set.imagePrefix','("S__L__P__L.P")'))
	mc.menu(label='...')
	mc.menuItem(label='<RenderLayer>/<RenderLayer>',c=partial(runMethod,'set.imagePrefix','("L__L")'))
	mc.menuItem(label='<RenderLayer>/<RenderLayer>.<RenderPass>',c=partial(runMethod,'set.imagePrefix','("L__L.P")'))
	mc.menuItem(label='<RenderLayer>/<RenderPass>/<RenderLayer>.<RenderPass>',c=partial(runMethod,'set.imagePrefix','("L__P__L.P")'))
	mc.setParent('..')
	mc.textField('imageFilePrefix',font=ui.fieldFont,en=1,text=mc.getAttr('defaultRenderGlobals.imageFilePrefix'))    
	
	mc.setParent('..')
	mc.setParent('..')

	###ListsUI
	mc.rowColumnLayout('listLayout',numberOfColumns=3,columnWidth=[(1,102),(2,browselistWidth), (3, targetlistWidth)])#LISTS LAYOUT

	mc.columnLayout()
	mc.separator(h=10,style='in')
	
	mc.rowColumnLayout(numberOfColumns=2)
	mc.text('UNITS:  ',align='right',fn='tinyBoldLabelFont')
	mc.text(str(mc.currentUnit(query=True)),align='left',fn='tinyBoldLabelFont')
	mc.text('FPS:  ',align='right',fn='tinyBoldLabelFont')
	mc.text(str(sceneData.fps()),align='left',fn='tinyBoldLabelFont')
	mc.text('RENDER:  ',align='left',fn='tinyBoldLabelFont')
	mc.text(str(mc.getAttr('defaultResolution.width'))+'x'+str(mc.getAttr('defaultResolution.height')),align='left',fn='tinyBoldLabelFont')
	mc.setParent('..')
	mc.setParent('listLayout')
	bldBrowseList()
	mc.setParent('listLayout')
	bldTargetList('browser')
	mc.setParent('listLayout')
	mc.showWindow()	
コード例 #12
0
ファイル: channelbox_legacy.py プロジェクト: lazerdaze/lancer
def menu():
	ui = cmds.menuBarLayout()
	cmds.menu(l='UI', hm=True)
	cmds.menuItem(l='Close', c=removeUI)

	cmds.menu(l='Evaluation')
	prefsRadioMenu(pref='evaluation')

	# cmds.menu(l='Playblast')
	# cmds.menuItem(l='Temp Settings', c=playblastTemp)

	cmds.menu(l='Tangents')
	prefsRadioMenu(pref='default tangent', )
	cmds.menuItem(l='', divider=True)
	cmds.menuItem(l='Weighted tangents', checkBox=(cmds.keyTangent(q=True, g=True, wt=True)),
				  c=lambda x: cmds.keyTangent(e=True, g=True, wt=x))

	cmds.menu(l='Time')
	prefsRadioMenu(pref='playback speed', )
	prefsRadioMenu(pref='frames per second', )
	# cmds.menuItem(l='', divider=True)
	# keepFrames = cmds.menuItem(l='Keep keys at current frames', checkBox=False)

	# cmds.menu(l='World')
	# prefsRadioMenu(pref='up axis', )
	cmds.setParent('..')
	return ui
コード例 #13
0
def menu(*args):
	ui = cmds.menuBarLayout()
	cmds.menu(l='Add')
	cmds.menuItem(l='Edit')
	cmds.menuItem(l='Remove')
	cmds.setParent('..')
	return ui
コード例 #14
0
ファイル: Anim_tools.py プロジェクト: edeglau/storage
    def create(self):
        
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

        self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=320, h=600 )

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

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')

        cmds.rowLayout  (' rMainRow ', w=320, 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=(120, 20))
        cmds.button (label='Schematic', p='listBuildButtonLayout', ann="This will open a schematic for selected character", command = self._schematic)         
        cmds.button (label='CombineSelectMirror', p='listBuildButtonLayout', ann="This will add opposite control to the selection", command = self._combine_select)         
        cmds.button (label='MirrorTransform', p='listBuildButtonLayout', ann="This will mirror the transform to the opposite controller", command = self._mirror_transform) 
#         cmds.button (label='MirrorTransformFace', p='listBuildButtonLayout', ann="This will mirror the transform to the opposite controller", command = self._mirror_transform_face) 
        cmds.button (label='MatchTransform', p='listBuildButtonLayout', ann="This will match the relative transform of the first selection", command = self._match_transform) 
        cmds.button (label='MatchMatrix', p='listBuildButtonLayout', ann="This will match the exact matrix of the first selection", command = self._match_matrix) 
        #cmds.button (label='SelectMouth', p='listBuildButtonLayout', ann="This will select the characters mouth",command = self._select_mouth) 
        cmds.button (label='mirrorSelect', p='listBuildButtonLayout',  ann="This will change the selection to the mirror controller of the current selected",command = self._mirror_select) 
        cmds.button (label='mirrorMouth', p='listBuildButtonLayout', ann="This will mirror one side of the mouth to the other(will not affect control box attributes)", command = self._mirror_mouth) 
        cmds.button (label='mirrorBrows', p='listBuildButtonLayout', ann="This will mirror a brow position to the other(will not affect control box attributes)", command = self._mirror_brows)  
        cmds.button (label='mirrorEyes', p='listBuildButtonLayout', ann="This will mirror an eye position to the other", command = self._mirror_eyes)  
        cmds.button (label='mirrorFace', p='listBuildButtonLayout', ann="This will mirror the entire face to the other(will not affect control box attributes)", command = self._mirror_face)  
        cmds.button (label='ResetMouth', p='listBuildButtonLayout', ann="This will reset the mouth positions(anim transform controls only - will not affect control box attributes)",command = self._reset_mouth) 
        cmds.button (label='ResetSelected', p='listBuildButtonLayout', ann="This will reset the selected to 0.0(transforms only - will not affect control box attributes)", command = self._reset_selected)
        cmds.button (label='DisplayAnim', p='listBuildButtonLayout', ann="This sets the viewport to show only poly and curve", command = self._display_anim)
#         cmds.button (label='Shapes', p='listBuildButtonLayout', command = self._make_shape)           
        #cmds.text(label="")
        cmds.text(label="FK=IK")
        #cmds.separator()
        cmds.text(label="")
        cmds.button (label='ArmIK_2_FK', p='listBuildButtonLayout', ann="This will match the arm IK chain to the FK position",command = self._ikToFK_Arm)
        cmds.button (label='ArmFK_2_IK', p='listBuildButtonLayout', ann="This will match the arm FK chain to the IK position", command = self._fkToIK_Arm)
        cmds.button (label='LegIK_2_FK', p='listBuildButtonLayout', ann="This will match the leg IK chain to the FK position",command = self._ikToFK_Leg)
        cmds.button (label='LegFK_2_IK', p='listBuildButtonLayout', ann="This will match the leg FK chain to the IK position", command = self._fkToIK_Leg)
        cmds.text(label="other tools")
        cmds.text(label="")
        cmds.button (label='SelectArray', p='listBuildButtonLayout', ann="This is a custom tool to build up a user selection array or search and filter for specific nodes/names", command = self._select_array)        
        cmds.button (label='Switch Arm Cnst', p='listBuildButtonLayout', ann="resets arm in position on constraint switch", command = self._switch_arm_ik_cnstrnt)        
        #cmds.symbolButton (p='listBuildButtonLayout', command = self.Face, image="D:\myGraphics\icons\SP.jpg")      
        cmds.showWindow(self.window)
コード例 #15
0
def appendUI():
    """UI for appendPath script"""

    #create window with 3 text fields, buttons call up proc to add path
    if cmds.window("appendPath", exists=True):
        cmds.deleteUI("appendPath")

    widgets["win"] = cmds.window("appendPath", t="zbw_appendPath", w=500, h=5, s=False, rtf=True)

    #create some menus for saving and loading
    cmds.setParent(widgets["win"])
    widgets["menu"] = cmds.menuBarLayout()
    widgets["menuFile"] = cmds.menu(label="file")
    cmds.menuItem(l='Clear Values', c=clearValues)
    cmds.menuItem(l="Save Add Paths", c=saveValues)
    cmds.menuItem(l="Load Add Paths", c=loadValues)

    widgets["tabLO"] = cmds.tabLayout(h=210)
    widgets["columnLO"] = cmds.columnLayout("Add Paths", w=500)
    widgets["path1"] = cmds.textFieldButtonGrp(l="path1", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 1))
    widgets["path2"] = cmds.textFieldButtonGrp(l="path2", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 2))
    widgets["path3"] = cmds.textFieldButtonGrp(l="path3", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 3))
    widgets["melCBG"] = cmds.checkBoxGrp(ncb=1, l1="also add to mel path (MAYA_SCRIPT_PATH)", v1=1, cal=[(1, "left"), (2,
                                                                                                                 "left")], cw = [(1, 100), (2,25)])
    cmds.separator(h=10, st="single")

    widgets["buttonRCL"] = cmds.rowColumnLayout(nc=3, w=500, cw=[(1,123),(2,247 ),(3,123)])
    widgets["addCloseBut"] = cmds.button(l="Add and Close", w=120, h=30, bgc=(.6, .8, .6), c=applyClose)
    widgets["addBut"] = cmds.button(l="Add Paths!", w=245, h=30, bgc=(.8, .8, .6), c=apply)
    widgets["closeBut"] = cmds.button(l="Close", w=120, h=30, bgc=(.8,.6,.6), c=close)

    cmds.setParent(widgets["columnLO"])
    cmds.separator(h=5, style="single")

    cmds.text("Click the '<<<' buttons to browse for paths to add. Click the 'Add' button to add those \npaths to the 'sys.path' list. Use the 'ViewPath' tab to view current list of paths.", al="center")
    cmds.text("Use 'file->save' to save the selected paths. Use 'file->load' to load previously saved paths")

    #back to window
    cmds.setParent(widgets["tabLO"])
    widgets["columnLO2"] = cmds.columnLayout("View Paths", w=500)
    cmds.text("Double-click to display full path in script editor")
    widgets["listTSL"] = cmds.textScrollList(w=500, h=120, fn="smallPlainLabelFont", append=["click button below",
                                                                                           "to refresh this list!"], dcc=printMe)
    refresh()
    cmds.separator(h=5, style="single")

    widgets["columnLO3"] = cmds.columnLayout(w=500)
    widgets["refreshBut"] = cmds.button(l="Refresh Paths", w=500, h=20, bgc=(.5, .5, .6), c=refresh)

    cmds.rowColumnLayout(nc=3, cw=[(1,200),(2,150 ),(3,150)])
    widgets["removeBut"] = cmds.button(l="Remove Selected", w=180,  h=20, bgc=(.7, .5, .5), c=removePath)
    widgets["topBut"] = cmds.button(l="Selected To Top", w=130, h=20, bgc=(.7, .5, .5), c=topPath)
    widgets["bottomBut"] = cmds.button(l="Selected To Bottom", w=130, h=20, bgc=(.7, .5, .5), c=bottomPath)

    #load (and check) previous saves


    cmds.showWindow(widgets["win"])
    cmds.window(widgets["win"], e=True, w=5, h=5, rtf=True)
コード例 #16
0
    def _showUI(self):

        self.close()
        window = cmds.window(self.win, title=self.win, s=True, widthHeight=(450, 700))

        cmds.menuBarLayout()
        cmds.menu(l=LANGUAGE_MAP._Generic_.tools)
        cmds.menuItem(l=LANGUAGE_MAP._Generic_.vimeo_help,
                      c="import Red9.core.Red9_General as r9General;r9General.os_OpenFile('https://vimeo.com/459389038')")
        cmds.menuItem(divider=True)
        cmds.menuItem(l='Delete SceneNode Data', c=self.delete)

        cmds.scrollLayout('reviewScrollLayout', rc=lambda *args: self._resizeTextScrollers(), cr=True)
        cmds.columnLayout(adjustableColumn=True, columnAttach=('both', 5))
        cmds.textFieldGrp('author', l=LANGUAGE_MAP._SceneReviewerUI_.author, ed=False, text='')
        cmds.textFieldGrp('date', l=LANGUAGE_MAP._SceneReviewerUI_.date, ed=False, text='')
        cmds.textFieldGrp('sceneName', l=LANGUAGE_MAP._SceneReviewerUI_.scene_name, ed=False, text='')
        cmds.separator(h=15, style='none')
        cmds.text(l=LANGUAGE_MAP._SceneReviewerUI_.comment)
        cmds.scrollField('comment', text='', ed=True, h=200, wordWrap=False,
                         kpc=partial(self.updateInternalDict),
                         cc=partial(self.updateInternalDict))
        cmds.button(l=LANGUAGE_MAP._SceneReviewerUI_.new_comment, bgc=r9Setup.red9ButtonBGC(1), c=partial(self.addNewComment))
        cmds.separator(h=15, style='none')
        cmds.text(l=LANGUAGE_MAP._SceneReviewerUI_.history)
        cmds.scrollField('history', editable=False, en=True, wordWrap=False, h=200, text='')
        cmds.separator(h=15, style='none')
        cmds.rowColumnLayout('SceneNodeActivatorRC', numberOfColumns=3, columnWidth=[(1, 200), (2, 200)])
        cmds.button('setReviewActive', l=LANGUAGE_MAP._SceneReviewerUI_.activate_live_review,
                                        bgc=r9Setup.red9ButtonBGC(1),
                                        c=lambda x: self._setReviewStatus('active'))
        cmds.button('setReviewInActive', l=LANGUAGE_MAP._SceneReviewerUI_.disable_live_review,
                                        bgc=r9Setup.red9ButtonBGC(1),
                                        c=lambda x: self._setReviewStatus('inactive'))
        cmds.setParent('..')
        cmds.separator(h=15, style='none')
        cmds.iconTextButton(style='iconOnly', bgc=(0.7, 0, 0), image1='Rocket9_buttonStrap2.bmp',
                                 c=lambda *args: (r9Setup.red9ContactInfo()), h=22, w=200)
        cmds.showWindow(window)
        self._refresh()

        if self.SceneReviewer.exists():
            self._setReviewStatus('active')
        else:
            self._setReviewStatus('inactive')
コード例 #17
0
    def buildUI(self,*args):
        if cmds.window(self.winname, exists=True):
            self.closeUI()

        self.getSettings()

        mTCWin = cmds.window(self.winname, title = 'Motion To Curve', rtf = True, width = 270, minimizeButton=False,
                             maximizeButton=False, sizeable=False)

        cmds.columnLayout(adjustableColumn = True)
        menuBarLayout = cmds.menuBarLayout()
        cmds.menu(label='Edit')
        cmds.menuItem(label='Reset Settings', command = partial(self.resetSettings))
        cmds.setParent('..')
        cmds.frameLayout(label='', borderStyle='etchedIn',lv=False, cll = False, w=260)
        cmds.separator(style='none')
        cmds.rowLayout(numberOfColumns=2, columnWidth2=(120, 80), adjustableColumn=2, columnAlign=(1, 'right'), ct2=['both','both'], co2=[0,5])
        cmds.text('n_txt_alignTo',label = 'Track Axis:', ann = "Determines which Axis to track motion")
        cmds.rowLayout(numberOfColumns=3, columnWidth3=(40,40,40), adjustableColumn=3, columnAlign=(1, 'right'), ct3=['both','both','both'], co3=[0,5,0])
        self.axisX = cmds.checkBox('n_cB_mTCWin_trackX', l='X', v = self.trackX)
        self.axisY = cmds.checkBox('n_cB_mTCWin_trackY',l='Y', v = self.trackY)
        self.axisZ = cmds.checkBox('n_cB_mTCWin_trackZ', l='Z', v = self.trackZ)
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.separator(style='none')
        cmds.setParent('..')

        cmds.frameLayout(label='', borderStyle='etchedIn',lv=False)
        cmds.separator(style='none')
        cmds.rowLayout(numberOfColumns=2, columnWidth2=(120, 80), adjustableColumn=2, columnAlign=(1, 'right'), ct2=['both','both'], co2=[0,5])
        cmds.text(label = 'Start Time:', ann = "Frame number to start track")
        cmds.intField('n_iF_mTC_sTime', v = self.sTime)
        cmds.setParent( '..' )
        cmds.rowLayout(numberOfColumns=2, columnWidth2=(120, 80), adjustableColumn=2, columnAlign=(1, 'right'), ct2=['both','both'], co2=[0,5])
        cmds.text(label = 'End Time:', ann = "Frame number to end track")
        cmds.intField('n_iF_mTC_eTime', v = self.eTime)
        cmds.setParent('..')
        cmds.separator(style='none')
        cmds.setParent('..')

        cmds.frameLayout(label='', borderStyle='etchedIn',lv=False)
        cmds.separator(style='none')
        cmds.rowLayout(numberOfColumns=2, columnWidth2=(120, 80), adjustableColumn=2, columnAlign=(1, 'right'), ct2=['both','both'], co2=[0,5])
        cmds.text(label = 'Frame Sampling:', ann = "How often, in frames, to sample data for curve points")
        cmds.intField('n_iF_mTC_fSamples', v = self.fSamples)
        cmds.setParent('..')
        cmds.separator(style='none')
        cmds.setParent('..')

        #Add in bottom button row
        cmds.rowLayout( numberOfColumns=3, columnWidth3=(88,88,88), adjustableColumn=3, columnAlign=(1, 'right'), ct3=['both','both','both'], co3=[0,0,0])
        cmds.button(label = "Track", command = partial(self.track))
        cmds.button(label = "Apply", command = partial(self.apply))
        cmds.button(label = "Close", command = partial(self.closeUI))
        cmds.setParent( '..' )

        cmds.showWindow(mTCWin)
コード例 #18
0
def appendUI():
    """UI for appendPath script"""

    #create window with 3 text fields, buttons call up proc to add path
    if cmds.window("appendPath", exists=True):
        cmds.deleteUI("appendPath")

    widgets["win"] = cmds.window("appendPath", t="zbw_appendPath", w=500, h=210, s=False)

    #create some menus for saving and loading
    cmds.setParent(widgets["win"])
    widgets["menu"] = cmds.menuBarLayout()
    widgets["menuFile"] = cmds.menu(label="file")
    cmds.menuItem(l='Clear Values', c=clearValues)
    cmds.menuItem(l="Save Add Paths", c=saveValues)
    cmds.menuItem(l="Load Add Paths", c=loadValues)

    widgets["tabLO"] = cmds.tabLayout(h=210)
    widgets["columnLO"] = cmds.columnLayout("Add Paths", w=500)
    widgets["path1"] = cmds.textFieldButtonGrp(l="path1", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 1))
    widgets["path2"] = cmds.textFieldButtonGrp(l="path2", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 2))
    widgets["path3"] = cmds.textFieldButtonGrp(l="path3", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 3))

    cmds.separator(h=10, st="single")

    widgets["buttonRCL"] = cmds.rowColumnLayout(nc=3, w=500, cw=[(1,123),(2,247 ),(3,123)])
    widgets["addCloseBut"] = cmds.button(l="Add and Close", w=120, h=30, bgc=(.6, .8, .6), c=applyClose)
    widgets["addBut"] = cmds.button(l="Add Paths!", w=245, h=30, bgc=(.8, .8, .6), c=apply)
    widgets["closeBut"] = cmds.button(l="Close", w=120, h=30, bgc=(.8,.6,.6), c=close)

    cmds.setParent(widgets["columnLO"])
    cmds.separator(h=5, style="single")

    cmds.text("Click the '<<<' buttons to browse for paths to add. Click the 'Add' button to add those \npaths to the 'sys.path' list. Use the 'ViewPath' tab to view current list of paths.", al="center")
    cmds.text("Use 'file->save' to save the selected paths. Use 'file->load' to load previously saved paths")

    #back to window
    cmds.setParent(widgets["tabLO"])
    widgets["columnLO2"] = cmds.columnLayout("View Paths", w=500)
    cmds.text("Double-click to display full path in script editor")
    widgets["listTSL"] = cmds.textScrollList(w=500, h=100, fn="smallPlainLabelFont", append=["click button below", "to refresh this list!"], dcc=printMe)
    refresh()
    cmds.separator(h=5, style="single")

    widgets["columnLO3"] = cmds.columnLayout(w=500)
    widgets["refreshBut"] = cmds.button(l="Refresh Paths", w=500, h=20, bgc=(.5, .5, .6), c=refresh)

    cmds.rowColumnLayout(nc=3, cw=[(1,200),(2,150 ),(3,150)])
    widgets["removeBut"] = cmds.button(l="Remove Selected", w=180,  h=20, bgc=(.7, .5, .5), c=removePath)
    widgets["topBut"] = cmds.button(l="Selected To Top", w=130, h=20, bgc=(.7, .5, .5), c=topPath)
    widgets["bottomBut"] = cmds.button(l="Selected To Bottom", w=130, h=20, bgc=(.7, .5, .5), c=bottomPath)

    #load (and check) previous saves


    cmds.showWindow(widgets["win"])
    cmds.window(widgets["win"], e=True, w=500, h=210)
コード例 #19
0
ファイル: multiFunctions.py プロジェクト: edeglau/storage
    def multi_function_window(self, winName="Colors"):
        global colMenu
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

        self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=300, h=100 )
        cmds.menuBarLayout(h=30)
        stringField='''"MultiFunctions" (launches window)does a mass constraint or extrude. Constrains all items 
    to the first selected item or extrudes first selected item as a tube along several 
    curves
        * Step 1: select object to constrain items to(or run on path)
        * Step 2: select multiple objects to constrain (or run a path on)
        * Step 3: select function from dropdown menu
        * Step 4: if using paths, set length and wide spans
        * Step 5: Press go'''
        self.fileMenu = cmds.menu( label='Help', hm=1, pmc=lambda *args:toolClass.helpWin(stringField))  
        cmds.rowColumnLayout  (' selectArrayRow ', nr=1, w=300)

        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('listBuildLayout', p='selectArrayColumn', numberOfColumns=1, cellWidthHeight=(300, 20))
        colMenu=cmds.optionMenu( label='Functions', w=300)
        cmds.menuItem( label="orient_constraint" )#1
        cmds.menuItem( label="aim_constraint")#2
        cmds.menuItem( label="parent_constraint")#3
        cmds.menuItem( label="point_constraint" )#4
        cmds.menuItem( label="extrude_tube")#5    
        cmds.menuItem( label="extrude_path")#5          
        cmds.menuItem( label="xform")#6 
        # cmds.menuItem( label="multi point")#6 
        # cmds.menuItem( label="multi rivet")#6                 
        cmds.gridLayout('dimensions', p='selectArrayColumn', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.text("length spans(extrude)")
        self.selfU=cmds.textField(text="12")
        cmds.text("width spans(extrude)")
        self.selfV=cmds.textField(text="1")
        cmds.gridLayout('listBuildButtonLayout', p='selectArrayColumn', numberOfColumns=1, cellWidthHeight=(300, 20))
        cmds.button (label='Go', w=150, p='listBuildButtonLayout', command = lambda *args:self.perform_multi_function(selfU=cmds.textField(self.selfU, q=1,text=1), selfV=cmds.textField(self.selfV, q=1,text=1)))
        # cmds.button (label='Go', w=150, p='listBuildButtonLayout', command = self.perform_multi_function)
        cmds.showWindow(self.window)
コード例 #20
0
ファイル: zbw_window.py プロジェクト: lefan2016/zTools
 def menus(self):
     #########  modify for inheritence ###########
     #self.widgets["testMenu"] = cmds.menu(l="test")
     self.widgets["menu"] = cmds.menuBarLayout()
     self.widgets["menuFile"] = cmds.menu(label="file")
     cmds.menuItem(l='reset values', c=self.resetValues)
     cmds.menuItem(l="save values", c=self.saveValues)
     cmds.menuItem(l="load values", c=self.loadValues)
     self.widgets["menuHelp"] = cmds.menu(l="help")
     cmds.menuItem(l="print help", c=self.printHelp)
コード例 #21
0
def menuUI():
	ui = cmds.menuBarLayout()

	cmds.menu(l='Skeleton')
	utils.menu()
	cmds.menu(l='Skin')
	utils.menu()
	cmds.setParent('..')

	return ui
コード例 #22
0
ファイル: plot.py プロジェクト: edeglau/storage
 def helpWin(self, stringField):
     '''--------------------------------------------------------------------------------------------------------------------------------------
     Interface Layout
     --------------------------------------------------------------------------------------------------------------------------------------'''
     # def helpPage(self, arg=None):
     winName = "Description"
     winTitle = winName
     if cmds.window(winName, exists=True):
             deleteUI(winName)
     window = cmds.window(winName, title=winTitle, tbm=1, w=700, h=400 )
     cmds.menuBarLayout(h=30)
     cmds.rowColumnLayout  (' selectArrayRow ', nr=1, w=700)
     cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')
     cmds.rowLayout  (' rMainRow ', w=700, numberOfColumns=6, p='selectArrayRow')
     cmds.columnLayout ('selectArrayColumn', parent = 'rMainRow')
     cmds.setParent ('selectArrayColumn')
     cmds.gridLayout('txvaluemeter', p='selectArrayColumn', numberOfColumns=2, cellWidthHeight=(700, 400))
     self.list=cmds.scrollField( editable=False, wordWrap=True, ebg=1,bgc=[0.11, 0.15, 0.15], w=700, text=str(stringField))
     cmds.showWindow(window)
コード例 #23
0
	def menus(self):
		#########  modify for inheritence ###########
		#self.widgets["testMenu"] = cmds.menu(l="test")
		self.widgets["menu"] = cmds.menuBarLayout()
		self.widgets["menuFile"] = cmds.menu(label="file")
		cmds.menuItem(l='reset values', c=self.resetValues)
		cmds.menuItem(l="save values", c=self.saveValues)
		cmds.menuItem(l="load values", c=self.loadValues)
		self.widgets["menuHelp"] = cmds.menu(l="help")
		cmds.menuItem(l="print help", c=self.printHelp)
コード例 #24
0
def SundayUIToolsDockedShaderliner():
    if cmds.dockControl('sundayShaderlinerInTheDock', query = True, exists = True):
        cmds.deleteUI('sundayShaderlinerInTheDock')
    
    shaderlinerlinerLayout = cmds.paneLayout('sundayShaderlinerInTheDockPane', parent = mel.eval('$temp1=$gMainWindow'))
    cmds.dockControl('sundayShaderlinerInTheDock', width = 275, area = 'left', label = 'Shaderliner', content = shaderlinerlinerLayout, allowedArea = [
        'right',
        'left'])
    cmds.setParent(cmds.paneLayout('sundayShaderlinerInTheDockPane', query = True, fullPathName = True))
    cmds.menuBarLayout('sundayShaderlinerInTheDockMenuBarLayout')
    cmds.flowLayout(columnSpacing = 5)
    cmds.separator(style = 'none', width = 1)
    cmds.iconTextButton(image = SundayImage + 'SundayRefresh.png', width = 28, height = 28, command = 'import SundayUIToolsPy\nreload(SundayUIToolsPy)\nSundayUIToolsPy.SundayUIToolsDockedShaderlinerUpdate()')
    if cmds.optionVar(query = 'SundayShaderlinerSwatch'):
        cmds.iconTextButton('SundayShaderlinerIcon', image = SundayImage + 'SundaySolidSphere.png', width = 30, height = 30, command = 'import SundayUIToolsPy\nreload(SundayUIToolsPy)\nSundayUIToolsPy.SundayUIToolsDockedShaderlinerSwatchToggle()')
    else:
        cmds.iconTextButton('SundayShaderlinerIcon', image = SundayImage + 'SundaySolidSphereColor.png', width = 30, height = 30, command = 'import SundayUIToolsPy\nreload(SundayUIToolsPy)\nSundayUIToolsPy.SundayUIToolsDockedShaderlinerSwatchToggle()')
    cmds.setParent('..')
    SundayUIToolsDockedShaderlinerUpdate()
コード例 #25
0
    def content(self):
        
        '''
        "content" - see the 'window.py' module for more information about how this "content" method functions
        '''
        
        self.form1 = cmds.formLayout( 'openPipelineProjectManagerGUI_form', numberOfDivisions=100 )
        
        self.menuBarLayout0 = cmds.menuBarLayout()
        self.menu01 = cmds.menu(label='options')
        cmds.menuItem(label="Refresh Objects Field", subMenu=0, parent=self.menu01, command=lambda *args:self.updateTextField() )
        cmds.menuItem(label="Reload", subMenu=0, parent=self.menu01, command=lambda *args:self.reload() )
        cmds.menuItem(label="Save Prefs", subMenu=0, parent=self.menu01, command=lambda *args:self.savePrefs() )
        cmds.menuItem(label="Load Prefs", subMenu=0, parent=self.menu01, command=lambda *args:self.loadPrefs() )
        cmds.setParent(self.menuBarLayout0)
        cmds.setParent(self.form1)
        
        self.diagnosticUI_UIObjects_scrollField = cmds.scrollField('diagnosticUI_UIObjects_scrollField', parent=self.form1, ww=1, editable=0)
        self.diagnosticUImainUI_btn = cmds.button(l="Open Pipeline Main GUI", parent=self.form1, bgc=(.85, .85, .85), c=lambda *args:self.buttonRelease('openPipelineMainUI'))
        self.diagnosticUIProjManager_btn = cmds.button(l="Project Manager GUI", parent=self.form1, bgc=(.8, .8, .8), c=lambda *args:self.buttonRelease('openPipelineProjectManagerGUI'))
        self.diagnosticUISaveMaster_btn = cmds.button(l="Save Master GUI", parent=self.form1, bgc=(.75, .75, .75), c=lambda *args:self.buttonRelease('openPipelineSaveMasterGUI'))
        self.diagnosticUIProjDialog_btn = cmds.button(l="Project Dialogue GUI", parent=self.form1, bgc=(.7, .7, .7), c=lambda *args:self.buttonRelease('openPipelineProjDialogGUI'))

        #Attach elements to form
        cmds.formLayout(
            self.form1,
            edit=True,
            attachPosition=[
                (self.menuBarLayout0, 'top', 0, 0),
                (self.menuBarLayout0, 'left', 0, 0),
                (self.menuBarLayout0, 'right', 0, 100),
                (self.diagnosticUImainUI_btn, 'left', 5, 0),
                (self.diagnosticUImainUI_btn, 'right', 5, 100),
                (self.diagnosticUI_UIObjects_scrollField, 'left', 5, 0),
                (self.diagnosticUI_UIObjects_scrollField, 'right', 5, 100),
                (self.diagnosticUIProjManager_btn, 'left', 5, 0),
                (self.diagnosticUIProjManager_btn, 'right', 5, 100),
                (self.diagnosticUISaveMaster_btn, 'left', 5, 0),
                (self.diagnosticUISaveMaster_btn, 'right', 5, 100),
                (self.diagnosticUIProjDialog_btn, 'left', 5, 0),
                (self.diagnosticUIProjDialog_btn, 'right', 5, 100),
                (self.diagnosticUIProjDialog_btn, 'bottom', 2, 100),
            ],
            attachControl=[
                
                (self.diagnosticUI_UIObjects_scrollField, 'top', 2, self.menuBarLayout0),
                (self.diagnosticUI_UIObjects_scrollField, 'bottom', 2, self.diagnosticUImainUI_btn),
                (self.diagnosticUImainUI_btn, 'bottom', 2, self.diagnosticUIProjManager_btn),
                (self.diagnosticUIProjManager_btn, 'bottom', 2, self.diagnosticUISaveMaster_btn),
                (self.diagnosticUISaveMaster_btn, 'bottom', 2, self.diagnosticUIProjDialog_btn),
            ]
            )
        
        return [self.form1]
コード例 #26
0
 def _choser_gen_group_window(self, getListAttr):
     choose_gen_grp_win = "Pick from below"
     if cmds.window(choose_gen_grp_win, exists=True):
         cmds.deleteUI(choose_gen_grp_win)
     window = cmds.window(choose_gen_grp_win, title=choose_gen_grp_win, tbm=1, w=800, h=150)
     cmds.menuBarLayout(h=30)
     cmds.rowColumnLayout  (' selectArrayRow ', nr=1, w=800)
     cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')
     cmds.rowLayout  (' rMainRow ', w=800, numberOfColumns=1, p='selectArrayRow')
     cmds.columnLayout ('selectArrayColumn', parent = 'rMainRow')
     cmds.setParent ('selectArrayColumn')
     cmds.separator(h=10, p='selectArrayColumn')
     cmds.frameLayout('title1', bgc=[0.15, 0.15, 0.15], cll=1, label='Select version', lv=1, nch=1, borderStyle='out', bv=1, w=800, fn="tinyBoldLabelFont", p='selectArrayColumn')
     cmds.gridLayout('valuebuttonlayout', p='title1', numberOfColumns=2, cellWidthHeight=(800, 20))  
     self.attributepath=cmds.optionMenu( label='Find')
     for each in getListAttr:
         cmds.menuItem( label=each)
     cmds.gridLayout('listBuildButtonLayout', p='title1', numberOfColumns=3, cellWidthHeight=(148, 20))
     cmds.button (label='Ok', p='listBuildButtonLayout', w=150, command = lambda *args:self.open_genAttributesWindow(getPath=cmds.optionMenu(self.attributepath, q=1, v=1)))
     cmds.button (label='open folder', p='listBuildButtonLayout', w=150, command = lambda *args:self._open_defined_path(cmds.optionMenu(self.attributepath, q=1, v=1)))
     cmds.showWindow(window) 
コード例 #27
0
ファイル: skinTransfer.py プロジェクト: edeglau/storage
    def performTransfer(self):
        getMesh=cmds.ls(sl=1)
        if len(getMesh)<2:
            print "select a skinned mesh group and an unskinned target mesh group"
            return
        else:
            pass
        getMeshController=getMesh[0]
        getMeshTarget=getMesh[1]
        getChildrenController=cmds.listRelatives(getMeshController, c=1, typ="transform")
        if getChildrenController==None:
            getChildrenController=([getMeshController])
        getChildrenTarget=cmds.listRelatives(getMeshTarget, c=1, typ="transform")
        if getChildrenTarget==None:
            getChildrenTarget=([getMeshTarget])

        ####Window
        #folderPath="G:\\_PIPELINE_MANAGEMENT\\Published\\maya\\guides\\"
        winName = "Save xml"
        winTitle = winName
        global skinPath
        if cmds.window(winName, exists=True):
                cmds.deleteUI(winName)

        window = cmds.window(winName, title=winTitle, tbm=1, w=300, h=100 )

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

        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=1, cellWidthHeight=(300, 20))      
        skinPath=cmds.textField(w=250, h=25, p='listBuildButtonLayout', tx="C:\Users\\"+str(getFolderName)+"\Documents\maya\projects\default\scenes\\")
        cmds.button (w=80, label='Proceed', p='listBuildButtonLayout', command = lambda *args:self.callJointsWin(getChildrenController, getChildrenTarget, skinPath))
        cmds.button (w=80,label='Open folder', p='listBuildButtonLayout', command = lambda *args:self.get_path(skinPath))
        cmds.showWindow(window)     
コード例 #28
0
ファイル: Material_UI.py プロジェクト: edeglau/storage
    def create_MATID_win(self, winName="MaterialID"):
        global colMenu
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

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

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

        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=(150, 20))
        colMenu=cmds.optionMenu( label='ID')
        cmds.menuItem( label='Skin' )
        cmds.menuItem( label='Eye' )
        cmds.menuItem( label='Spec' )
        cmds.menuItem( label='Lash' )
        cmds.menuItem( label='Brows' )    
        cmds.menuItem( label='Hair' )        
        cmds.menuItem( label='Mouth' )        
        cmds.menuItem( label='Other' )    
        cmds.menuItem( label='Costume' )             
        cmds.button (label='Mat ID', p='listBuildButtonLayout', command =lambda *args:self._add_id(queryColor=cmds.optionMenu(colMenu, q=1, sl=1)))
        cmds.button (label='Add CH Pref', p='listBuildButtonLayout', command = self._add_pref)
        cmds.button (label='Add type Suf', p='listBuildButtonLayout', command = self._add_suf)
        cmds.button (label='ShadeNetworkSel', p='listBuildButtonLayout', command = self._shade_network)
        cmds.button (label='selectMissingID', p='listBuildButtonLayout', command = self._select_nonID)
        cmds.button (label='vray gamma', p='listBuildButtonLayout', command = self._vray_gamma)     
        cmds.button (label='FTM', p='listBuildButtonLayout', command = self._file_texture_manager)     
        cmds.button (label='Open work folder', p='listBuildButtonLayout', command = self._open_work_folder) 
        cmds.button (label='Open texture folder', p='listBuildButtonLayout', command = self._open_texture_folder)   
        cmds.button (label='Open Image in PS', p='listBuildButtonLayout', command = self._open_texture_file_ps)  
        cmds.button (label='Open Image in Gimp', p='listBuildButtonLayout', command = self._open_texture_file_gmp) 

        cmds.showWindow(self.window)
コード例 #29
0
ファイル: Gun_Tools_UI.py プロジェクト: kyuhoChoi/mayaTools
def MenuBar():
    _menuBarLayout = cmds.menuBarLayout()

    cmds.menu( label='Options' )
    cmds.menuItem( label='Switch Window, Dock', c= SwitchUI)

    cmds.menuItem( divider=True ) #-----------------------------------------------------------------------------------------------

    cmds.menuItem( label='Reload Script', c= reloadScript)
    cmds.menuItem( label='Script Debug', checkBox=_debug, c= setDebug)

    cmds.menuItem( divider=True ) #-----------------------------------------------------------------------------------------------

    cmds.menuItem( label='Set to Default',      c= setToDefault)
    
    cmds.menuItem( subMenu=True, label='Update Mode' )
    cmds.radioMenuItemCollection()
    cmds.menuItem( label='Update by selection',            radioButton= _updateMode==1, c= pyMel.Callback(UI_RBG_updateMode,1) )
    cmds.menuItem( label='Remind the last selection data', radioButton= _updateMode==2, c= pyMel.Callback(UI_RBG_updateMode,2))
    cmds.setParent( '..', menu=True )

    cmds.menuItem( subMenu=True, label='scriptJob' )
    cmds.menuItem( label='Add scriptJob', c=addScriptJob)
    cmds.menuItem( label='Remove scriptJob', c=removeScriptJob)
    cmds.setParent( '..', menu=True )

    cmds.menuItem( divider=True ) #-----------------------------------------------------------------------------------------------  

    cmds.menuItem( label='Print Current Data', c= btnCmd_printCurrentState)


    '''
    cmds.menuItem( subMenu=True, label='Colors' )
    cmds.menuItem( label='Blue' )
    cmds.menuItem( label='Green' )
    cmds.menuItem( label='Yellow' )
    cmds.setParent( '..', menu=True )
    cmds.menuItem( divider=True )

    cmds.radioMenuItemCollection()
    cmds.menuItem( label='Yes', radioButton=False )
    cmds.menuItem( label='Maybe', radioButton=False )
    cmds.menuItem( label='No', radioButton=True )
    cmds.menuItem( divider=True )
    cmds.menuItem( label='Top', checkBox=True )
    cmds.menuItem( label='Middle', checkBox=False )
    cmds.menuItem( label='Bottom', checkBox=True )
    cmds.menuItem( divider=True )
    cmds.menuItem( label='Option' )
    cmds.menuItem( optionBox=True )
    '''
    cmds.menu( label='Help' )
コード例 #30
0
ファイル: channelbox_legacy.py プロジェクト: lazerdaze/lancer
	def __init__(self):
		self.evaluation = cmds.evaluationManager(q=True, mode=True)[0]
		self.tearOffScriptJob = None
		self.timelineScriptJob = None

		self.ui = cmds.menuBarLayout()

		cmds.menu(l='Scene')
		cmds.menuItem(d=True, dl='On New Scene')
		cmds.menuItem(l='Tear Off Copy', cb=True, c=self.tearOffCallback)
		cmds.menuItem(l='Set Timeline (1001-1200)', cb=True, c=self.timelineCallback)
		# cmds.menuItem(l='Playback: Every Frame', cb=True)

		cmds.menu(l='Evaluation')
		cmds.radioMenuItemCollection()
		cmds.menuItem(l='DG', rb=False, c=lambda *_: self.evalCallback(Component.dg), enable=False)
		cmds.menuItem(l='Serial', rb=False, c=lambda *_: self.evalCallback(Component.serial), enable=False)
		cmds.menuItem(l='Parallel', rb=True, c=lambda *_: self.evalCallback(Component.parallel))
		cmds.menuItem(d=True)
		cmds.menuItem(l='Print Debug Info', c=self.debugEvaluation)

		cmds.menu(l='Keys')
		cmds.menuItem(l='Delete Redundant', c=anim_mancer.tools.keys.deleteRedundant)
		cmds.menuItem(l='Delete All Static Channels', c=anim_mancer.tools.keys.deleteStaticAllChannels)

		cmds.menu(l='Tangents')
		prefsRadioMenu(pref='default tangent', )
		cmds.menuItem(l='', divider=True)
		cmds.menuItem(l='Weighted tangents', checkBox=(cmds.keyTangent(q=True, g=True, wt=True)),
					  c=lambda x: cmds.keyTangent(e=True, g=True, wt=x))

		cmds.menu(l='Time')
		prefsRadioMenu(pref='playback speed', )
		cmds.menuItem(d=True)
		cmds.menuItem(l='Snapping', cb=mel.eval('timeControl -q -snap $gPlayBackSlider;'), c=self.timeSnapCallback)

		gridMenu()

		cmds.menu(l='UI', hm=True)
		cmds.menuItem(l='Close', c=removeUI)
		cmds.setParent('..')

		# ScriptJobs
		cmds.scriptJob(p=self.ui, event=['SceneOpened', self.setDefaults])

		# Defaults
		self.setDefaults()
		# self.createTearOffScriptJob()
		self.createTimelineScriptJob()
		set_timeline()
		savePrefs()
コード例 #31
0
def pandaMenu():
    pandaWindow = cmds.window("PandaM Menu Version 0.1")
    cmds.columnLayout(adjustableColumn=True)

    #    Create first menu bar layout.
    #
    menuBarLayout = cmds.menuBarLayout()
    cmds.menu(label='Rigging')
    mi_zero_out = cmds.menuItem(label='Zero Out', command=partial(zo.win))
    cmds.menuItem(label='Color Controls', command=partial(cc.win))
    cmds.menuItem(label='FK IK Switch', command=partial(fi.win))
    cmds.menuItem(label="Ribbon Creator", command=partial(rb.win))
    cmds.menuItem(label="Connection Tool", command=partial(cn.init_win))

    cmds.menu(label='Help', helpMenu=True)
    cmds.menuItem(label='About...')

    cmds.setParent('..')

    cmds.separator(height=10, style='none')

    #    Create a second menu bar layout.
    #
    cmds.menuBarLayout()
    cmds.menu(label='Edit')
    cmds.menuItem(label='Cut')
    cmds.menuItem(label='Copy')
    cmds.menuItem(label='Paste')

    cmds.menu(label='View')
    cmds.menuItem(label='Fonts...')
    cmds.menuItem(label='Colors...')

    cmds.columnLayout()
    cmds.text(label='Add some controls here.')
    cmds.setParent('..')
    cmds.setParent('..')
    cmds.showWindow(pandaWindow)
コード例 #32
0
ファイル: bulkChangeXML.py プロジェクト: edeglau/storage
    def xml_transformUI(self, winName="change XML skins"):
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

        self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=800, h=300 )

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

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')
        
        cmds.rowLayout  (' rMainRow ', w=800, numberOfColumns=6, p='selectArrayRow')
        cmds.columnLayout ('selectArrayColumn', parent = 'rMainRow')
        cmds.setParent ('selectArrayColumn')
        cmds.text( label='Full file path(set as specific file path + file name for single edit or file path + "*.*" to change files in bulk)' )
        self.pathText=cmds.textField(w=800, h=25, p='selectArrayColumn', tx=xmlFolderPath+"*.*" )
        cmds.text( label='old string' )
        self.oldJointText=cmds.textField(w=300, h=25, p='selectArrayColumn', tx="LA0095_MaleIncidental4_Rig"    )
        cmds.text( label='new string' )
        self.newJointText=cmds.textField(w=300, h=25, p='selectArrayColumn', tx="LA0095_ZookeeperAdam_Rig"     )              
        cmds.gridLayout('listBuildButtonLayout', p='selectArrayColumn', numberOfColumns=2, cellWidthHeight=(100, 20)) 
        cmds.button (label='Change XMLs', p='listBuildButtonLayout', command = self._change_xml)
        cmds.showWindow(self.window)
コード例 #33
0
ファイル: skinTransfer.py プロジェクト: edeglau/storage
    def callJointsWin(self, getChildrenController, getChildrenTarget, skinPath):
        skinPath=cmds.textField(skinPath, q=1, text=True)
        try:
            getallnames=cmds.ls("*Rig:*")
        except:
            print "No rig is loaded. Please ensure 'Rig' is at the end of the name"
        bucket=[]
        for each in  getallnames:
            foundFirst=each.split(":")[0]
            bucket.append(foundFirst)
        bucket=set(bucket)
        global jointSelect
        winName = "Swap Influence select"
        winTitle = winName
        if cmds.window(winName, exists=True):
                cmds.deleteUI(winName)

        window = cmds.window(winName, title=winTitle, tbm=1, w=300, h=100 )

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

        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=(150, 20))
        jointSelect=cmds.optionMenu( label='joints')
        for each in bucket:
            cmds.menuItem( label=each)        
        #cmds.button (label='set joint', p='listBuildButtonLayout', command = partial(self.transferFunction(getChildrenController, getChildrenTarget, skinPath)))
        cmds.button (label='set mass', p='listBuildButtonLayout', command = lambda *args:self.transferFunction(getChildrenController, getChildrenTarget, skinPath))
        cmds.button (label='set single', p='listBuildButtonLayout', command = lambda *args:self.transferSingleFunction(getChildrenController, getChildrenTarget, skinPath))

        cmds.showWindow(window)
コード例 #34
0
ファイル: ChainWork.py プロジェクト: edeglau/storage
 def build_chain(self, arg=None):
     axisList=["X", "Y", "Z"] 
     influenceList= ["curved", "straight"] 
     winName = "Create chain"
     winTitle = winName
     if cmds.window(winName, exists=True):
             deleteUI(winName)
     window = cmds.window(winName, title=winTitle, tbm=1, w=350, h=150 )
     cmds.menuBarLayout(h=30)
     stringField='''"ChainRig" - (launches window) FK and IK chain(use the tail guide layout) if you've chosen a 
 particular axis for your guides, use the same axis for your controls.(the spheres have a 
 colored shape to help guide the dimensions they are building in. (this is still in 
 development. use at own risk)'''
     self.fileMenu = cmds.menu( label='Help', hm=1, pmc=lambda *args:toolClass.helpWin(stringField))  
     rowColumnLayout  (' selectArrayRow ', nr=1, w=350)
     frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')      
     rowLayout  (' rMainRow ', w=350, numberOfColumns=6, p='selectArrayRow')
     columnLayout ('selectArrayColumn', parent = 'rMainRow')
     setParent ('selectArrayColumn')
     separator(h=10, p='selectArrayColumn')
     gridLayout('listBuildButtonLayout', p='selectArrayColumn', numberOfColumns=2, cellWidthHeight=(150, 20))
     direction=optionMenu( label='Axis')
     for each in axisList:
         menuItem( label=each)   
     curveInf=optionMenu( label='Curve Influence')
     for each in influenceList:
         menuItem( label=each)                     
     cmds.text(label="", w=80, h=25)            
     cmds.text(label="name", w=80, h=25)             
     self.namefield=cmds.textField(w=40, h=25, p='listBuildButtonLayout', text="name")
     cmds.text(label="size", w=80, h=25) 
     self.size=cmds.textField(w=40, h=25, p='listBuildButtonLayout', text="10") 
     gridLayout('BuildButtonLayout', p='selectArrayColumn', numberOfColumns=3, cellWidthHeight=(100, 20))             
     button (label='Tail guides',bgc=[0.8, 0.75, 0.6], p='BuildButtonLayout', command = lambda *args:self._tail_guides())
     button (label='Build guides',bgc=[0.8, 0.75, 0.6], p='BuildButtonLayout', command = lambda *args:self._build_guides())
     button (label='Build chain', p='BuildButtonLayout', command = lambda *args:self.create_Chain(ControllerSize=int(textField(self.size,q=1, text=1)), mainName=textField(self.namefield,q=1, text=1), getDir=optionMenu(direction, q=1, v=1), crvInf=optionMenu(curveInf, q=1, v=1)))
     showWindow(window)
コード例 #35
0
def run():
    global classificationLimit
    if cmds.window(name, q=True, ex=True):
        cmds.deleteUI(name, window=True)
    else:
        cmds.window(name, title=name, w=300, h=500)
        cmds.menuBarLayout(menuBar)
        cmds.menu(label='Edit')
        cmds.menuItem(classificationMenu,
                      label='Classification Limit',
                      checkBox=classificationLimit,
                      c=cmCB)
        cmds.columnLayout()
        sf = cmds.scrollField(scrollField,
                              editable=True,
                              h=20,
                              nl=1,
                              kpc=lambda x: cmds.evalDeferred(textChanged),
                              ec=executeCommand)
        tsg = cmds.textScrollList(scrollList,
                                  numberOfRows=10,
                                  allowMultiSelection=False,
                                  sc=tmpExecuteCommand)
        cmds.showWindow(name)
コード例 #36
0
ファイル: RiggerUI.py プロジェクト: edeglau/storage
    def create(self):
        
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

        self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=270, h=250, bgc=[0.35, 0.35, 0.45]  )

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

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')

        cmds.rowLayout  (' rMainRow ', w=350, numberOfColumns=6, p='selectArrayRow')
        cmds.columnLayout ('selectArrayColumn', parent = 'rMainRow')
        cmds.setParent ('selectArrayColumn')
        cmds.separator(h=10, p='selectArrayColumn')
        cmds.gridLayout('listBuildButtonLayout', p='selectArrayColumn', bgc=[0.55, 0.55, 0.65], numberOfColumns=2, cellWidthHeight=(80, 20))
        cmds.button (label='Arm', bgc=[0.7, 0.7, 0.8], p='listBuildButtonLayout',command = self.build_arm_rig)
        cmds.button (label='Hand', p='listBuildButtonLayout', command = self.build_hand_rig)
        cmds.button (label='ConHand', p='listBuildButtonLayout', command = self.connect_arm_hand)                
        cmds.button (label='Foot', p='listBuildButtonLayout', command = self.build_foot_rig)        
        cmds.button (label='Leg', p='listBuildButtonLayout', command = self.build_leg_rig)
        cmds.button (label='ConFoot', p='listBuildButtonLayout', command = self.connect_leg_foot)  
        cmds.button (label='Spine', p='listBuildButtonLayout', command = self.build_spine_rig)
        cmds.button (label='ConBodLimb', p='listBuildButtonLayout', command = self.connect_whole)
        cmds.button (label='PrevisFace', p='listBuildButtonLayout', command = self.previs_face)  
        cmds.button (label='PPollyFAce', p='listBuildButtonLayout', command = self.previs_polly_face)  
        cmds.button (label='ConPrevHead', p='listBuildButtonLayout', command = self.con_previs_face)
        cmds.button (label='ChainRig', p='listBuildButtonLayout', command = self.chain_rig)
        #cmds.button (label='Face', p='listBuildButtonLayout', command = self.Face)        
        #cmds.button (label='Eye', p='listBuildButtonLayout', command = self.eye)        
        cmds.button (label='Clean', p='listBuildButtonLayout', command = self.clean)        
        cmds.button (label='Tail', p='listBuildButtonLayout', command = self.build_tail_rig)          
        #cmds.symbolButton (p='listBuildButtonLayout', command = self.Face, image="D:\myGraphics\icons\SP.jpg") 
        cmds.text (label='Author: Elise Deglau',w=120, al='left', p='selectArrayColumn')      
        cmds.showWindow(self.window)
コード例 #37
0
ファイル: QuadRigUI.py プロジェクト: edeglau/storage
    def create(self):
        
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

        self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=270, h=250, bgc=[0.0, 0.35, 0.0] )

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

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')

        cmds.rowLayout  (' rMainRow ', w=350, 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=(120, 20), bgc=[0.55, 0.65, 0.55])
        cmds.button (label='QuadLeg', bgc=[0.6, 0.8, 0.6], p='listBuildButtonLayout', command = self.build_quad_leg_rig)
        cmds.button (label='QuadArm', p='listBuildButtonLayout', command = self.build_quad_arm_rig)    
        cmds.button (label='QuadArmRev', p='listBuildButtonLayout', command = self.build_quad_arm_opp_rig)    
        cmds.button (label='Hoof', p='listBuildButtonLayout', command = self.hoof)      
        cmds.button (label='Paw', p='listBuildButtonLayout', command = self.hoof_toe)      
        cmds.button (label='ConFoot', p='listBuildButtonLayout', command = self.connect_hoof) 
        cmds.button (label='QSpine', p='listBuildButtonLayout', command = self.quad_spine)                     
        cmds.button (label='QLongNeck', p='listBuildButtonLayout', command = self.quad_neck)      
        cmds.button (label='QNoNeck', p='listBuildButtonLayout', command = self.quad_no_neck)      
        cmds.button (label='Tail', p='listBuildButtonLayout', command = self.build_tail_rig)  
        cmds.button (label='QuadBodLimb', p='listBuildButtonLayout', command = self.connect_quad_whole)
        cmds.button (label='QHead4LongNeck', p='listBuildButtonLayout', command = self.quad_head)                
        cmds.button (label='PrevisFace', p='listBuildButtonLayout', command = self.previs_face)  
        cmds.button (label='ConPrevisHead', p='listBuildButtonLayout', command = self.con_previs_face)
        cmds.button (label='Clean', p='listBuildButtonLayout', command = self.clean)        
        cmds.button (label='PostCreateToe', p='listBuildButtonLayout', command = self._toe)        
        #cmds.symbolButton (p='listBuildButtonLayout', command = self.Face, image="D:\myGraphics\icons\SP.jpg") 
        cmds.text (label='Author: Elise Deglau',w=120, al='left', p='selectArrayColumn')      
        cmds.showWindow(self.window)
コード例 #38
0
 def buildWin(self):
     self.win = cmds.window(title="ColorChange")
     self.menuLayout = cmds.menuBarLayout()
     self.menu = cmds.menu(label="Window")
     self.menuItem = cmds.menuItem(label="Close",
                                   command=partial(self.closeWin, self.win))
     self.mainlayout = cmds.columnLayout(adj=True)
     self.color = cmds.intSlider(min=0,
                                 max=2,
                                 value=0,
                                 step=1,
                                 cc=partial(self.setColor),
                                 p=self.mainlayout)  # Add self.
     self.textButton = cmds.iconTextButton(
         w=55, bgc=(0.467, 0.467, 0.467),
         p=self.mainlayout)  # Capture in variable.
     cmds.showWindow(self.win)
コード例 #39
0
ファイル: mainGUI.py プロジェクト: EriLee/marigold
    def doIt( self, *args ):
        # Window settings.
        self.winWidth = 400
        self.winHeight = 600
        self.iconWidth = 32
        self.iconHeight = 32
        
        # Window colors
        self.rowColors = [[0.4,0.4,0.4],[0.5,0.5,0.5]]
         
        # Clean up old uis before opening a new one.
        try:
            cmds.deleteUI( self.winName )
        except:
            pass

        # Setup the form layout.
        self.mainWindow = cmds.window( self.winName, title=self.winTitle, sizeable=True, resizeToFitChildren=True )
        
        # MENU
        self.menuBar = cmds.menuBarLayout()
        self.updateTopMenu( 'Bits' )
        cmds.setParent( '..' )#self.menuBar
        
        # MAIN BODY
        self.mainColumn = cmds.columnLayout( adjustableColumn=True, columnAttach=('both', 5) )
        
        # OPTION MENU
        cmds.columnLayout( width=200 )
        self.modeSelect = cmds.optionMenu( width=100, changeCommand=lambda b:self.updateUI(b) )
        cmds.menuItem( label='Bits' )
        cmds.menuItem( label='Component' )
        cmds.menuItem( label='Module' )
        cmds.menuItem( label='Character' )
        cmds.setParent( '..' )
        
        # AUTO FILL AREA
        self.fillArea = cmds.columnLayout( adjustableColumn=True, columnAttach=( 'both', 0 ) )
        cmds.setParent( '..' )#self.fillArea
        
        cmds.setParent( '..' )#self.mainColumn
        
        # Show the window.
        # Set up initial fill area
        self.updateUI( 'Bits' )
        cmds.showWindow( self.winName )
コード例 #40
0
ファイル: mainGUI.py プロジェクト: EriLee/marigold
 def updateTopMenu( self, inMode ):
     # Delete the existing menu bar's content.
     barChildren = cmds.menuBarLayout( self.menuBar, query=True, menuArray=True )
     if barChildren is not None:
         for child in barChildren:
             cmds.deleteUI( child )        
     
     # Now fill the menu layout with the active set.
     if inMode == 'Bits':
         self.menuEdit = cmds.menu( parent=self.menuBar, label='Edit' )
         cmds.menuItem( parent=self.menuEdit, label='Copy Bit Settings',
                        annotation='Copy one bit\'s setting to another.',
                        command=lambda b:FrameUtility.copyBitSettings() )
         cmds.menuItem( parent=self.menuEdit, label='Add Child',
                        annotation='Add child bit to another bit.',
                        command=lambda b:FrameUtility.setBitChild() )
         cmds.menuItem( parent=self.menuEdit, label='Delete Child',
                        annotation='Remove child bit from selected bit.',
                        command=lambda b:FrameUtility.deleteBitChild() )
         
     elif inMode == 'Component':
         self.menuJoints = cmds.menu( parent=self.menuBar, label='Joints' )
         cmds.menuItem( parent=self.menuJoints, label='Joint', annotation='Creates a node of type jointComponentNode',
                        command=lambda b, a1='jointComponentNode':self.addComponentToObject(a1) )
         
         self.menuControls = cmds.menu( parent=self.menuBar, label='Controls' )
         cmds.menuItem( parent=self.menuControls, label='TEMP', annotation='TEMP' )
         
         self.menuDeformers = cmds.menu( parent=self.menuBar, label='Deformers' )
         cmds.menuItem( parent=self.menuDeformers, label='TEMP', annotation='TEMP' )
         
         self.menuConstraints = cmds.menu( parent=self.menuBar, label='Constraints' )
         cmds.menuItem( parent=self.menuConstraints, label='TEMP', annotation='TEMP' )
         
     elif inMode == 'Module':
         self.menuFile = cmds.menu( parent=self.menuBar, label='File' )
         cmds.menuItem( parent=self.menuFile, label='Save Module XML',
                        annotation='Save the selected frame module to XML.',
                        command=lambda b:FrameUtility.createFrameModuleXML() )
         
     elif inMode == 'Character':
         self.menuEdit = cmds.menu( parent=self.menuBar, label='Character Item' )
         cmds.menuItem( parent=self.menuEdit, label='TEMP', annotation='TEMP' )
コード例 #41
0
ファイル: nPipeManager.py プロジェクト: paty-0004/nPipe
    def ui(self, *args):
        managewin = mc.window('managewin',
                              t='nPipe Manager',
                              widthHeight=(400, 200))

        menuBarLayout = mc.menuBarLayout()
        mc.menu(label='File')
        mc.menuItem(label='Setting')

        mc.menu(label='Help', helpMenu=True)
        mc.menuItem(label='About...')

        form = mc.formLayout()

        # 初期プロジェクトディレクトリ生成
        # アセット登録
        # ショット登録
        # ユーザ登録

        mc.showWindow(managewin)
コード例 #42
0
def file_UI_create(*args):
    """
    ui
    """
    if cmds.window("fileWin", exists=True):
        cmds.deleteUI("fileWin")

    w = 740
    h = 480
    widgets["win"] = cmds.window("fileWin",
                                 t="File Manager",
                                 w=w,
                                 h=h,
                                 s=False)
    widgets["menu"] = cmds.menuBarLayout()
    widgets["menuFile"] = cmds.menu(label="Presets")
    cmds.menuItem(l='Save Layout', c=save_layout)
    cmds.menuItem(l="Delete Layout", c=delete_layout)

    cmds.setParent(widgets["win"])
    widgets["mainCLO"] = cmds.columnLayout(w=w, h=h)
    widgets["mainFLO"] = cmds.formLayout(w=w, h=h, bgc=(.2, .2, .2))
    widgets["projOM"] = cmds.optionMenu(l="PROJECT:",
                                        changeCommand=change_project)
    cmds.menuItem(label="OutOfBoxExperience")
    cmds.menuItem(label="FitAndSetup")
    aw = 220
    widgets["assetsFLO"] = cmds.formLayout(w=aw, h=430)
    widgets["assetsTab"] = cmds.tabLayout(w=aw, h=430, cc=change_stage_tab)
    widgets["charCLO"] = cmds.columnLayout("CHARS", w=aw, h=400)
    widgets["charTSL"] = cmds.textScrollList(w=aw, h=400)
    cmds.setParent(widgets["assetsTab"])
    widgets["propCLO"] = cmds.columnLayout("PROPS", w=aw, h=400)
    widgets["propTSL"] = cmds.textScrollList(w=aw, h=400)
    cmds.setParent(widgets["assetsTab"])
    widgets["setCLO"] = cmds.columnLayout("SETS", w=aw, h=400)
    widgets["setTSL"] = cmds.textScrollList(w=aw, h=400)
    cmds.setParent(widgets["assetsTab"])
    widgets["stageCLO"] = cmds.columnLayout("STGS", w=aw, h=400)
    widgets["stageTSL"] = cmds.textScrollList(w=aw, h=400)
    cmds.formLayout(widgets["assetsFLO"],
                    e=True,
                    af=[
                        (widgets["assetsTab"], "top", 10),
                        (widgets["assetsTab"], "left", 0),
                    ])

    cmds.setParent(widgets["mainFLO"])
    widgets["filesFLO"] = cmds.formLayout(w=350, h=450)

    widgets["filesTSL"] = cmds.textScrollList(w=350, h=400, dcc=open_selected)
    widgets["phaseOM"] = cmds.optionMenu(label='Phase: ',
                                         changeCommand=populate_files)
    cmds.menuItem(label="Modeling")
    cmds.menuItem(label="Rigging")
    cmds.menuItem(label="Animation")
    cmds.menuItem(label="Lighting")
    cmds.menuItem(label="Texturing")
    cmds.formLayout(widgets["filesFLO"],
                    e=True,
                    af=[(widgets["filesTSL"], "top", 23),
                        (widgets["filesTSL"], "left", 0),
                        (widgets["phaseOM"], "top", 0),
                        (widgets["phaseOM"], "left", 10)])

    cmds.setParent(widgets["mainFLO"])

    widgets["openBut"] = cmds.button(l="Open Selected",
                                     w=125,
                                     h=30,
                                     bgc=(.3, .3, .3),
                                     c=open_selected)
    widgets["versionBut"] = cmds.button(l="Version Up Current",
                                        w=125,
                                        h=30,
                                        bgc=(.3, .3, .3),
                                        c=version_up)
    widgets["saveAsBut"] = cmds.button(l="Save Scene To New File",
                                       w=125,
                                       h=30,
                                       bgc=(.3, .3, .3),
                                       c=partial(save_as_new, False))
    widgets["saveSelBut"] = cmds.button(l="Save Selection To New",
                                        w=125,
                                        h=20,
                                        bgc=(.3, .3, .3),
                                        c=partial(save_as_new, True))
    widgets["refreshBut"] = cmds.button(l="Refresh Window",
                                        w=125,
                                        h=30,
                                        bgc=(.3, .3, .3),
                                        c=load_asset_info)

    cmds.formLayout(widgets["mainFLO"],
                    e=True,
                    af=[
                        (widgets["projOM"], "top", 5),
                        (widgets["projOM"], "left", 5),
                        (widgets["assetsFLO"], "top", 25),
                        (widgets["assetsFLO"], "left", 5),
                        (widgets["filesFLO"], "top", 35),
                        (widgets["filesFLO"], "left", 240),
                        (widgets["openBut"], "top", 60),
                        (widgets["openBut"], "left", 600),
                        (widgets["versionBut"], "top", 110),
                        (widgets["versionBut"], "left", 600),
                        (widgets["saveAsBut"], "top", 260),
                        (widgets["saveAsBut"], "left", 600),
                        (widgets["saveSelBut"], "top", 375),
                        (widgets["saveSelBut"], "left", 600),
                        (widgets["refreshBut"], "top", 420),
                        (widgets["refreshBut"], "left", 600),
                    ])

    cmds.window(widgets["win"], e=True, w=5, h=5, rtf=True)
    cmds.showWindow(widgets["win"])

    set_project()
    load_asset_info("first")
コード例 #43
0
def addAudioMenu(parent=None, rootMenu='redNineTraxRoot'):
    '''
    Red9 Sound Menu setup
    '''
    print 'AudioMenu: given parent : ',parent
    if not parent:
        cmds.menu(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, tearOff=True, allowOptionBoxes=True)
        print 'New r9Sound Menu added - no specific parent given so adding to whatever menu is currently being built!'
    else:
        # parent is a window containing a menuBar?
        if cmds.window(parent, exists=True):
            if not cmds.window(parent, q=True, menuBar=True):
                raise StandardError('given parent for Red9 Sound Menu has no menuBarlayout %s' % parent)
            else:
                cmds.menu(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, p=parent, tearOff=True, allowOptionBoxes=True)
                log.info('New Red9 Sound Menu added to current windows menuBar : %s' % parent)
        # parent is a menuBar?
        elif cmds.menuBarLayout(parent, exists=True):
            cmds.menu(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, p=parent, tearOff=True, allowOptionBoxes=True)
            log.info('New Red9 Sound Menu added to current windows menuBar : %s' % parent)
        # parent is a menu already?
        elif cmds.menu(parent, exists=True):
            cmds.menuItem(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, sm=True, p=parent, allowOptionBoxes=True)
            log.info('New Red9 Sound subMenu added to current Menu : %s' % parent)
        else:
            raise StandardError('given parent for Red9 Sound Menu is invalid %s' % parent)
    
#    if not parent:
#        print 'new r9Sound Menu added'
#        cmds.menu(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, tearOff=True, allowOptionBoxes=True)
#    else:
#        print 'new r9Sound Menu added to parent menu', parent
#        cmds.menu(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, tearOff=True, allowOptionBoxes=True, parent=parent)
        
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_offset_manager, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_offset_manager_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioToolsWrap().show()")
    cmds.menuItem(d=True)
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_activate_selected_audio, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_activate_selected_audio_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().setActive()")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_set_timeline_to_selected, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_set_timeline_to_selected_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().setTimelineToAudio()")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_focus_on_selected, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_focus_on_selected_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().setTimelineToAudio();r9Audio.AudioHandler().setActive()")
    cmds.menuItem(d=True)
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_mute_selected, p=rootMenu,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().muteSelected(True)")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_unmute_selected, p=rootMenu,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().muteSelected(False)")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_lock_selected, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_lock_selected_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().lockTimeInputs(True)")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_unlock_selected, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_unlock_selected_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().lockTimeInputs(False)")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_delete_selected, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_delete_selected_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().deleteSelected()")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_format_soundnode_name, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_format_soundnode_name_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().formatNodes_to_Path()")
    cmds.menuItem(d=True)
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_combine_audio, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_combine_audio_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.combineAudio()")
    cmds.menuItem(d=True)
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_open_audio_path, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_open_audio_path_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioNode().openAudioPath()")
    cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.sound_inspect_wav, p=rootMenu,
                  ann=LANGUAGE_MAP._MainMenus_.sound_inspect_wav_ann,
                  c="import Red9.core.Red9_Audio as r9Audio;r9Audio.inspect_wav()")
コード例 #44
0
def menuSetup(parent='MayaWindow'):
    
    #if exists remove all items, means we can update on the fly by restarting the Red9 pack
    if cmds.menu('redNineMenuItemRoot', exists=True):
        cmds.deleteUI('redNineMenuItemRoot')
        log.info("Rebuilding Existing RedNine Menu")
        
    # parent is an existing window with an existing menuBar?
    if cmds.window(parent, exists=True):
        if not cmds.window(parent, q=True, menuBar=True):
            raise StandardError('given parent for Red9 Menu has no menuBarlayout %s' % parent)
        else:
            cmds.menu('redNineMenuItemRoot', l="RedNine", p=parent, tearOff=True, allowOptionBoxes=True)
            log.info('new Red9 Menu added to current window : %s' % parent)
    # parent is a menuBar?
    elif cmds.menuBarLayout(parent, exists=True):
        cmds.menu('redNineMenuItemRoot', l='RedNine', p=parent, tearOff=True, allowOptionBoxes=True)
        log.info('New Red9 Sound Menu added to current windows menuBar : %s' % parent)
    # parent is an existing menu?
    elif cmds.menu(parent, exists=True):
        cmds.menuItem('redNineMenuItemRoot', l='RedNine', sm=True, p=parent)
        log.info('new Red9 subMenu added to current Menu : %s' % parent)
    else:
        raise StandardError('given parent for Red9 Menu is invalid %s' % parent)
    try:
        cmds.menuItem('redNineProRootItem',
                      l='PRO : PACK', sm=True, p='redNineMenuItemRoot', tearOff=True,i='red9.jpg')

        cmds.menuItem(divider=True,p='redNineMenuItemRoot')
        
        #Add the main Menu items
        cmds.menuItem('redNineAnimItem',
                      l=LANGUAGE_MAP._MainMenus_.animation_toolkit,
                      ann=LANGUAGE_MAP._MainMenus_.animation_toolkit_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.AnimationUI.show()")
        cmds.menuItem('redNineSnapItem',
                      l=LANGUAGE_MAP._MainMenus_.simple_snap,
                      ann=LANGUAGE_MAP._MainMenus_.simple_snap_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.AnimFunctions.snap()")
        cmds.menuItem('redNineSearchItem',
                      l=LANGUAGE_MAP._MainMenus_.searchui,
                      ann=LANGUAGE_MAP._MainMenus_.searchui_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_CoreUtils as r9Core;r9Core.FilterNode_UI.show()")
        cmds.menuItem('redNineLockChnsItem',
                      l=LANGUAGE_MAP._MainMenus_.lockchannels,
                      ann=LANGUAGE_MAP._MainMenus_.lockchannels_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_CoreUtils as r9Core;r9Core.LockChannels.UI.show()")
        cmds.menuItem('redNineMetaUIItem',
                      l=LANGUAGE_MAP._MainMenus_.metanodeui,
                      ann=LANGUAGE_MAP._MainMenus_.metanodeui_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_Meta as r9Meta;r9Meta.MClassNodeUI.show()")
        cmds.menuItem('redNineReporterUIItem',
                      l=LANGUAGE_MAP._MainMenus_.scene_reviewer,
                      ann=LANGUAGE_MAP._MainMenus_.scene_reviewer_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_Tools as r9Tools;r9Tools.SceneReviewerUI.show()")
        cmds.menuItem('redNineMoCapItem',
                      l=LANGUAGE_MAP._MainMenus_.mouse_mocap,
                      ann=LANGUAGE_MAP._MainMenus_.mouse_mocap_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_Tools as r9Tools;r9Tools.RecordAttrs.show()")
        cmds.menuItem('redNineRandomizerItem',
                      l=LANGUAGE_MAP._MainMenus_.randomize_keyframes,
                      ann=LANGUAGE_MAP._MainMenus_.randomize_keyframes_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.RandomizeKeys.showOptions()")
        cmds.menuItem('redNineFilterCurvesItem',
                      l=LANGUAGE_MAP._MainMenus_.interactive_curve_filter,
                      ann=LANGUAGE_MAP._MainMenus_.interactive_curve_filter_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.FilterCurves.show()")
        cmds.menuItem('redNineMirrorUIItem',
                      l=LANGUAGE_MAP._MainMenus_.mirror_setup,
                      ann=LANGUAGE_MAP._MainMenus_.mirror_setup_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.MirrorSetup().show()")
        cmds.menuItem('redNineCameraTrackItem',
                      l='CameraTracker',sm=True,p='redNineMenuItemRoot')
        cmds.menuItem('redNineCamerTrackFixedItem',
                      l=LANGUAGE_MAP._MainMenus_.camera_tracker_pan,
                      ann=LANGUAGE_MAP._MainMenus_.camera_tracker_pan_ann,
                      p='redNineCameraTrackItem', echoCommand=True,
                      c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack.cameraTrackView(fixed=True)")
        if not mayaVersion()<=2009:
            cmds.menuItem(optionBox=True,
                      ann=LANGUAGE_MAP._MainMenus_.tracker_tighness_ann,
                      p='redNineCameraTrackItem', echoCommand=True,
                      c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack(fixed=True)._showUI()")
        cmds.menuItem('redNineCamerTrackFreeItem',
                      l=LANGUAGE_MAP._MainMenus_.camera_tracker_track,
                      ann=LANGUAGE_MAP._MainMenus_.camera_tracker_track_ann,
                      p='redNineCameraTrackItem', echoCommand=True,
                      c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack.cameraTrackView(fixed=False)")
        if not mayaVersion()<=2009:
            cmds.menuItem(optionBox=True,
                      ann=LANGUAGE_MAP._MainMenus_.tracker_tighness_ann,
                      p='redNineCameraTrackItem', echoCommand=True,
                      c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack(fixed=False)._showUI()")
        
        cmds.menuItem(divider=True,p='redNineMenuItemRoot')
        cmds.menuItem('redNineAnimBndItem',
                      l=LANGUAGE_MAP._MainMenus_.animation_binder,
                      ann=LANGUAGE_MAP._MainMenus_.animation_binder_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="import Red9.core.AnimationBinder as animBnd;animBnd.AnimBinderUI()._UI()")
        cmds.menuItem(divider=True,p='redNineMenuItemRoot')
        
        cmds.menuItem('redNineHomepageItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_homepage,
                      ann=LANGUAGE_MAP._MainMenus_.red9_homepage_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="Red9.setup.red9_website_home()")
        cmds.menuItem('redNineBlogItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_blog,
                      ann=LANGUAGE_MAP._MainMenus_.red9_blog_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="Red9.setup.red9_blog()")
        cmds.menuItem('redNineVimeoItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_vimeo,
                      ann=LANGUAGE_MAP._MainMenus_.red9_vimeo_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="Red9.setup.red9_vimeo()")
        cmds.menuItem('redNineFacebookItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_facebook,
                      ann=LANGUAGE_MAP._MainMenus_.red9_facebook_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="Red9.setup.red9_facebook()")
        cmds.menuItem('redNineAPIDocItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_api_docs,
                      ann=LANGUAGE_MAP._MainMenus_.red9_api_docs_ann,
                      p='redNineMenuItemRoot', echoCommand=True,
                      c="Red9.setup.red9_apidocs()")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.red9_details,
                      c='Red9.setup.red9ContactInfo()',p='redNineMenuItemRoot')
        cmds.menuItem(divider=True,p='redNineMenuItemRoot')
        
        cmds.menuItem('redNineDebuggerItem', l=LANGUAGE_MAP._MainMenus_.red9_debugger,sm=True,p='redNineMenuItemRoot')
        cmds.menuItem('redNineLostAnimItem', p='redNineDebuggerItem',
                      l=LANGUAGE_MAP._MainMenus_.reconnect_anim,
                      ann=LANGUAGE_MAP._MainMenus_.reconnect_anim_ann,
                      echoCommand=True, c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.ReconnectAnimData().show()")
        cmds.menuItem('redNineOpenCrashItem', p='redNineDebuggerItem',
                      l=LANGUAGE_MAP._MainMenus_.open_last_crash,
                      ann=LANGUAGE_MAP._MainMenus_.open_last_crash_ann,
                      echoCommand=True, c="import Red9.core.Red9_General as r9General;r9General.os_openCrashFile()")
        cmds.menuItem(divider=True,p='redNineDebuggerItem')
        cmds.menuItem('redNineDebugItem',
                      l=LANGUAGE_MAP._MainMenus_.systems_debug,
                      ann=LANGUAGE_MAP._MainMenus_.systems_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug()")
        cmds.menuItem('redNineInfoItem',
                      l=LANGUAGE_MAP._MainMenus_.systems_info,
                      ann=LANGUAGE_MAP._MainMenus_.systems_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info()")
        cmds.menuItem(divider=True,p='redNineDebuggerItem')
        
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.individual_debug, sm=True, p='redNineDebuggerItem')
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug+" : r9Core",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug('r9Core')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug+" : r9Meta",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug('r9Meta')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug+" : r9Anim",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug('r9Anim')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug+" : r9Tools",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug('r9Tools')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug+" : r9Pose",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug('r9Pose')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug+" : r9General",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug('r9General')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug+" : r9Audio",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_debug('r9Audio')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.individual_info,sm=True,p='redNineDebuggerItem')
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info+" : r9Core",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info('r9Core')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info+" : r9Meta",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info('r9Meta')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info+" : r9Anim",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info('r9Anim')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info+" : r9Tools",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info('r9Tools')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info+" : r9Pose",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info('r9Pose')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info+" : r9General",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info('r9General')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info+" : r9Audio",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True, c="Red9.core._setlogginglevel_info('r9Audio')")
        cmds.menuItem(divider=True,p='redNineDebuggerItem')
        cmds.menuItem('redNineReloadItem',l=LANGUAGE_MAP._MainMenus_.systems_reload, p='redNineDebuggerItem',
                      ann=LANGUAGE_MAP._MainMenus_.systems_reload_ann,
                      echoCommand=True, c=reload_Red9)  # "Red9.core._reload()")
        cmds.menuItem(divider=True,p='redNineDebuggerItem')
        for language in get_language_maps():
            cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.language+" : %s" % language, c=partial(set_language,language),p='redNineDebuggerItem')
    except:
        raise StandardError('Unable to parent Red9 Menu to given parent %s' % parent)
コード例 #45
0
def createUI(pWindowTitle):

    windowID = 'myWindowID'

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

    mc.window(windowID,
              title=pWindowTitle,
              sizeable=True,
              resizeToFitChildren=True,
              width=200)

    # OPENING ANS SAVING WINDOWS
    def pOpenFileCallback(*pArgs):
        fileOutput = pm.fileDialog2(fileMode=1)  #fileOutput[0]
        myFile = "X:/Documents/SchoolWork/LMU/Fall2016/PipelineCS/FinalTools/history.txt"
        #string $filePath = myFile;
        #$fileId = "`mm.fopen $filePath "r"`";

    def pSaveFileCallback(*pArgs):
        pm.fileDialog2(fileMode=0)

    def pPastaCallback(*pArgs):
        mm.eval("sphere -radius 3;")

    mc.menuBarLayout('Meun')
    mc.menu('File')
    mc.menuItem('Open', command=pOpenFileCallback)
    mc.menuItem('Save As...', command=pSaveFileCallback)
    mc.menuItem('CloseMM')
    mc.menu('Edit')
    mc.menuItem('Copy')
    mc.menuItem('Pasta', command=pPastaCallback)

    mc.rowColumnLayout(numberOfColumns=1,
                       columnWidth=(1, 400),
                       columnOffset=(1, 'left', 3))

    # MENUBAR LAYOUT
    def pRecordCallback(*pArgs):
        print 'Record button pressed.'
        fileHistDir = "X:/Documents/SchoolWork/LMU/Fall2016/PipelineCS/FinalTools/history.txt"
        userHist = mc.scriptEditorInfo(historyFilename=fileHistDir,
                                       writeHistory=True)

    def pExecuteCallback(*pArgs):
        mc.scriptEditorInfo(writeHistory=False)
        print 'Execute button pressed.'

    def pClearCallback(*pArgs):
        print 'Clear button pressed.'
        outputField(clear=True)

    mc.separator(h=10, style="none")

    mc.rowLayout(numberOfColumns=3)
    mc.button(label='Record',
              width=195,
              backgroundColor=(50, 0, 0),
              command=pRecordCallback)
    mc.button(label='Execute',
              width=195,
              backgroundColor=(0, 50, 0),
              command=pExecuteCallback)
    mc.setParent("..")

    mc.separator(h=10, style="none")

    mc.text(label='SELECTED STEPS')

    output = 'test test test'

    def pUpdateOutputField(*pArgs):
        #outputField = mc.cmdScrollFieldExecuter(width= 395, height=400, showLineNumbers=True, sw=True, text= output)
        outputField = mc.cmdScrollFieldReporter(width=395,
                                                height=400,
                                                echoAllCommands=True)

    pUpdateOutputField()

    mc.separator(h=10, style="none")

    #mc.button(label= 'Execute', width=395, backgroundColor=(0, 50, 0), command=pExecuteCallback)
    mc.button(label='Clear', width=395, command=pClearCallback)

    #mc.textScrollList(append=[''])
    mc.scriptEditorInfo(input="")

    mc.separator(h=10, style='none')

    mc.showWindow()
コード例 #46
0
ファイル: legacy.py プロジェクト: lazerdaze/lancer
    def ui(self):

        # Main Layout ===================================================================================================

        if cmds.layout('animToolsChannelBoxUI', exists=True):
            cmds.deleteUI('animToolsChannelBoxUI')

        cmds.formLayout('animToolsChannelBoxUI', p=self.channelPane)

        scrollUI = cmds.scrollLayout(cr=True)

        cmds.separator(st='none', h=5)

        # Menu ===================================================================================================

        cmds.menuBarLayout()

        cmds.menu(l='UI', hm=True)
        cmds.menuItem(l='Close', c=self.removeUI)

        cmds.menu(l='Playblast')
        cmds.menuItem(l='Playblast - Temp',
                      c=lambda *_: cmds.playblast(format='image',
                                                  sequenceTime=0,
                                                  clearCache=1,
                                                  viewer=1,
                                                  showOrnaments=1,
                                                  offScreen=True,
                                                  fp=4,
                                                  percent=100,
                                                  compression='jpg',
                                                  quality=100))
        cmds.menuItem(divider=True)
        # cmds.menuItem(l='Playblast - Allison UI', c=allison.playblastWrapper)
        '''
		cmds.menu(l='Camera')
		cmds.menuItem(l='Set Saved Layout', c=self.savedLayout)
		cmds.menuItem(d=True)
		cmds.menuItem(l='Toggle Display', c=bboy.toggleViewport)
		'''

        cmds.menu(l='Anim')
        self.prefsRadioMenu(pref='evaluation', )
        self.prefsRadioMenu(pref='default tangent', )
        cmds.menuItem(l='', divider=True)
        cmds.menuItem(l='Weighted tangents',
                      checkBox=(cmds.keyTangent(q=True, g=True, wt=True)),
                      c=lambda x: cmds.keyTangent(e=True, g=True, wt=x))

        cmds.menu(l='Time')
        self.prefsRadioMenu(pref='playback speed', )
        self.prefsRadioMenu(pref='frames per second', )
        cmds.menuItem(l='', divider=True)
        self.keepFrames = cmds.menuItem(l='Keep keys at current frames',
                                        checkBox=False)

        cmds.menu(l='World')
        self.prefsRadioMenu(pref='up axis', )
        # self.prefsRadioMenu(pref='working units',)

        cmds.setParent('..')  # endMenu

        # Main Layout ===================================================================================================

        tab = cmds.tabLayout()

        self.keysUI()
        self.motionTrailUI()
        self.noteUI()

        # End UI ===================================================================================================

        cmds.setParent('..')  # end tab
        cmds.setParent('..')  # end scroll
        cmds.setParent('..')  # end form

        cmds.formLayout(
            'animToolsChannelBoxUI',
            e=True,
            attachForm=[
                (scrollUI, 'left', 0),
                (scrollUI, 'top', 0),
                (scrollUI, 'bottom', 0),
                (scrollUI, 'right', 0),
            ],
        )
コード例 #47
0
ファイル: diagnosticUI.py プロジェクト: cesioarg/OpenPipeline
    def content(self):
        '''
        "content" - see the 'window.py' module for more information about how this "content" method functions
        '''

        self.form1 = cmds.formLayout('openPipelineProjectManagerGUI_form',
                                     numberOfDivisions=100)

        self.menuBarLayout0 = cmds.menuBarLayout()
        self.menu01 = cmds.menu(label='options')
        cmds.menuItem(label="Refresh Objects Field",
                      subMenu=0,
                      parent=self.menu01,
                      command=lambda *args: self.updateTextField())
        cmds.menuItem(label="Reload",
                      subMenu=0,
                      parent=self.menu01,
                      command=lambda *args: self.reload())
        cmds.menuItem(label="Save Prefs",
                      subMenu=0,
                      parent=self.menu01,
                      command=lambda *args: self.savePrefs())
        cmds.menuItem(label="Load Prefs",
                      subMenu=0,
                      parent=self.menu01,
                      command=lambda *args: self.loadPrefs())
        cmds.setParent(self.menuBarLayout0)
        cmds.setParent(self.form1)

        self.diagnosticUI_UIObjects_scrollField = cmds.scrollField(
            'diagnosticUI_UIObjects_scrollField',
            parent=self.form1,
            ww=1,
            editable=0)
        self.diagnosticUImainUI_btn = cmds.button(
            l="Open Pipeline Main GUI",
            parent=self.form1,
            bgc=(.85, .85, .85),
            c=lambda *args: self.buttonRelease('openPipelineMainUI'))
        self.diagnosticUIProjManager_btn = cmds.button(
            l="Project Manager GUI",
            parent=self.form1,
            bgc=(.8, .8, .8),
            c=lambda *args: self.buttonRelease('openPipelineProjectManagerGUI'
                                               ))
        self.diagnosticUISaveMaster_btn = cmds.button(
            l="Save Master GUI",
            parent=self.form1,
            bgc=(.75, .75, .75),
            c=lambda *args: self.buttonRelease('openPipelineSaveMasterGUI'))
        self.diagnosticUIProjDialog_btn = cmds.button(
            l="Project Dialogue GUI",
            parent=self.form1,
            bgc=(.7, .7, .7),
            c=lambda *args: self.buttonRelease('openPipelineProjDialogGUI'))

        #Attach elements to form
        cmds.formLayout(
            self.form1,
            edit=True,
            attachPosition=[
                (self.menuBarLayout0, 'top', 0, 0),
                (self.menuBarLayout0, 'left', 0, 0),
                (self.menuBarLayout0, 'right', 0, 100),
                (self.diagnosticUImainUI_btn, 'left', 5, 0),
                (self.diagnosticUImainUI_btn, 'right', 5, 100),
                (self.diagnosticUI_UIObjects_scrollField, 'left', 5, 0),
                (self.diagnosticUI_UIObjects_scrollField, 'right', 5, 100),
                (self.diagnosticUIProjManager_btn, 'left', 5, 0),
                (self.diagnosticUIProjManager_btn, 'right', 5, 100),
                (self.diagnosticUISaveMaster_btn, 'left', 5, 0),
                (self.diagnosticUISaveMaster_btn, 'right', 5, 100),
                (self.diagnosticUIProjDialog_btn, 'left', 5, 0),
                (self.diagnosticUIProjDialog_btn, 'right', 5, 100),
                (self.diagnosticUIProjDialog_btn, 'bottom', 2, 100),
            ],
            attachControl=[
                (self.diagnosticUI_UIObjects_scrollField, 'top', 2,
                 self.menuBarLayout0),
                (self.diagnosticUI_UIObjects_scrollField, 'bottom', 2,
                 self.diagnosticUImainUI_btn),
                (self.diagnosticUImainUI_btn, 'bottom', 2,
                 self.diagnosticUIProjManager_btn),
                (self.diagnosticUIProjManager_btn, 'bottom', 2,
                 self.diagnosticUISaveMaster_btn),
                (self.diagnosticUISaveMaster_btn, 'bottom', 2,
                 self.diagnosticUIProjDialog_btn),
            ])

        return [self.form1]
コード例 #48
0
def menuSetup(parent='MayaWindow'):

    #if exists remove all items, means we can update on the fly by restarting the Red9 pack
    if cmds.menu('redNineMenuItemRoot', exists=True):
        cmds.deleteUI('redNineMenuItemRoot')
        log.info("Rebuilding Existing RedNine Menu")

    # parent is an existing window with an existing menuBar?
    if cmds.window(parent, exists=True):
        if not cmds.window(parent, q=True, menuBar=True):
            raise StandardError(
                'given parent for Red9 Menu has no menuBarlayout %s' % parent)
        else:
            cmds.menu('redNineMenuItemRoot',
                      l="RedNine",
                      p=parent,
                      tearOff=True,
                      allowOptionBoxes=True)
            log.info('new Red9 Menu added to current window : %s' % parent)
    # parent is a menuBar?
    elif cmds.menuBarLayout(parent, exists=True):
        cmds.menu('redNineMenuItemRoot',
                  l='RedNine',
                  p=parent,
                  tearOff=True,
                  allowOptionBoxes=True)
        log.info('New Red9 Sound Menu added to current windows menuBar : %s' %
                 parent)
    # parent is an existing menu?
    elif cmds.menu(parent, exists=True):
        cmds.menuItem('redNineMenuItemRoot', l='RedNine', sm=True, p=parent)
        log.info('new Red9 subMenu added to current Menu : %s' % parent)
    else:
        raise StandardError('given parent for Red9 Menu is invalid %s' %
                            parent)
    try:
        cmds.menuItem('redNineProRootItem',
                      l='PRO : PACK',
                      sm=True,
                      p='redNineMenuItemRoot',
                      tearOff=True,
                      i='red9.jpg')

        # Holder Menus for Client code
        if get_client_modules():
            cmds.menuItem(divider=True, p='redNineMenuItemRoot')
            for client in get_client_modules():
                cmds.menuItem('redNineClient%sItem' % client,
                              l='CLIENT : %s' % client,
                              sm=True,
                              p='redNineMenuItemRoot',
                              tearOff=True,
                              i='red9.jpg')

        cmds.menuItem(divider=True, p='redNineMenuItemRoot')

        #Add the main Menu items
        cmds.menuItem(
            'redNineAnimItem',
            l=LANGUAGE_MAP._MainMenus_.animation_toolkit,
            ann=LANGUAGE_MAP._MainMenus_.animation_toolkit_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.AnimationUI.show()"
        )
        cmds.menuItem(
            'redNineSnapItem',
            l=LANGUAGE_MAP._MainMenus_.simple_snap,
            ann=LANGUAGE_MAP._MainMenus_.simple_snap_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.AnimFunctions.snap()"
        )
        cmds.menuItem(
            'redNineSearchItem',
            l=LANGUAGE_MAP._MainMenus_.searchui,
            ann=LANGUAGE_MAP._MainMenus_.searchui_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_CoreUtils as r9Core;r9Core.FilterNode_UI.show()"
        )
        cmds.menuItem(
            'redNineLockChnsItem',
            l=LANGUAGE_MAP._MainMenus_.lockchannels,
            ann=LANGUAGE_MAP._MainMenus_.lockchannels_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_CoreUtils as r9Core;r9Core.LockChannels.UI.show()"
        )
        cmds.menuItem(
            'redNineMetaUIItem',
            l=LANGUAGE_MAP._MainMenus_.metanodeui,
            ann=LANGUAGE_MAP._MainMenus_.metanodeui_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_Meta as r9Meta;r9Meta.MClassNodeUI.show()"
        )
        cmds.menuItem(
            'redNineReporterUIItem',
            l=LANGUAGE_MAP._MainMenus_.scene_reviewer,
            ann=LANGUAGE_MAP._MainMenus_.scene_reviewer_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_Tools as r9Tools;r9Tools.SceneReviewerUI.show()"
        )
        cmds.menuItem(
            'redNineMoCapItem',
            l=LANGUAGE_MAP._MainMenus_.mouse_mocap,
            ann=LANGUAGE_MAP._MainMenus_.mouse_mocap_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_Tools as r9Tools;r9Tools.RecordAttrs.show()"
        )
        cmds.menuItem(
            'redNineRandomizerItem',
            l=LANGUAGE_MAP._MainMenus_.randomize_keyframes,
            ann=LANGUAGE_MAP._MainMenus_.randomize_keyframes_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.RandomizeKeys.showOptions()"
        )
        cmds.menuItem(
            'redNineFilterCurvesItem',
            l=LANGUAGE_MAP._MainMenus_.interactive_curve_filter,
            ann=LANGUAGE_MAP._MainMenus_.interactive_curve_filter_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.FilterCurves.show()"
        )
        cmds.menuItem(
            'redNineMirrorUIItem',
            l=LANGUAGE_MAP._MainMenus_.mirror_setup,
            ann=LANGUAGE_MAP._MainMenus_.mirror_setup_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.MirrorSetup().show()"
        )
        cmds.menuItem('redNineCameraTrackItem',
                      l='CameraTracker',
                      sm=True,
                      p='redNineMenuItemRoot')
        cmds.menuItem(
            'redNineCamerTrackFixedItem',
            l=LANGUAGE_MAP._MainMenus_.camera_tracker_pan,
            ann=LANGUAGE_MAP._MainMenus_.camera_tracker_pan_ann,
            p='redNineCameraTrackItem',
            echoCommand=True,
            c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack.cameraTrackView(fixed=True)"
        )
        if not mayaVersion() <= 2009:
            cmds.menuItem(
                optionBox=True,
                ann=LANGUAGE_MAP._MainMenus_.tracker_tighness_ann,
                p='redNineCameraTrackItem',
                echoCommand=True,
                c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack(fixed=True)._showUI()"
            )
        cmds.menuItem(
            'redNineCamerTrackFreeItem',
            l=LANGUAGE_MAP._MainMenus_.camera_tracker_track,
            ann=LANGUAGE_MAP._MainMenus_.camera_tracker_track_ann,
            p='redNineCameraTrackItem',
            echoCommand=True,
            c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack.cameraTrackView(fixed=False)"
        )
        if not mayaVersion() <= 2009:
            cmds.menuItem(
                optionBox=True,
                ann=LANGUAGE_MAP._MainMenus_.tracker_tighness_ann,
                p='redNineCameraTrackItem',
                echoCommand=True,
                c="from Red9.core.Red9_AnimationUtils import CameraTracker as camTrack;camTrack(fixed=False)._showUI()"
            )

        cmds.menuItem(divider=True, p='redNineMenuItemRoot')
        cmds.menuItem(
            'redNineAnimBndItem',
            l=LANGUAGE_MAP._MainMenus_.animation_binder,
            ann=LANGUAGE_MAP._MainMenus_.animation_binder_ann,
            p='redNineMenuItemRoot',
            echoCommand=True,
            c="import Red9.core.AnimationBinder as animBnd;animBnd.AnimBinderUI()._UI()"
        )
        cmds.menuItem(divider=True, p='redNineMenuItemRoot')

        cmds.menuItem('redNineHomepageItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_homepage,
                      ann=LANGUAGE_MAP._MainMenus_.red9_homepage_ann,
                      p='redNineMenuItemRoot',
                      echoCommand=True,
                      c="Red9.setup.red9_website_home()")
        cmds.menuItem('redNineBlogItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_blog,
                      ann=LANGUAGE_MAP._MainMenus_.red9_blog_ann,
                      p='redNineMenuItemRoot',
                      echoCommand=True,
                      c="Red9.setup.red9_blog()")
        cmds.menuItem('redNineVimeoItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_vimeo,
                      ann=LANGUAGE_MAP._MainMenus_.red9_vimeo_ann,
                      p='redNineMenuItemRoot',
                      echoCommand=True,
                      c="Red9.setup.red9_vimeo()")
        cmds.menuItem('redNineFacebookItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_facebook,
                      ann=LANGUAGE_MAP._MainMenus_.red9_facebook_ann,
                      p='redNineMenuItemRoot',
                      echoCommand=True,
                      c="Red9.setup.red9_facebook()")
        cmds.menuItem('redNineAPIDocItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_api_docs,
                      ann=LANGUAGE_MAP._MainMenus_.red9_api_docs_ann,
                      p='redNineMenuItemRoot',
                      echoCommand=True,
                      c="Red9.setup.red9_apidocs()")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.red9_details,
                      c='Red9.setup.red9ContactInfo()',
                      p='redNineMenuItemRoot')
        cmds.menuItem(divider=True, p='redNineMenuItemRoot')

        cmds.menuItem('redNineDebuggerItem',
                      l=LANGUAGE_MAP._MainMenus_.red9_debugger,
                      sm=True,
                      p='redNineMenuItemRoot')
        cmds.menuItem(
            'redNineLostAnimItem',
            p='redNineDebuggerItem',
            l=LANGUAGE_MAP._MainMenus_.reconnect_anim,
            ann=LANGUAGE_MAP._MainMenus_.reconnect_anim_ann,
            echoCommand=True,
            c="import Red9.core.Red9_AnimationUtils as r9Anim;r9Anim.ReconnectAnimData().show()"
        )
        cmds.menuItem(
            'redNineOpenCrashItem',
            p='redNineDebuggerItem',
            l=LANGUAGE_MAP._MainMenus_.open_last_crash,
            ann=LANGUAGE_MAP._MainMenus_.open_last_crash_ann,
            echoCommand=True,
            c="import Red9.core.Red9_General as r9General;r9General.os_openCrashFile()"
        )
        cmds.menuItem(divider=True, p='redNineDebuggerItem')
        cmds.menuItem('redNineDebugItem',
                      l=LANGUAGE_MAP._MainMenus_.systems_debug,
                      ann=LANGUAGE_MAP._MainMenus_.systems_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug()")
        cmds.menuItem('redNineInfoItem',
                      l=LANGUAGE_MAP._MainMenus_.systems_info,
                      ann=LANGUAGE_MAP._MainMenus_.systems_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info()")
        cmds.menuItem(divider=True, p='redNineDebuggerItem')

        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.individual_debug,
                      sm=True,
                      p='redNineDebuggerItem')
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug + " : r9Core",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug('r9Core')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug + " : r9Meta",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug('r9Meta')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug + " : r9Anim",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug('r9Anim')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug + " : r9Tools",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug('r9Tools')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug + " : r9Pose",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug('r9Pose')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug + " : r9General",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug('r9General')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.debug + " : r9Audio",
                      ann=LANGUAGE_MAP._MainMenus_.individual_debug_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_debug('r9Audio')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.individual_info,
                      sm=True,
                      p='redNineDebuggerItem')
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info + " : r9Core",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info('r9Core')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info + " : r9Meta",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info('r9Meta')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info + " : r9Anim",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info('r9Anim')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info + " : r9Tools",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info('r9Tools')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info + " : r9Pose",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info('r9Pose')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info + " : r9General",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info('r9General')")
        cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.info + " : r9Audio",
                      ann=LANGUAGE_MAP._MainMenus_.individual_info_ann,
                      echoCommand=True,
                      c="Red9.core._setlogginglevel_info('r9Audio')")
        cmds.menuItem(divider=True, p='redNineDebuggerItem')
        cmds.menuItem('redNineReloadItem',
                      l=LANGUAGE_MAP._MainMenus_.systems_reload,
                      p='redNineDebuggerItem',
                      ann=LANGUAGE_MAP._MainMenus_.systems_reload_ann,
                      echoCommand=True,
                      c=reload_Red9)
        cmds.menuItem(divider=True, p='redNineDebuggerItem')
        for language in get_language_maps():
            cmds.menuItem(l=LANGUAGE_MAP._MainMenus_.language +
                          " : %s" % language,
                          c=partial(set_language, language),
                          p='redNineDebuggerItem')
    except:
        raise StandardError('Unable to parent Red9 Menu to given parent %s' %
                            parent)
コード例 #49
0
    def __init__(self):

        self.thumbList = []  #creating for icon storage and ease of clearing

        #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("fortniteCharacterEditor_UI", exists=True):

            cmds.deleteUI("fortniteCharacterEditor_UI")

        self.widgets = {}

        #build window

        self.widgets["window"] = cmds.window("fortniteCharacterEditor_UI",
                                             w=400,
                                             h=600,
                                             title="Fortnite Character Editor",
                                             sizeable=False)

        #create the main layout

        self.widgets["topLevelLayout"] = cmds.columnLayout(w=400)

        self.widgets["menuBarLayout"] = cmds.menuBarLayout(
            w=200, parent=self.widgets["topLevelLayout"])

        menu = cmds.menu(label="Help", parent=self.widgets["menuBarLayout"])

        cmds.menuItem(label="Weapon Skeleton Information",
                      parent=menu,
                      c=self.weaponInfo)

        #create the banner image area

        form = cmds.formLayout(w=400,
                               h=60,
                               parent=self.widgets["topLevelLayout"])

        self.widgets["bannerImage"] = cmds.image(
            image=self.mayaToolsDir +
            "/General/ART/Projects/Fortnite/banner.jpg",
            w=400,
            h=60,
            parent=form)

        self.widgets["characterList"] = cmds.optionMenu(w=110,
                                                        h=54,
                                                        label="",
                                                        parent=form,
                                                        cc=self.changeChar)

        cmds.formLayout(form,
                        edit=True,
                        af=[(self.widgets["characterList"], 'right', 8),
                            (self.widgets["characterList"], 'top', 4)])

        #create the 4 formLayouts (head, torso, legs, weapons)

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        #HEAD TAB

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        self.widgets["headTab"] = cmds.formLayout(
            w=400, parent=self.widgets["topLevelLayout"])

        backgroundImage = cmds.image(w=380,
                                     h=526,
                                     image=self.mayaToolsDir +
                                     "/General/Icons/Fortnite/headTab.jpg")

        #create the 3 buttons for the torso, pants, and weapons

        torsoButton = cmds.iconTextButton(
            image=self.mayaToolsDir +
            "/General/Icons/Fortnite/torsoTabButton.bmp",
            w=61,
            h=85,
            parent=self.widgets["headTab"],
            c=partial(self.switchTab, "torsoTab"))

        cmds.formLayout(self.widgets["headTab"],
                        edit=True,
                        af=[(torsoButton, 'left', 10),
                            (torsoButton, 'top', 109)])

        weaponButton = cmds.iconTextButton(
            image=self.mayaToolsDir +
            "/General/Icons/Fortnite/weaponTabButton.bmp",
            w=61,
            h=85,
            parent=self.widgets["headTab"],
            c=partial(self.switchTab, "weaponTab"))

        cmds.formLayout(self.widgets["headTab"],
                        edit=True,
                        af=[(weaponButton, 'left', 10),
                            (weaponButton, 'top', 211)])

        #add the scrollLayout for the head tab

        scrollLayout = cmds.scrollLayout(parent=self.widgets["headTab"],
                                         w=320,
                                         h=550,
                                         hst=0)

        cmds.formLayout(self.widgets["headTab"],
                        edit=True,
                        af=[(scrollLayout, 'left', 80),
                            (scrollLayout, 'top', 0)])

        self.widgets["headList"] = cmds.rowColumnLayout(nc=3,
                                                        cat=[(1, "both", 5),
                                                             (2, "both", 5),
                                                             (3, "both", 5)],
                                                        rs=(1, 5),
                                                        parent=scrollLayout,
                                                        w=300)

        #populate heads based on current character's body type

        #add the None type part

        thumb = self.mayaToolsDir + "/General/Icons/Fortnite/Bodies/None.bmp"

        button = cmds.symbolButton(w=90,
                                   h=150,
                                   image=thumb,
                                   parent=self.widgets["headList"],
                                   c=self.clearHeadPart)

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        #TORSO TAB

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        self.widgets["torsoTab"] = cmds.formLayout(
            w=400, parent=self.widgets["topLevelLayout"], visible=False)

        backgroundImage = cmds.image(w=380,
                                     h=526,
                                     image=self.mayaToolsDir +
                                     "/General/Icons/Fortnite/torsoTab.jpg")

        #create the 3 buttons for the head, pants, and weapons

        headButton = cmds.iconTextButton(
            image=self.mayaToolsDir +
            "/General/Icons/Fortnite/headTabButton.bmp",
            w=61,
            h=85,
            parent=self.widgets["torsoTab"],
            c=partial(self.switchTab, "headTab"))

        cmds.formLayout(self.widgets["torsoTab"],
                        edit=True,
                        af=[(headButton, 'left', 10), (headButton, 'top', 6)])

        weaponButton = cmds.iconTextButton(
            image=self.mayaToolsDir +
            "/General/Icons/Fortnite/weaponTabButton.bmp",
            w=61,
            h=85,
            parent=self.widgets["torsoTab"],
            c=partial(self.switchTab, "weaponTab"))

        cmds.formLayout(self.widgets["torsoTab"],
                        edit=True,
                        af=[(weaponButton, 'left', 10),
                            (weaponButton, 'top', 211)])

        #add the scrollLayout for the bodies tab

        scrollLayout = cmds.scrollLayout(parent=self.widgets["torsoTab"],
                                         w=320,
                                         h=550,
                                         hst=0)

        cmds.formLayout(self.widgets["torsoTab"],
                        edit=True,
                        af=[(scrollLayout, 'left', 80),
                            (scrollLayout, 'top', 0)])

        self.widgets["bodyList"] = cmds.rowColumnLayout(nc=3,
                                                        cat=[(1, "both", 5),
                                                             (2, "both", 5),
                                                             (3, "both", 5)],
                                                        rs=(1, 5),
                                                        parent=scrollLayout,
                                                        w=300)

        #populate bodies based on current character's body type

        #add the None type part

        thumb = self.mayaToolsDir + "/General/Icons/Fortnite/Bodies/None.bmp"

        button = cmds.symbolButton(w=90,
                                   h=150,
                                   image=thumb,
                                   parent=self.widgets["bodyList"],
                                   c=self.clearBodyPart)

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        #WEAPONS TAB

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        self.widgets["weaponTab"] = cmds.formLayout(
            w=400, parent=self.widgets["topLevelLayout"], visible=False)

        backgroundImage = cmds.image(w=380,
                                     h=526,
                                     image=self.mayaToolsDir +
                                     "/General/Icons/Fortnite/weaponTab.jpg")

        #create the 3 buttons for the head, pants, and weapons

        headButton = cmds.iconTextButton(
            image=self.mayaToolsDir +
            "/General/Icons/Fortnite/headTabButton.bmp",
            w=61,
            h=85,
            parent=self.widgets["weaponTab"],
            c=partial(self.switchTab, "headTab"))

        cmds.formLayout(self.widgets["weaponTab"],
                        edit=True,
                        af=[(headButton, 'left', 10), (headButton, 'top', 6)])

        torsoButton = cmds.iconTextButton(
            image=self.mayaToolsDir +
            "/General/Icons/Fortnite/torsoTabButton.bmp",
            w=61,
            h=85,
            parent=self.widgets["weaponTab"],
            c=partial(self.switchTab, "torsoTab"))

        cmds.formLayout(self.widgets["weaponTab"],
                        edit=True,
                        af=[(torsoButton, 'left', 10),
                            (torsoButton, 'top', 109)])

        #add the scrollLayout for the weapons tab

        scrollLayout = cmds.scrollLayout(parent=self.widgets["weaponTab"],
                                         w=320,
                                         h=550,
                                         hst=0)

        cmds.formLayout(self.widgets["weaponTab"],
                        edit=True,
                        af=[(scrollLayout, 'left', 80),
                            (scrollLayout, 'top', 0)])

        self.widgets["weaponsList"] = cmds.columnLayout(parent=scrollLayout,
                                                        w=300)

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        #PARTS TAB

        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

        #create the switch gender button

        #self.widgets["genderButton"] = cmds.button(w = 400, h = 50, label = "Switch Gender", parent = self.widgets["topLevelLayout"])

        #show window

        cmds.showWindow(self.widgets["window"])

        #get characters in scene

        characters = self.getCharacters()

        for character in characters:

            cmds.menuItem(label=character,
                          parent=self.widgets["characterList"])

        #populate bodies

        self.populateBodies()

        #populate heads

        self.populateHeads()

        #populate layouts

        self.populateWeapons()
コード例 #50
0
def createUI(pWindowTitle):

    windowID = 'myWindowID'

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

    mc.window(windowID,
              title=pWindowTitle,
              sizeable=True,
              resizeToFitChildren=True,
              width=200)

    # OPENING ANS SAVING WINDOWS
    def pOpenFileCallback(*pArgs):
        mc.cmdScrollFieldReporter("outputField", e=True, clear=True)
        fileOutput = mc.fileDialog2(fileMode=1)
        fileContent = fileOutput[0]

        mm.eval('string $filePath = "' + str(fileContent) + '"')
        mm.eval('$fileId = `fopen $filePath "r"`')
        mm.eval("string $data = `fread $fileId $data`")

        transferMELVar = maya.mel.eval("$temp=$data")
        print transferMELVar
        test = str(transferMELVar)
        #myFile = "E:/Users/candrad6/Desktop/FinalTools/TestFiles/history.txt"
        #string $filePath = myFile;
        #$fileId = "`mm.fopen $filePath "r"`";

    def pSaveFileCallback(*pArgs):
        filePathDir = mc.fileDialog2(fileMode=0)
        print filePathDir[0]
        if saveAsFilePath == None:
            mc.error("Didn't select a file to open.")
        print saveAsFilePath

        output = mc.cmdScrollFieldReporter("outputField", q=True, t=True)

    def pPastaCallback(*pArgs):
        mm.eval("sphere -radius 3;")

    mc.menuBarLayout('Meun')
    mc.menu('File')
    mc.menuItem('Open', command=pOpenFileCallback)
    mc.menuItem('Save As...', command=pSaveFileCallback)

    mc.rowColumnLayout(numberOfColumns=1,
                       columnWidth=(1, 400),
                       columnOffset=(1, 'left', 3))

    # MENUBAR LAYOUT
    def pRecordCallback(*pArgs):
        print 'Recording...'
        fileHistDir = mc.fileDialog2(fileMode=0)
        savingDir = fileHistDir[0]
        userHist = mc.scriptEditorInfo(historyFilename=savingDir,
                                       writeHistory=True)

    def pClearCallback(*pArgs):
        print 'Clear button pressed.'
        outputField(clear=True, enable=True)

    def pStopCallback(*pArgs):
        print 'Stopped Recording.'
        mc.scriptEditorInfo(writeHistory=False)
        outputField(enable=False)

    def clearTF(*pArgs):
        mc.cmdScrollFieldReporter("outputField", e=True, clear=True)

    def pRunCallback(*pArgs):
        output = mc.cmdScrollFieldReporter("outputField", q=True, t=True)
        mm.eval(output)

    mc.separator(h=10, style="none")

    mc.rowLayout(numberOfColumns=2)
    mc.button(label='RECORD',
              width=195,
              backgroundColor=(1, 0, 0),
              command=pRecordCallback)
    # mc.button(label= 'CLEAR', width=195, backgroundColor=(1, 1, 0), command=pClearCallback)
    mc.button(label='STOP',
              width=195,
              backgroundColor=(1, 0, 0),
              command=pStopCallback)

    mc.setParent("..")

    mc.rowLayout(numberOfColumns=2)
    mc.button(label='CLEAR',
              width=195,
              backgroundColor=(1, 1, 0),
              command=clearTF)
    mc.button(label='RUN',
              width=195,
              backgroundColor=(0, 1, 0),
              command=pRunCallback)
    mc.setParent("..")

    # mc.text(label='SELECTED STEPS')

    # TABS
    form = mc.formLayout()
    tabs = mc.tabLayout(innerMarginWidth=5, innerMarginHeight=5)
    mc.formLayout(form,
                  edit=True,
                  attachForm=((tabs, 'top', 0), (tabs, 'left', 0),
                              (tabs, 'bottom', 0), (tabs, 'right', 0)))

    clearValue = True
    child1 = mc.rowLayout(numberOfColumns=2)
    outputField = mc.cmdScrollFieldReporter("outputField",
                                            width=395,
                                            height=400,
                                            clear=clearValue,
                                            echoAllCommands=False,
                                            suppressInfo=True,
                                            suppressStackTrace=True,
                                            suppressResults=True,
                                            enable=False)
    mc.setParent('..')

    child2 = mc.rowLayout(numberOfColumns=2)
    inputField = mc.cmdScrollFieldExecuter(width=395,
                                           height=400,
                                           showLineNumbers=True)
    mc.setParent("..")

    mc.tabLayout(tabs,
                 edit=True,
                 tabLabel=((child1, 'Actions List'), (child2, 'Edit Actions')))
    mc.setParent("..")

    mc.separator(h=10, style="none")
    #mc.button(label= 'Execute', width=395, backgroundColor=(0, 50, 0), command=pExecuteCallback)
    #mc.button(label= 'Clear', width=395)

    #mc.textScrollList(append=[''])

    mc.showWindow()
コード例 #51
0
ファイル: woheyun.py プロジェクト: MakChiKin/python_test
mainwindow = cmds.window(title="WoHeYun", mnb=True, mxb=False, sizeable=0)
mainLayout = cmds.columnLayout(w=250, h=340)
cmds.columnLayout(h=90, bgc=(0, 0, 0))
cmds.symbolButton(enable=1,
                  command=visitHomePage,
                  image="icons/woheyunlogo.png",
                  ann='www.woheyun.com')
cmds.setParent('..')
cmds.text(l='www.woheyun.com',
          h=15,
          w=289,
          fn='boldLabelFont',
          bgc=(0.15, 0.15, 0.15))  #

cmds.columnLayout(adjustableColumn=True, w=250)
menuBarLayout = cmds.menuBarLayout()
cmds.menu(label='File')
cmds.menuItem(label='Batch render setting')
cmds.menu(label='Help', helpMenu=True)
cmds.menuItem(label='About...')
cmds.setParent('..')
cmds.setParent('..')

cmds.columnLayout(adjustableColumn=True, w=290)
form = cmds.formLayout()
tabs = cmds.tabLayout(innerMarginWidth=5, innerMarginHeight=5)
cmds.formLayout(form,
                edit=True,
                attachForm=((tabs, 'top', 0), (tabs, 'left', -5),
                            (tabs, 'bottom', 0), (tabs, 'right', -5)))
コード例 #52
0
    def buildGUI(self):

        if cmds.window(self.name, q=True, exists=True):
            cmds.deleteUI(self.name)
        cmds.window(self.name,
                    title=self.title,
                    sizeable=False,
                    mxb=False,
                    mnb=False,
                    toolbox=False,
                    w=100,
                    h=30)
        cmds.columnLayout("mainLayout",
                          adj=True,
                          parent=self.name,
                          co=("left", 5))

        # Add onClose Event
        cmds.scriptJob(uiDeleted=(self.name, self.onClose))

        # Help Menu
        cmds.menuBarLayout("menuBar")
        cmds.menu(label="Show Help", helpMenu=True, pmc=self.showHelp)

        # Import paths
        cmds.textFieldButtonGrp("tfbDBPath",
                                label="Links: ",
                                bl="Set Link Path",
                                cw=(1, 50),
                                parent="mainLayout",
                                bc=self.setDBPath)
        cmds.textFieldButtonGrp("tfbShaderPath",
                                label="Shaders: ",
                                bl="Set Shader Path",
                                cw=(1, 50),
                                parent="mainLayout",
                                bc=self.setShaderPath)

        cmds.checkBox("cbSelection",
                      label="Use Selection",
                      parent="mainLayout")
        cmds.checkBox("cbSubstring",
                      label="Substring prefix",
                      parent="mainLayout",
                      value=True)
        cmds.textField("tfSubstring", parent="mainLayout", text="s100_char")

        cmds.separator(h=10, style="none", parent="mainLayout")

        # Buttons
        cmds.rowColumnLayout("buttonsLayout",
                             numberOfColumns=2,
                             parent="mainLayout")
        cmds.button("bExportLinks",
                    label="Export Links",
                    w=200,
                    h=30,
                    parent="buttonsLayout",
                    c=self.exportLinks)
        cmds.button("bImportShader",
                    label="Link Shaders",
                    w=200,
                    h=30,
                    parent="buttonsLayout",
                    c=self.linkShaders)

        cmds.showWindow(self.name)
コード例 #53
0
ファイル: RigToolKit.py プロジェクト: edeglau/storage
    def create(self):
        
        if cmds.window(self.winName, exists=True):
                cmds.deleteUI(self.winName)

        self.window = cmds.window(self.winName, title=self.winTitle, tbm=1, w=380, h=700 )

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

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')

        cmds.rowLayout  (' rMainRow ', w=380, numberOfColumns=6, p='selectArrayRow')
        cmds.columnLayout ('selectArrayColumn', parent = 'rMainRow')
        cmds.setParent ('selectArrayColumn')
        cmds.separator(h=1, p='selectArrayColumn')

        cmds.frameLayout('FileInterface', cll=1,bgc=[0.15, 0.15, 0.15], cl=0, label='File/session', lv=1, nch=1, borderStyle='out', bv=2, w=345, fn="tinyBoldLabelFont",p='selectArrayColumn') 
        cmds.gridLayout('listBuildButtonLayout', p='FileInterface', numberOfColumns=2, cellWidthHeight=(150, 20))  

        cmds.button (label='Outliner win',bgc=[0.65, 0.75, 0.75], p='listBuildButtonLayout', command = self.outlinerWindow_callup)
        cmds.button (label='Clean Interface', bgc=[0.2, 0.2, 0.2], p='listBuildButtonLayout', command = lambda *args:self.clear_superflous_windows())
        cmds.button (label='Help', bgc=[0.2, 0.2, 0.2],p='listBuildButtonLayout', command = self._help)
        cmds.button (label='Gimme expressions', bgc=[0.2, 0.2, 0.2],p='listBuildButtonLayout', command = self._help)        
        cmds.button (label='revert', bgc=[0.2, 0.2, 0.2], p='listBuildButtonLayout', command = self._revert)
        cmds.button (label='fix playblast', bgc=[0.2, 0.2, 0.2], p='listBuildButtonLayout', command = self._fix_playblast)
        cmds.button (label='fix undos', bgc=[0.2, 0.2, 0.2], ann="This turns undos back on", p='listBuildButtonLayout', command = self._turn_on_undo)
        cmds.button (label='fix cam', bgc=[0.2, 0.2, 0.2],ann="Resets persp cam center of interest (bug). Select object to frame and reset.", p='listBuildButtonLayout', command = self._fix_cam)
        cmds.frameLayout('sep0', cll=1, bgc=[0.0, 0.0, 0.0], label='File/session', lv=0, nch=1, borderStyle='out', bv=5, p='selectArrayColumn')
        cmds.separator(h=1, p='sep0', bgc=[0.0, 0.0, 0.0])
        cmds.frameLayout('Rigs', bgc=[0.15, 0.15, 0.15], cll=1, cl=1, label='Rigs', lv=1, nch=1, borderStyle='out', bv=1, w=345, fn="tinyBoldLabelFont", p='selectArrayColumn')
        cmds.gridLayout('RigsButtonLayout', p='Rigs', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.button (label='Guides Tool', ann="This is the guide tool menu to build the guides that creates the MG rig system", bgc=[0.1, 0.5, 0.5],p='RigsButtonLayout', command = self._guides)
        # cmds.button (label='Build Biped', ann="This is the biped MG rig system - non-mirrored arms", bgc=[0.55, 0.55, 0.55], p='RigsButtonLayout', command = self._rig_biped)
        cmds.button (label='Build BipedMirror', ann="This is the biped MG rig system - mirrored arms", bgc=[0.1, 0.5, 0.5], p='RigsButtonLayout', command = self._rig_biped_mirror)
        cmds.button (label='Build Quad', ann="This is the Quad MG rig system", bgc=[0.1, 0.5, 0.5], p='RigsButtonLayout', command = self._rig_quad)
        cmds.button (label='Face Hugger', ann="This is the Face Hugger rig", bgc=[0.1, 0.5, 0.5], p='RigsButtonLayout', command = self._rig_face)
        cmds.button (label='Skinning Tool', ann="This is the Skinning tool", bgc=[0.1, 0.5, 0.5], p='RigsButtonLayout', command = self._skinning)
        cmds.frameLayout('sep1', cll=1, bgc=[0.0, 0.0, 0.0], label='File/session', lv=0, nch=1, borderStyle='out', bv=5, p='selectArrayColumn')
        cmds.separator(h=1, p='sep1', bgc=[0.0, 0.0, 0.0])
        cmds.frameLayout('MiniRigs', bgc=[0.15, 0.15, 0.15], cll=1, label='Mini Rigs', lv=1, nch=1, borderStyle='out', bv=1, w=345, fn="tinyBoldLabelFont", p='selectArrayColumn')
        cmds.gridLayout('MiniRigsButtonLayout', p='MiniRigs', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.button (label='Insert Grp/Clst/Jnt', bgc=[0.7, 0.7, 0.7], ann="Inserts a group or add a joint or cluster above or as an influence to a controller or object; zeroes out object. USES: set default position in a rig controller/use a deformer joint or cluster to set position of an object", p='MiniRigsButtonLayout', command = self._grp_insert)
        cmds.popupMenu(button=1)
        cmds.menuItem (label='Grp insert', command = self._grp_insert)
        cmds.menuItem (label='Clstr insert', command = self._clstr_insert)
        cmds.menuItem (label='Jnt insert', command = self._jnt_insert)
        cmds.button (label='CurveRig', bgc=[0.55, 0.6, 0.6], ann="Isolated joints that control CVs along a curve with no IK or FK dependencies. Create a guide chain then use this to create a curve rig. USES: Tongue, worm, eyelash line rig", p='MiniRigsButtonLayout', command = self._curve_rig)
        cmds.button (label='ChainRig', bgc=[0.55, 0.6, 0.6], ann="An FK/IK tail rig. Create a guide chain and then create a rig chain that has both IK/FK and a stretch attribute. USES: Rope rig", p='MiniRigsButtonLayout', command = self.chain_rig)
        cmds.button (label='FinallingRig', bgc=[0.55, 0.6, 0.6], ann="Mini joint rigs. Creates a bone connected to a controller to be added to outfits or to a simple prop. Select object or vert to add. If using vert, the resulting joint needs to be added and weight painted", p='MiniRigsButtonLayout', command = self._finalling_rig)
        cmds.button (label='Multi functions',bgc=[0.55, 0.6, 0.6],ann="this builds a constraint on a group of selected items to the first selected item", p='MiniRigsButtonLayout', command = self._constraint_maker)
        # cmds.button (label='Grp insert', ann="Inserts a group above a controller or object, zeroes out object. USES: changing default position in a rig controller", p='MiniRigsButtonLayout', command = self._grp_insert)
        # cmds.button (label='Clstr insert', ann="Inserts a group above a controller or object, zeroes out object. USES: changing default position in a rig controller", p='MiniRigsButtonLayout', command = self._clstr_insert)
        # cmds.button (label='Jnt insert', ann="Inserts a group above a controller or object, zeroes out object. USES: changing default position in a rig controller", p='MiniRigsButtonLayout', command = self._jnt_insert)
        cmds.button (label='Multi Rivet', ann="places multiple rivets based on vert selection.", p='MiniRigsButtonLayout', command = self._rivet)
        cmds.button (label='Multi Point', ann="places multiple point constrained locators based on vert selection.", p='MiniRigsButtonLayout', command = self._point_const)
        cmds.button (label='Rivet Obj', ann="Uses the common Rivet tool built by Michael Bazhutkin. Adds selected object to a new created rivet. Select two edges of one object and then the object you want to rivet to the first. USES: buttons", p='MiniRigsButtonLayout', command = self._rivet_obj)
        cmds.button (label='Bone rivet', ann="Builds a rivet and parents a joint to that locator for skinning geometry to. USES: eyelashes", p='MiniRigsButtonLayout', command = self._bone_rivet)
        cmds.button (label='Joint chain', ann="builds a simple bone chain based on guides. USES: insect leg chains with no prebuilt rig", p='MiniRigsButtonLayout', command = self._build_joints)
        cmds.button (label='build IK', ann="Adds ik to handle. Select root bone, select end bone and select controller. Will parent ik handle to controller.", p='MiniRigsButtonLayout', command = self._build_ik)
        cmds.button (label='Stretch IK',ann="select controller and ikhandle to link up and add stretch attribute.", p='MiniRigsButtonLayout', command = self._stretch_ik)
        cmds.button (label='Stretch IKspline', ann="adds a stretch to a spline IK", p='MiniRigsButtonLayout', command = self._stretch_ik_spline)
        cmds.button (label='EyeDir', ann="Adds a curve to represent a pupil to the eye joint. Must have 'EyeOrient_*_jnt' in scene to parent to.", p='MiniRigsButtonLayout', command = self.addEyeDir)
        cmds.button (label='Switch Constraint SDK', ann="Switch constraint SDK(used in switching a double constraint in IK/FK mode)select single item with two constraints and then select control item with user defined float in the attribute and connects an SDK switch for the two constraints", p='MiniRigsButtonLayout',command = self._switch_driven_key_window)
        cmds.button (label='Blend Colour Switch', ann="Blend colour tool(used in blend IK to FK chains) Select a controller with a user attribute, a follow object, then a '0' rotate/scale leading object and a '1' rotate/scale leading object", p='MiniRigsButtonLayout',command = self._blend_colour_window)
        cmds.button (label='Connect to Curve', ann="connect objects to a curve - select curve first and then objects", p='MiniRigsButtonLayout',command = self._connect_to_curve)
        cmds.button (label='Calamari', ann="Creates proxy cubes as a low res standin for mesh on a bone heirarchy. Used to check for flipping joints", p='MiniRigsButtonLayout',command = self._calamari)
        cmds.frameLayout('sep2', cll=1, bgc=[0.0, 0.0, 0.0], label='File/session', lv=0, nch=1, borderStyle='out', bv=5, p='selectArrayColumn')
        cmds.separator(h=1, p='sep2')
        cmds.frameLayout('Tool', bgc=[0.15, 0.15, 0.15], cll=1, label='Tools', lv=1, nch=1, borderStyle='out', bv=1, w=345, fn="tinyBoldLabelFont", p='selectArrayColumn')
        cmds.gridLayout('ToolButtonLayout', p='Tool', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.button (label='Anim Tools', ann="This opens the animator tools menu", bgc=[0.1, 0.5, 0.5], p='ToolButtonLayout', command = self._anim_tools)
        cmds.button (label='Material tool', ann="This opens a material tool for manipulating and naming shaders and shader nodes" , bgc=[0.1, 0.5, 0.5], p='ToolButtonLayout', command = self._material_namer)
        cmds.button (label='SelectArray Tool', ann="Launches Select Array tool. Workspace for creating selections, sets and finding nodes in complicated scenes.", bgc=[0.65, 0.75, 0.75], p='ToolButtonLayout', command = self._select_array)
        cmds.button (label='Stream Swim', bgc=[0.65, 0.75, 0.75], p='ToolButtonLayout', command = self._load_ssd)
        cmds.button (label='Renamer Tool', ann="Launches a renamer tool.", bgc=[0.65, 0.75, 0.75],p='ToolButtonLayout', command = self._renamer)
        # cmds.button (label='Add to Body set', ann="This adds a selection to the MG named bodyset(used when adding wardrobe finalling controllers)", bgc=[0.55, 0.6, 0.6], p='ToolButtonLayout', command = self._sets_win)
        cmds.button (label='Edit sets', ann="Add and subtract selected objects/verts from a set", bgc=[0.55, 0.6, 0.6], p='ToolButtonLayout', command = self._edit_sets_win)
        # cmds.button (label='Edit Dyn sets', ann="Add and subtract selected objects/verts from a dynamic set", bgc=[0.55, 0.6, 0.6], p='ToolButtonLayout', command = self._edit_nsets_win)
        cmds.button (label='Plot vertex', bgc=[0.55, 0.6, 0.6], ann="Plots a locator along a vertex or face within keyframe range", p='ToolButtonLayout', command = self._plot_vert)
        cmds.button (label='cull CVs', ann="This is the Skinning tool", bgc=[0.55, 0.6, 0.6], p='ToolButtonLayout', command = self._remove_CV)
        cmds.button (label='Hidden grp', bgc=[0.55, 0.6, 0.6], p='ToolButtonLayout', ann="A menu for toggle hiding in group heirarchies" ,command = self._hidden)
        cmds.button (label='Copy To Grps', ann="Copy's object to group selected.",p='ToolButtonLayout', command = self._copy_into_grp)
        cmds.button (label='Wrap TA Groups', ann="Wrap objects under selection 2 group to selection 1.",p='ToolButtonLayout', command = self._wrap_ta_grp)
        cmds.button (label='ResetSelected', p='ToolButtonLayout', ann="This will reset the selected to 0.0(transforms only - will not affect control box attributes)", command = self._reset_selected)
        cmds.button (label='Wipe Anim From Obj', ann="Resets all Ctrl on selected to zero. Wipes animation", p='ToolButtonLayout', command = self._erase_anim)
        cmds.button (label='Toggle Nullify object', ann="Hides object and makes unkeyable. USES: hide locators from animators", p='ToolButtonLayout', command = self._disappear)
        cmds.button (label='Mass Move', ann="moves first selected to second selected(mass select first and then where to move last)", p='ToolButtonLayout', command = self._mass_movecstr)
        cmds.button (label='MatchMatrix', p='ToolButtonLayout', ann="This will match the exact matrix of the first selection", command = self._match_matrix)
        cmds.button (label='MirrorTransform', p='ToolButtonLayout', ann="This will mirror the transform to the opposite controller", command = self._mirror_transform)
        cmds.button (label='Duplicate Move', p='ToolButtonLayout', command = self._dup_move)
        cmds.button (label='ShadeNetworkSel', p='ToolButtonLayout', command = self._shade_network)
        cmds.button (label='PolyCheck', p='ToolButtonLayout', command = self._poly_check)
        cmds.button (label='<<', p='ToolButtonLayout', command = self.getinput)
        cmds.button (label='>>', p='ToolButtonLayout', command = self.getoutput)  
        # cmds.button (label='*Cleanup asset', bgc=[0.00, 0.22, 0.00], ann="Hides finalling rig locators in skinned asset file, switches wardrobe joint interpolation('Dressvtx' and 'Skirtvtx') to noflip. if char light present, reconstrains it to master", p='listBuildButtonLayout', command = self._clean_up)
        # cmds.button (label='*Cleanup rig', bgc=[0.00, 0.22, 0.00], ann="Hides stretch locators, hides and unkeyable shoulder, resets some attributes to no longer go in negative value(fingers)", p='listBuildButtonLayout', command = self._clean_up_rig)
        # cmds.button (label='*Wipe Anim From Asset', bgc=[0.00, 0.22, 0.00], ann="Resets all Ctrl to zero. Wipes animation", p='listBuildButtonLayout', command = self._reset_asset)
        cmds.frameLayout('sep3', cll=1, bgc=[0.0, 0.0, 0.0], label='File/session', lv=0, nch=1, borderStyle='out', bv=5, p='selectArrayColumn')
        cmds.separator(h=1, p='sep3')
        cmds.frameLayout('AttributesFrameLayout',bgc=[0.15, 0.15, 0.15], cll=1, label='Attributes', lv=1, nch=1, borderStyle='out', bv=1, w=345, fn="tinyBoldLabelFont", p='selectArrayColumn')
        cmds.gridLayout('AttributeButtonLayout', p='AttributesFrameLayout', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.button (label='Fetch Attribute', bgc=[0.65, 0.75, 0.75], ann="searches for attribute by name", p='AttributeButtonLayout', command = self._findAttr_window)
        cmds.button (label='Fast Float', bgc=[0.55, 0.6, 0.6], ann="Add a simple 0-1 float attribute to selected", p='AttributeButtonLayout',command = self._fast_float)
        cmds.button (label='Fast Connect', bgc=[0.55, 0.6, 0.6], ann="Connect attributes between two selections", p='AttributeButtonLayout',command = self._quickCconnect_window)
        cmds.button (label='Fast Attr Alias', bgc=[0.55, 0.6, 0.6], ann="Creates a float alias attributes from first selection to second(no min/max)", p='AttributeButtonLayout',command = self._createAlias_window)
        cmds.button (label='Fast SDK Alias', bgc=[0.55, 0.6, 0.6], ann="Creates and connects attribute between two objects, first attribute to a new attribute on the second with the option to set SDK", p='AttributeButtonLayout',command = self._createSDK_alias_window)
        cmds.button (label='Fast SDK Connect', bgc=[0.55, 0.6, 0.6], ann="Connects between two attributes with the option to set SDK", p='AttributeButtonLayout',command = self._connSDK_alias_window)
        cmds.button (label='Copy Single Attr', bgc=[0.55, 0.6, 0.6], ann="copies a singular attribute properties from one selection to another", p='AttributeButtonLayout',command = self._quickCopy_single_Attr_window)
        cmds.button (label='Set Range Multi Attr', bgc=[0.55, 0.6, 0.6], ann="sets same attribute across an object selection between a set range", p='AttributeButtonLayout', command = self._range_attr_window)
        cmds.button (label='SDK Any', ann="Select your driving object and then a group of objects to set the driven. This detects the attribute from the driver you can select and sets a driven key on all transforms (tx, ty, tz, rx, ry, rz) of selected objects. Useful for setting predetermined phonemes in a facerig", bgc=[0.55, 0.6, 0.6],p='AttributeButtonLayout', command = self._set_any)
        cmds.button (label='Copy Anim/Att', ann="transfers animation and attribute settings to another", p='AttributeButtonLayout',command = self._transfer_anim_attr)
        cmds.button (label='Transfer Mass Attr', ann="Transfers attributes from one group of objects to another group of objects. Alternate a selections between objects to objects you want to transfer to. Not restricted to transform", p='AttributeButtonLayout', command = self._tran_att)
        # cmds.button (label='Transfer Mass Attr2', ann="Transfers attributes from one object to group of selected objects. a selections between object to objects you want to transfer to. Not restricted to transform", p='AttributeButtonLayout', command = self._tran_att_mass)
        cmds.frameLayout('sep5', cll=1, bgc=[0.0, 0.0, 0.0], label='', lv=0, nch=1, borderStyle='out', bv=5, p='selectArrayColumn')
        cmds.separator(h=1, p='sep5')
        cmds.frameLayout('ControllerFrameLayout', bgc=[0.15, 0.15, 0.15], cll=1, cl=0, label='Controllers', lv=1, nch=1, borderStyle='out', bv=1, w=345, fn="tinyBoldLabelFont", p='selectArrayColumn')
        cmds.gridLayout('ControllerButtonLayout', p='ControllerFrameLayout', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.button (label='Controller', bgc=[0.55, 0.6, 0.6], ann="parent constraints to a controller.", p='ControllerButtonLayout', command = self._control)
        cmds.button (label='Sandwich ctrl', bgc=[0.55, 0.6, 0.6], ann="Adds a helper control. (SDK=Set Driven Key). Sandwiches a controller between a selected controller and it's parent. Used for adding a set driven key to maintain a specific movement while the regular controller can be used as it's offset.", p='ControllerButtonLayout', command = self._sandwich_control)
        cmds.button (label='Shapes Tool', ann="Creates a predetermined controller shape, joint or locator at selection or at origin (if nothing selected)", bgc=[0.55, 0.6, 0.6], p='ControllerButtonLayout', command = self._make_shape)
        cmds.button (label='Colours', ann="Changes colors on a group of selected objects", bgc=[0.55, 0.6, 0.6], p='ControllerButtonLayout', command = self._change_colours)
        cmds.button (label='Limits', ann="An interface for creating limits on rigs. Can globally set, load or reset a rig.", bgc=[0.55, 0.6, 0.6], p='ControllerButtonLayout', command = self._change_limit_values)
        cmds.button (label='Combine Shapes', ann="Combines selected curves into a single shape", p='ControllerButtonLayout', command = self._group_shapes)
        cmds.frameLayout('sep4', cll=1, bgc=[0.0, 0.0, 0.0], label='', lv=0, nch=1, borderStyle='out', bv=5, p='selectArrayColumn')
        cmds.separator(h=1, p='sep4')
        cmds.frameLayout('ModelFrameLayout',bgc=[0.15, 0.15, 0.15], cll=1, cl=1, label='Modelling', lv=1, nch=1, borderStyle='out', bv=1, w=345, fn="tinyBoldLabelFont", p='selectArrayColumn')
        cmds.gridLayout('ModelButtonLayout', p='ModelFrameLayout', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.button (label='Blend Groups', bgc=[0.7, 0.7, 0.7], ann="Blend a group of objects to another group of objects(needs to be same meshes in heirarchy). Select deformer group and then deformee group.", p='ModelButtonLayout', command = self._blend_grp)
        cmds.popupMenu(button=1)
        cmds.menuItem (label='GrpToGrp', command = self._blend_grp)
        cmds.menuItem (label='massBlend', command = self._mass_blend)
        cmds.menuItem (label='GrpSearchAndBlend', command = self._srch_and_blend)
        cmds.button (label='Reshape to Edge', bgc=[0.7, 0.7, 0.7], ann="aligns and deforms an object by continuous edge of one poly object to another (EG: aligning a vein to the surface of a leaf). 'Reshape to Edge' is better for cylindrical shapes, 'Reshape to Shape' is better for flat planes.", p='ModelButtonLayout', command = self._reshape_to_curve)
        cmds.popupMenu(button=1)
        cmds.menuItem (label='Reshape to Edge', command = self._reshape_to_curve)
        cmds.menuItem (label='Reshape to Shape', command = self._reshape_to_shape)
        cmds.button (label='MirrorObject', ann="Mirrors duplicate object across the X axis", p='ModelButtonLayout', command = self._mirror_object)
        cmds.button (label='Clean model', ann="Deletes history on a selected mesh and zeroes out transforms", p='ModelButtonLayout', command = self._clean_mod)
        cmds.button (label='MirrorBlend', ann="Creates a mirrored blend shape. Select blendShape and select main object.", p='ModelButtonLayout', command = self._mirror_blend)
        cmds.button (label='Build curve', ann="Build a curve on selected items.", p='ModelButtonLayout', command = self._build_curve)
        cmds.frameLayout('sep6', cll=1, bgc=[0.0, 0.0, 0.0], label='', lv=0, nch=1, borderStyle='out', bv=5, p='selectArrayColumn')
        cmds.separator(h=1, p='sep6')
        cmds.frameLayout('ExtFolderFrameLayout', bgc=[0.15, 0.15, 0.15], cl=1, cll=1, label='External folders', lv=1, nch=1, borderStyle='out', bv=1, w=345, fn="tinyBoldLabelFont", p='selectArrayColumn')
        cmds.gridLayout('ExtFolderButtonLayout', p='ExtFolderFrameLayout', numberOfColumns=2, cellWidthHeight=(150, 20))
        cmds.button (label='Save Attr/Anim', bgc=[0.55, 0.6, 0.6], ann="saves all attributes into an external file into project", p='ExtFolderButtonLayout', command = self._save_att)
        cmds.button (label='Load Attr/Anim', bgc=[0.55, 0.6, 0.6], ann="loads attributes from an external file into project", p='ExtFolderButtonLayout', command = self._load_att)
        cmds.button (label='Save Selection', bgc=[0.55, 0.6, 0.6], ann="saves all attributes/animation keys into an external file into project",  p='ExtFolderButtonLayout', command = self._save_sel) 
        cmds.button (label='Load Selection', bgc=[0.55, 0.6, 0.6], ann="loads attributes/animation keys from an external file into project",  p='ExtFolderButtonLayout', command = self._load_sel)
        cmds.button (label='Save Connection', bgc=[0.55, 0.6, 0.6], ann="saves all attributes/animation keys into an external file into project",  p='ExtFolderButtonLayout', command = self._save_connection) 
        cmds.button (label='Load Connection', bgc=[0.55, 0.6, 0.6], ann="loads attributes/animation keys from an external file into project",  p='ExtFolderButtonLayout', command = self._load_connection)
        cmds.button (label='Change multi file contents', bgc=[0.25, 0.25, 0.25], ann="changes multiple file contents(EG: joint names within skin xml files).", p='ExtFolderButtonLayout', command = self._changing_file_contents)
        cmds.button (label='Change multi file names', bgc=[0.25, 0.25, 0.25], ann="changes multiple file names(EG: render images/version numbers).", p='ExtFolderButtonLayout', command = self._changing_files)
        cmds.button (label='Export multiple obj', bgc=[0.25, 0.25, 0.25], ann="Exports a group of selected objects as separate .obj files.",p='ExtFolderButtonLayout', command = self._exp_obj)
        cmds.button (label='Open Image PS', bgc=[0.2, 0.2, 0.2], ann="Select a texture node and this will open the texture file in photoshop - change the file path in 'photohop' at the top to your local exe", p='ExtFolderButtonLayout', command = self._open_texture_file_ps)
        cmds.button (label='Open Image Gimp', bgc=[0.2, 0.2, 0.2], ann="Select a texture node and this will open the texture file in gimp - change the file path in 'gimp' at the top to your local exe",p='ExtFolderButtonLayout', command = self._open_texture_file_gmp)
        cmds.button (label='Open Web', bgc=[0.2, 0.2, 0.2], ann="Select a texture node and this will open the texture file in gimp - change the file path in 'gimp' at the top to your local exe",p='ExtFolderButtonLayout', command = self._open_web)        
        cmds.button (label='Open Work folder', bgc=[0.2, 0.2, 0.2], ann="Opens the folder in which the current open file is located. Refresh this interface if opening a new file elsewhere.", p='ExtFolderButtonLayout', command = self._open_work_folder)
        cmds.text (label='Author: Elise Deglau',w=120, al='left', p='selectArrayColumn', fn="smallObliqueLabelFont")      
        # cmds.text (label='http://creativecommons.org/licenses/by-sa/3.0/au/',w=500, al='left', fn="smallObliqueLabelFont", p='selectArrayColumn')      
        cmds.showWindow(self.window)
コード例 #54
0
ファイル: ToolBoxI.py プロジェクト: yazici/damgteam
    def __init__(self):
        if cmds.window('DAMGcommonToolMainUI', exists=True):
            cmds.deleteUI('DAMGcommonToolMainUI')

        cw2 = [(1, 5), (2, 100), (3, 250), (4, 5)]
        cw3 = [(1, 5), (2, 105), (3, 5), (4, 130), (5, 5), (6, 105), (7, 5)]

        def makeDistanceForRowcolumn(height, times):
            i = 0
            for i in range(times):
                cmds.text(l="", h=height)
                i += 1

        cmds.window('DAMGcommonToolMainUI', t="DAMG Tool Box I", rtf=True)
        # menu
        cmds.columnLayout()
        cmds.menuBarLayout()
        cmds.menu(label='About')
        cmds.menuItem(d=True)
        cmds.menuItem(label='About DAMG Tool Box I')
        tabControl = cmds.tabLayout()
        # renamer tab
        t1 = cmds.columnLayout()
        cmds.separator(style='in', w=360, h=8)
        # copy and replace
        cmds.rowColumnLayout(nc=4, cw=cw2)
        makeDistanceForRowcolumn(2, 4)
        cmds.text(l="")
        cmds.text(l="Search", align='center')
        self.tfSearch = cmds.textField('tfSearch', tx="")
        cmds.text(l="")
        makeDistanceForRowcolumn(2, 4)
        cmds.text(l="")
        cmds.text(l="Replace", align='center')
        self.tfReplace = cmds.textField('tfReplace', tx="")
        cmds.text(l="")
        cmds.setParent('..')
        cmds.text(l="", h=8)
        cmds.rowColumnLayout(nc=5,
                             cw=[(1, 5), (2, 172.5), (3, 5), (4, 172.5),
                                 (5, 5)])
        cmds.text(l="")
        cmds.button(l="Search And Select", c=self.searchAndSelect)
        cmds.text(l="")
        cmds.button(l="Search And Replace", c=self.searchAndReplace)
        cmds.text(l="")
        cmds.setParent('..')
        cmds.text(l="", h=5)
        cmds.separator(style="in", w=360, h=8)
        cmds.text(l="", h=5)
        # number and padding setting
        cmds.rowColumnLayout(nc=3, cw=[(1, 200), (2, 100), (3, 60)])
        cmds.text(l="", w=200)
        cmds.text(l="Number", w=100)
        self.ifNumber = cmds.intField('ifNumber', v=0, w=60, min=0)
        cmds.setParent('..')
        cmds.rowColumnLayout(nc=3, cw=[(1, 200), (2, 100), (3, 60)])
        cmds.button(l="Auto Rename By Type", align='center', c=self.autoRename)
        cmds.text(l="Padding", w=100)
        self.ifPadding = cmds.intField('ifPadding', v=0, w=60, min=0)
        cmds.text(l="", w=200, h=8)
        cmds.separator(style='in', w=160)
        cmds.text(l="", w=60, h=8)
        cmds.setParent('..')
        # rename with prefix and suffix, number and padding
        cmds.rowColumnLayout(nc=7, cw=cw3)
        cmds.text(l="", w=5)
        cmds.text(l="Prefix", align='center', w=105)
        cmds.text(l="", w=5)
        cmds.text(l="Rename", align='center', w=130)
        cmds.text(l="", w=5)
        cmds.text(l="Suffix", align='center', w=105)
        cmds.text(l="", w=5)
        cmds.setParent('..')
        cmds.text(l="", h=2)
        cmds.rowColumnLayout(nc=7, cw=cw3)
        cmds.text(l="", w=5)
        self.tfPrefix = cmds.textField('tfPrefix', tx="", w=105)
        cmds.text(l="", w=5)
        self.tfRename = cmds.textField('tfRename', tx="", w=130)
        cmds.text(l="", w=5)
        self.tfSuffix = cmds.textField('tfSuffix', tx="", w=105)
        cmds.text(l="", w=5)
        cmds.setParent('..')
        cmds.text(l="", h=2)
        cmds.rowColumnLayout(nc=7, cw=cw3)
        cmds.text(l="", w=5)
        cmds.button('button_prefix', l="Add Prefix", w=105, c=self.addPrefix)
        cmds.text(l="", w=5)
        cmds.button('button_rename', l="Rename", w=130, c=self.doRename)
        cmds.text(l="", w=5)
        cmds.button('button_suffix', l="Add Suffix", w=105, c=self.addSuffix)
        cmds.text(l="", w=5)
        cmds.setParent('..')
        cmds.text(l="", h=2)
        cmds.separator(style="in", w=360, h=8)
        # add attribute tab
        cmds.setParent(tabControl)
        t2 = cmds.columnLayout()
        cmds.separator(style='in', w=360, h=8)
        # long name and short name
        cmds.rowColumnLayout(nc=4, cw=[(1, 30), (2, 100), (3, 200), (4, 30)])
        cmds.text(l="")
        cmds.text(l="Long Name  ", align='center')
        cmds.textField('longNameAA', text="")
        makeDistanceForRowcolumn(4, 2)
        cmds.text(l="Short Name  ", align='center')
        cmds.textField('shortNameAA', text="")
        cmds.text(l="")
        cmds.setParent('..')
        cmds.text(l="", h=5)
        cmds.separator(w=360, style="in")
        cmds.text(l="", h=5)
        # value setting: min, max, default, float or boolean
        cmds.rowColumnLayout(nc=4, cw=[(1, 90), (2, 90), (3, 90), (4, 90)])
        cmds.text(l="Min")
        cmds.text(l="Default")
        cmds.text(l="Max")
        cmds.text(l="F/B")
        makeDistanceForRowcolumn(5, 4)
        cmds.intField('minIntAA', v=-360)
        cmds.intField('defIntAA', v=0)
        cmds.intField('maxIntAA', v=360)
        cmds.optionMenu('ForBAA')
        cmds.menuItem(l="Float")
        cmds.menuItem(l="Boolean")
        cmds.setParent('..')
        cmds.separator(style="in", w=360, h=5)
        cmds.text(l="", h=5)
        # add attribute button
        cmds.rowColumnLayout(nc=3, cw=[(1, 100), (2, 160), (3, 100)])
        cmds.text(l="")
        cmds.button(l="Add Attribute", c=self.addAttribute)
        makeDistanceForRowcolumn(5, 4)
        cmds.setParent('..')
        cmds.separator(style="in", w=360, h=5)
        # attribute presets
        cmds.rowColumnLayout(nc=5,
                             cw=[(1, 30), (2, 147.5), (3, 5), (4, 147.5),
                                 (5, 30)])
        makeDistanceForRowcolumn(5, 5)
        cmds.text(l="")
        cmds.button(l="Left hand", c=self.leftHandPreset)
        cmds.text(l="")
        cmds.button(l="Right hand", c=self.rightHandPreset)
        cmds.text(l="")
        makeDistanceForRowcolumn(5, 5)
        cmds.text(l="")
        cmds.button(l="Left foot", c=self.leftFootPreset)
        cmds.text(l="")
        cmds.button(l="Right foot", c=self.rightFootPreset)
        cmds.text(l="")
        makeDistanceForRowcolumn(5, 5)
        cmds.setParent('..')
        cmds.separator(style="in", w=360, h=5)
        cmds.setParent(tabControl)

        cmds.tabLayout(tabControl,
                       edit=True,
                       tabLabel=((t1, 'Renamer'), (t2, 'Add Attribute')))
        cmds.showWindow('DAMGcommonToolMainUI')
コード例 #55
0
ファイル: MayaMainUI.py プロジェクト: sherlockan/PipelineTool
    def buildUI(self):
        # ann1 = ['Open/Load scene','Take a snapshot','Publish file']
        # ic1 = ['openLoad.icon.png','snapshot.icon.png','publish.icon.png']
        # cm1 = [self.bts.loaderUI,self.bts.snapshotUI,self.bts.publishUI]
        # self.bts.setIconButton( ann1, cm1, ic1 )

        anns = ['Hypershader', 'Plugin Manager', 'Outliner','Script Editor', 'Graph Editor', 'UV Editor',
                'Spread Sheet', 'Channel Box', 'Node Editor', 'Vray VFB', 'Render Setting', ]

        commands = ['cmds.HypershadeWindow()', 'cmds.PluginManager()',
                    'mel.eval("OutlinerWindow;")', self.bts.openScriptEditor, 'mel.eval("GraphEditor;")',
                    'mel.eval("TextureViewWindow;")', self.bts.spreadSheetUI, self.bts.channelBoxUI,
                      'cmds.NodeEditorWindow()', self.bts.openVrayVFB, 'cmds.RenderGlobalsWindow()',]

        icons = ['hypershader.icon.png', 'pluinManager.icon.png', 'outliner.icon.png',
                 'scriptEditor.icon.png', 'graphEditor.icon.png', 'uvEditor.icon.png', 'spreadsheet.icon.png',
                 'channelBox.icon.png', 'nodeEditor.icon.png', 'vrayVFB.icon.png', 'renderSetting.icon.png', ]

        w = WIDTH
        w1 = ICONWIDTH
        w2 = w-w1
        #row colummn width for Main UI
        nc2 = 2
        cw2 = [(1,w1),(2,w2)]

        self.layout = QtWidgets.QGridLayout(self)

        cmds.scrollLayout('masterLayout', w=w+16)
        mlo = cmds.rowColumnLayout(nc=nc2, cw=cw2)

        cmds.columnLayout()
        self.bts.iconButton(ann='reloadUI', icon=geticon('Logo.icon.png'), command=self.bts.refreshMainUI)
        self.bts.makeSeparator( h=5, w=ICONWIDTH )
        self.bts.setIconButton(anns, commands, icons)
        self.bts.makeSeparator(h=5, w=ICONWIDTH)

        cmds.setParent(mlo)
        # Menu
        menuBar = cmds.menuBarLayout()
        self.menuSection(menuBar)
        # UI right side sections
        mlor = cmds.columnLayout(w=w2)
        self.tabControls = cmds.tabLayout('mlorTabControls')
        t1 = cmds.columnLayout(w=w2)
        nc=4
        wl1 = [100, 140, 140, 25]
        wl2 = [100, 280, 25]
        cmds.rowColumnLayout(nc=nc, cw=self.bts.cwCustomize(nc, wl1))
        cmds.text( l="Prod Name: ", align='center' )
        cmds.textField( 'Prod Name', tx=self.prodName )

        self.setCurModeMenu = cmds.optionMenu('setCurModeMenu', cc=self.bts.waitforupdate, )

        cmds.menuItem(l="Studio Mode", p=self.setCurModeMenu)
        cmds.menuItem(l="Group Mode", p=self.setCurModeMenu)

        self.refreshCheckMode()

        self.bts.refreshBtn(self.refreshCheckMode)
        cmds.setParent('..')

        nc=3
        cmds.rowColumnLayout( nc=nc, cw=self.bts.cwCustomize(nc,wl2))
        cmds.text( l="Production Path", align='center' )
        cmds.textField( 'prodPthTf', tx=self.prodPth )
        self.bts.refreshBtn(self.refreshProdPth)
        cmds.text( l="Project Path", align='center' )
        cmds.textField( 'projPthTf', tx=self.curPth )
        self.bts.refreshBtn(self.refreshProjPth)
        cmds.setParent('..')

        nc=4
        adj = 10
        cmds.rowColumnLayout( nc=4, cw=self.bts.cwE(nc, w2, adj))
        # anns, commands, labels,
        anns = ['Set Project directory', 'Open Project manager UI', 'Create A new production', 'Refresh info']
        commands = [self.setProject, self.bts.projManagerUI, self.bts.newProd, self.refreshInfo]
        labels = ['Set Project', 'Project Manager', 'New Production', 'Refresh Info']
        self.bts.setCoolButton(anns=anns, commands=commands, labels=labels)
        cmds.setParent(t1)

        self.projectContentUI()

        cmds.setParent( t1 )

        cmds.setParent( mlor )
        cmds.separator( style='in', w=w2 )

        mlor_lo1 = cmds.columnLayout( w=w2 )

        self.commonSectionUI()

        cmds.setParent( mlor_lo1 )

        t2 = cmds.columnLayout( parent=self.tabControls, w=w2 )
        self.modelingTab()
        cmds.setParent( self.tabControls )

        t3 = cmds.columnLayout(parent=self.tabControls )
        self.bts.makeAcoolButton("Demo buttons", 'Rigging', self.bts.waitforupdate )
        cmds.setParent( self.tabControls )

        t4 = cmds.columnLayout( parent=self.tabControls )
        self.surfacingTab()
        cmds.setParent( self.tabControls )

        t5 = cmds.columnLayout(parent=self.tabControls )
        self.bts.makeAcoolButton("Demo buttons",  'Dynamics', self.bts.waitforupdate )
        cmds.setParent( self.tabControls )

        t6 = cmds.columnLayout(parent=self.tabControls )
        self.bts.makeAcoolButton("Demo buttons",  'Animation', self.bts.waitforupdate )
        cmds.setParent( self.tabControls )

        t7 = cmds.columnLayout(parent=self.tabControls )
        self.bts.makeAcoolButton("Demo buttons",  'Light Manager', self.bts.lightManager )
        cmds.setParent( self.tabControls )
        # Create appropriate labels for the ts
        cmds.tabLayout( self.tabControls, edit=True, tabLabel=(
            (t1, "Project"), (t2, "Model"), (t3, "Rig"), (t4, "Surface"), (t5, "FX"), (t6, "Anim"), (t7, "Light")) )
コード例 #56
0
def MainWindow(V):
    print V
    try:
        Chcek_BakeAll = cmds.checkBox("Check_FrameLock", q=True, value=True)
    except:
        Chcek_BakeAll = []
    windowname = "ChangeOrder"
    WindowWidth_Size = 230
    WindowHight_Size = 300
    oObj = []

    if cmds.window(windowname, exists=True):
        cmds.deleteUI(windowname, window=True)
    Window = cmds.window(windowname,
                         title=windowname,
                         sizeable=True,
                         mxb=False,
                         wh=[WindowWidth_Size, WindowHight_Size])

    #Helpの為にメインメニューバーを追加します
    cmds.menuBarLayout()
    cmds.menu(label=u"Menu", tearOff=False)
    cmds.menuItem(label=Window + u"の解説", c=HelpWindow_Page)
    cmds.separator(w=WindowWidth_Size)
    cmds.setParent("..")

    cmds.columnLayout(w=WindowWidth_Size + 3)
    tab = cmds.tabLayout(w=WindowWidth_Size)

    tab1_B = cmds.frameLayout("ChangeOrder",
                              label="ChangeOrder",
                              bgc=[1.0, 0.3, 0.2])
    cmds.columnLayout(columnAttach=('left', 2))
    cmds.rowLayout('Orders', numberOfColumns=4, columnWidth2=[100, 40])
    cmds.optionMenu('Order_List', w=100, h=50)
    cmds.menuItem(l='0.  xyz')
    cmds.menuItem(l='1.     yzx')
    cmds.menuItem(l='2.        zxy')
    cmds.menuItem(l='3.  xzy')
    cmds.menuItem(l='4.     yxz')
    cmds.menuItem(l='5.        zyx')
    try:
        oObj = cmds.ls(sl=True, type="transform")[0]
        cmds.setToolTo("RotateSuperContext")
        cmds.manipRotateContext("Rotate", e=True, mode=2)
    except:
        pass
    if len(oObj) > 1:
        oObj_Order = cmds.getAttr(oObj + ".rotateOrder")
    else:
        oObj_Order = 0

    cmds.optionMenu('Order_List',
                    e=True,
                    bgc=[0.5, 0.2, 0.2],
                    ebg=False,
                    sl=oObj_Order + 1)
    cmds.button('exe', l=u'実行!', h=40, w=110, c='ChangeOrder_exe(%d)' % (0))
    cmds.separator(height=1)
    cmds.setParent(tab1_B)
    Lock = cmds.checkBox("FrameLock", label=u'フレームを保持しない')

    tab_2 = cmds.frameLayout("OrderCheck",
                             label="OrderCheck",
                             bgc=[0.2, 0.4, 0.6])
    cmds.columnLayout()
    cmds.text("")
    cmds.text(label=u"オーダー変更後の確認が行えます。")

    cmds.button('exe_test', l=u'オーダー確認', h=35, w=220, c=CheckOrder)
    cmds.separator(h=15)

    cmds.setParent(tab)

    tab2_B = cmds.frameLayout("Plot", label=u"Plot処理", bgc=[0.9, 0.1, 0.1])
    cmds.columnLayout()
    cmds.separator(h=15)
    cmds.button('remove', l=u'オーダーを元にもどす', h=60, w=220, c=Bake_BeforeOrder)
    cmds.separator(h=15)
    cmds.button('order_sel', l=u'オーダー変えたやつを選択', h=60, w=220, c=ChangeSelect)

    cmds.tabLayout(tab,
                   edit=True,
                   tabLabel=((tab1_B, u'オーダー変更'), (tab2_B, u"プロット")))
    if Chcek_BakeAll != []:
        if Chcek_BakeAll == True:
            cmds.checkBox("FrameLock", e=True, value=True)
    cmds.showWindow(Window)
コード例 #57
0
    def __init__(self, margin=5, padding=5):
        self.loadReferencesOnOpen = False
        self.items = {}

        self.layout = cmds.formLayout()
        self.menu = cmds.menuBarLayout()
        cmds.menu(label='File')
        cmds.menuItem(label='Load References On Open',
                      checkBox=False,
                      c=self.setloadReferencesOnOpen)
        cmds.menuItem(divider=True)
        cmds.menuItem(label='Open', c=self.open)

        cmds.menu(label='References')
        cmds.menuItem(label='Load All', c=self.loadAllReferences)
        cmds.menuItem(label='Unload All', c=self.unloadAllReferences)

        cmds.menu(label='Visibility')
        cmds.menuItem(label='Show All', c=lambda *x: self.toggleAssembly(True))
        cmds.menuItem(label='Hide All',
                      c=lambda *x: self.toggleAssembly(False))
        # cmds.menu(label='Extras', enable=False)
        # cmds.menuItem(label='Show All')
        # cmds.menuItem(label='Hide All')

        cmds.menu(label='UI')
        cmds.menuItem(label='Refresh', c=self.load)

        cmds.menu(label='Help', helpMenu=True)
        cmds.menuItem(label='Print Debug Info', c=self.debugInfo)

        cmds.setParent('..')

        self.ui = cmds.treeView(parent=self.layout,
                                numberOfButtons=3,
                                abr=False,
                                adr=False,
                                ams=False,
                                idc=self.doubleClickCallback,
                                dc2=self.doubleClickCallback,
                                pc=[
                                    [1, self.loadReferenceCallback],
                                    [2, self.setVisibleCallback],
                                    [3, self.selectControlsCallback],
                                ])
        cmds.setParent('..')

        cmds.formLayout(self.layout,
                        e=True,
                        attachForm=(self.menu, 'top', padding))
        cmds.formLayout(self.layout,
                        e=True,
                        attachForm=(self.menu, 'left', padding))
        cmds.formLayout(self.layout,
                        e=True,
                        attachForm=(self.menu, 'right', padding))
        cmds.formLayout(self.layout,
                        e=True,
                        attachControl=(self.ui, 'top', margin, self.menu))
        cmds.formLayout(self.layout,
                        e=True,
                        attachForm=(self.ui, 'bottom', padding))
        cmds.formLayout(self.layout,
                        e=True,
                        attachForm=(self.ui, 'left', padding))
        cmds.formLayout(self.layout,
                        e=True,
                        attachForm=(self.ui, 'right', padding))

        cmds.treeView(self.ui,
                      edit=True,
                      selectCommand=self.selectTreeCallBack)
        self.load()

        # ScriptJobs
        cmds.scriptJob(p=self.ui, event=['PostSceneRead', self.load])
コード例 #58
0
    def buildUI(self):
        if cmds.dockControl("characterPicker_dockControl", exists=True):
            cmds.deleteUI("characterPicker_dockControl")

        self.widgets["window"] = cmds.window(title="Character Picker",
                                             w=400,
                                             h=600,
                                             mnb=False,
                                             mxb=False)
        self.widgets["mainLayout"] = cmds.columnLayout(w=400, h=600)
        self.widgets["menuBarLayout"] = cmds.menuBarLayout()
        self.widgets["helpMenu"] = cmds.menu(label="Help", helpMenu=True)
        cmds.menuItem(label="Help", c=self.help)
        cmds.menuItem(label="About", c=self.aboutWindow)

        self.widgets["activeCharacter"] = cmds.optionMenu(
            label="Active Character: ", w=400)
        for name in self.namespaces:
            cmds.menuItem(label=name, parent=self.widgets["activeCharacter"])
        self.widgets["formLayout"] = cmds.formLayout(w=400, h=600)

        # create the buttons
        self.widgets["headButton"] = cmds.button(label="",
                                                 w=40,
                                                 h=40,
                                                 bgc=[0, 0.593, 1])
        cmds.button(self.widgets["headButton"],
                    edit=True,
                    c=partial(self.selectControls, ["head"],
                              [(self.widgets["headButton"], [0, 0.593, 1])]))

        self.widgets["spine03Button"] = cmds.button(label="",
                                                    w=100,
                                                    h=40,
                                                    bgc=[0.824, 0.522, 0.275])
        cmds.button(self.widgets["spine03Button"],
                    edit=True,
                    c=partial(self.selectControls, ["spine_03"], [
                        (self.widgets["spine03Button"], [0.824, 0.522, 0.275])
                    ]))

        self.widgets["spine02Button"] = cmds.button(label="",
                                                    w=100,
                                                    h=40,
                                                    bgc=[0.824, 0.522, 0.275])
        cmds.button(self.widgets["spine02Button"],
                    edit=True,
                    c=partial(self.selectControls, ["spine_02"], [
                        (self.widgets["spine02Button"], [0.824, 0.522, 0.275])
                    ]))

        self.widgets["spine01Button"] = cmds.button(label="",
                                                    w=100,
                                                    h=40,
                                                    bgc=[0.824, 0.522, 0.275])
        cmds.button(self.widgets["spine01Button"],
                    edit=True,
                    c=partial(self.selectControls, ["spine_01"], [
                        (self.widgets["spine01Button"], [0.824, 0.522, 0.275])
                    ]))

        self.widgets["selectAllSpineButton"] = cmds.button(label="",
                                                           w=30,
                                                           h=30,
                                                           bgc=[0, 1, 0])
        cmds.button(
            self.widgets["selectAllSpineButton"],
            edit=True,
            c=partial(
                self.selectControls, ["spine_01", "spine_02", "spine_03"],
                [(self.widgets["spine01Button"], [0.824, 0.522, 0.275]),
                 (self.widgets["spine02Button"], [0.824, 0.522, 0.275]),
                 (self.widgets["spine03Button"], [0.824, 0.522, 0.275])]))

        # place the buttons
        cmds.formLayout(self.widgets["formLayout"],
                        edit=True,
                        af=[(self.widgets["headButton"], "left", 175),
                            (self.widgets["headButton"], "top", 100)])
        cmds.formLayout(self.widgets["formLayout"],
                        edit=True,
                        af=[(self.widgets["spine03Button"], "left", 145),
                            (self.widgets["spine03Button"], "top", 150)])
        cmds.formLayout(self.widgets["formLayout"],
                        edit=True,
                        af=[(self.widgets["spine02Button"], "left", 145),
                            (self.widgets["spine02Button"], "top", 200)])
        cmds.formLayout(self.widgets["formLayout"],
                        edit=True,
                        af=[(self.widgets["spine01Button"], "left", 145),
                            (self.widgets["spine01Button"], "top", 250)])
        cmds.formLayout(self.widgets["formLayout"],
                        edit=True,
                        af=[(self.widgets["selectAllSpineButton"], "left",
                             250),
                            (self.widgets["selectAllSpineButton"], "top", 205)
                            ])

        # cmds.showWindow(self.widgets["window"])
        cmds.dockControl("characterPicker_dockControl",
                         label="Character Picker",
                         area="right",
                         allowedArea="right",
                         content=self.widgets["window"])
コード例 #59
0
def addAudioMenu(parent=None, rootMenu='redNineTraxRoot'):
    '''
    Red9 Sound Menu setup
    '''
    print 'AudioMenu: given parent : ', parent
    if not parent:
        cmds.menu(rootMenu,
                  l=LANGUAGE_MAP._MainMenus_.sound_red9_sound,
                  tearOff=True,
                  allowOptionBoxes=True)
        print 'New r9Sound Menu added - no specific parent given so adding to whatever menu is currently being built!'
    else:
        # parent is a window containing a menuBar?
        if cmds.window(parent, exists=True):
            if not cmds.window(parent, q=True, menuBar=True):
                raise StandardError(
                    'given parent for Red9 Sound Menu has no menuBarlayout %s'
                    % parent)
            else:
                cmds.menu(rootMenu,
                          l=LANGUAGE_MAP._MainMenus_.sound_red9_sound,
                          p=parent,
                          tearOff=True,
                          allowOptionBoxes=True)
                log.info(
                    'New Red9 Sound Menu added to current windows menuBar : %s'
                    % parent)
        # parent is a menuBar?
        elif cmds.menuBarLayout(parent, exists=True):
            cmds.menu(rootMenu,
                      l=LANGUAGE_MAP._MainMenus_.sound_red9_sound,
                      p=parent,
                      tearOff=True,
                      allowOptionBoxes=True)
            log.info(
                'New Red9 Sound Menu added to current windows menuBar : %s' %
                parent)
        # parent is a menu already?
        elif cmds.menu(parent, exists=True):
            cmds.menuItem(rootMenu,
                          l=LANGUAGE_MAP._MainMenus_.sound_red9_sound,
                          sm=True,
                          p=parent,
                          allowOptionBoxes=True)
            log.info('New Red9 Sound subMenu added to current Menu : %s' %
                     parent)
        else:
            raise StandardError(
                'given parent for Red9 Sound Menu is invalid %s' % parent)

#    if not parent:
#        print 'new r9Sound Menu added'
#        cmds.menu(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, tearOff=True, allowOptionBoxes=True)
#    else:
#        print 'new r9Sound Menu added to parent menu', parent
#        cmds.menu(rootMenu, l=LANGUAGE_MAP._MainMenus_.sound_red9_sound, tearOff=True, allowOptionBoxes=True, parent=parent)

    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_offset_manager,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_offset_manager_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioToolsWrap().show()"
    )
    cmds.menuItem(d=True)
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_activate_selected_audio,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_activate_selected_audio_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().setActive()"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_set_timeline_to_selected,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_set_timeline_to_selected_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().setTimelineToAudio()"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_focus_on_selected,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_focus_on_selected_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().setTimelineToAudio();r9Audio.AudioHandler().setActive()"
    )
    cmds.menuItem(d=True)
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_mute_selected,
        p=rootMenu,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().muteSelected(True)"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_unmute_selected,
        p=rootMenu,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().muteSelected(False)"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_lock_selected,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_lock_selected_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().lockTimeInputs(True)"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_unlock_selected,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_unlock_selected_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().lockTimeInputs(False)"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_delete_selected,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_delete_selected_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().deleteSelected()"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_format_soundnode_name,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_format_soundnode_name_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioHandler().formatNodes_to_Path()"
    )
    cmds.menuItem(d=True)
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_combine_audio,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_combine_audio_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.combineAudio()")
    cmds.menuItem(d=True)
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_open_audio_path,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_open_audio_path_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.AudioNode().openAudioPath()"
    )
    cmds.menuItem(
        l=LANGUAGE_MAP._MainMenus_.sound_inspect_wav,
        p=rootMenu,
        ann=LANGUAGE_MAP._MainMenus_.sound_inspect_wav_ann,
        c="import Red9.core.Red9_Audio as r9Audio;r9Audio.inspect_wav()")
コード例 #60
0
ファイル: SavePose.py プロジェクト: Takeda-GitHub/Maya_Python
    def MenuMake(self, *args):
        Pose_window = "SavePose"
        WindowWidth_Size = 300
        WindowHight_Size = 140

        if cmds.window(Pose_window, exists=True):
            cmds.deleteUI(Pose_window, window=True)
        MakeWindow = cmds.window(Pose_window,
                                 title=Pose_window,
                                 sizeable=False,
                                 mxb=False,
                                 wh=[WindowWidth_Size, WindowHight_Size])

        #Helpの為にメインメニューバーを追加します
        cmds.menuBarLayout()
        cmds.menu(label=u"Menu", tearOff=False)
        cmds.menuItem(label=Pose_window + u"の解説", c=self.HelpWindow_Page)
        cmds.setParent("..")

        #複数フレーム対応の為、タブを生成
        cmds.columnLayout(w=WindowWidth_Size + 3)
        tab = cmds.tabLayout(w=WindowWidth_Size)

        #続けてボタンなど配置
        tab1_B = cmds.columnLayout(w=WindowWidth_Size)
        cmds.rowLayout(numberOfColumns=2)
        self.radioB = cmds.radioCollection()
        self.radio = cmds.radioButton(label="システム")
        RadioB2 = cmds.radioButton(label="ユーザー")
        cmds.setParent('..')

        cmds.separator(w=WindowWidth_Size)

        cmds.rowColumnLayout(numberOfColumns=4,
                             columnWidth=[(1, 15), (2, 120), (3, 15),
                                          (4, 120)])
        cmds.text(l='')
        cmds.button(l=u'セーブ', c=partial(self.savepose_cmd, 0))
        cmds.text(l='')
        cmds.button(l=u'ロード', c=self.RoadPove_cmd)
        cmds.setParent('..')

        cmds.separator(w=WindowWidth_Size)
        cmds.rowColumnLayout(numberOfColumns=2,
                             columnWidth=[(1, 150), (2, 120)])
        cmds.text(l='')
        cmds.button(l=u'システムフォルダを開く', c=self.folderOpen)

        cmds.setParent(tab)
        tab2_B = cmds.columnLayout(w=WindowWidth_Size)
        cmds.rowColumnLayout(numberOfColumns=4,
                             columnWidth=[(1, 5), (2, 150), (3, 8), (4, 100)])
        cmds.text(l='')
        cmds.text(l=u'フレーム【カンマで区切って入力】')
        cmds.text(l='')

        self.TextValue = cmds.textField()
        cmds.textField(self.TextValue, edit=True, text="0,100")

        cmds.setParent('..')

        cmds.separator(w=WindowWidth_Size)
        cmds.rowColumnLayout(numberOfColumns=2,
                             columnWidth=([1, 65], [2, 150]))
        cmds.text(l='')
        cmds.button(l=u'セーブ', c=partial(self.savepose_cmd, 1))
        cmds.setParent('..')

        cmds.separator(w=WindowWidth_Size)
        cmds.rowColumnLayout(numberOfColumns=2,
                             columnWidth=[(1, 65), (2, 150)])
        cmds.text(l='')
        cmds.button(l=u'システムフォルダを開く', c=self.folderOpen)
        #各所設定
        cmds.radioCollection(self.radioB, e=True, select=self.radio)
        cmds.tabLayout(tab,
                       edit=True,
                       tabLabel=((tab1_B, u'フレーム'), (tab2_B, u"連番")))

        cmds.showWindow(MakeWindow)