def __init__(self):
        if cmds.window('renderSceneGenerator', exists=True): cmds.deleteUI('renderSceneGenerator', wnd=True)

        cmds.window('renderSceneGenerator', t='Render Scene Generator', s=False)
        cmas = cmds.columnLayout(adj=True)

        f1 = cmds.frameLayout(l='Scene Browse', w=200)
        cmds.columnLayout(adj=True)
        cmds.text(l='Episode Name:', al='left', fn='boldLabelFont', w=200)
        cmds.textScrollList('episodeName', w=200, h=80, sc=self.episodeChange)
        cmds.text(l='Sequence Name:', al='left', fn='boldLabelFont')
        cmds.textScrollList('sequenceName', w=200, h=80, en=False, sc=self.sequenceChange)

        f2 = cmds.frameLayout(l='Exported MCC Data', p=cmas)
        cmds.columnLayout(adj=True)
        cmds.textScrollList('serverMccData2',w=200, h=100, ams=True, en=False)

        f3 = cmds.frameLayout(l='Camera', p=cmas)
        cmds.columnLayout(adj=True)
        cmds.checkBox('includeCamera', l='Include Scene Camera', v=0)

        cmds.separator(p=cmas)
        cmds.button(l='GENERATE WITH ALL MCC', p=cmas, bgc=[1.0,0.643835616566,0.0], h=40,\
                    c=self.mccProcessAll)
        cmds.button(l='GENERATE WITH SELECTED MCC', p=cmas, c=self.mccProcessSingle)
        cmds.button(l='REFRESH', p=cmas, c=self.refresh)

        cmds.showWindow()

        #populate episode
        for item in os.listdir(SEQUENCE_ROOT+'/'+PRJ_NAME+'/EPISODES'):
            cmds.textScrollList('episodeName', e=True, a=item)
        return
Esempio n. 2
0
    def _reloadUI(self, frame):

        flg = logging.getLogger("lettuce._reloadUI")

        mc.deleteUI(frame)
        flg.info("Deleting UI: {}".format(frame))

        mc.frameLayout('masterFrame',
                       parent=self.uiWindow,
                       label='',
                       width=400,
                       labelVisible=False,
                       marginWidth=0
                       )

        if self.xml_load_state:
            flg.info("XML File Loaded")
            self.char_in_scene_list = self._get_characters(self.char_xml_file)

            if len(self.char_in_scene_list) > 0:
                self.char_in_scene = True
                flg.info("Characters verified in Scene")
            else:
                self.char_in_scene = False
                flg.info("Characters verified not in scene")

        if self.char_in_scene:
            flg.info("Creating Character Menus")
            self._create_character_frame(self.char_in_scene_list, "masterFrame")
        else:
            flg.info("Added reload button ")
            mc.button('reloadButton',
                      label="Reload",
                      command=lambda *_: self._reloadUI("masterFrame")
                      )
Esempio n. 3
0
    def __init__(self):
        winName = "Size set"
        global typeMenu
        winTitle = winName
        if cmds.window(winName, exists=True):
                cmds.deleteUI(winName)

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

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

        cmds.frameLayout('LrRow', label='', lv=0, nch=1, borderStyle='out', bv=1, p='selectArrayRow')
        
        cmds.rowLayout  (' rMainRow ', w=300, numberOfColumns=6, p='selectArrayRow')
        cmds.columnLayout ('selectArrayColumn', parent = 'rMainRow')
        cmds.setParent ('selectArrayColumn')
        cmds.separator(h=10, p='selectArrayColumn')
        cmds.gridLayout('listBuildButtonLayout', p='selectArrayColumn', numberOfColumns=2, cellWidthHeight=(100, 20))
        typeMenu=cmds.optionMenu( label='ctrl size')
        cmds.menuItem( label="Large" )
        cmds.menuItem( label="Med" )
        cmds.menuItem( label="Small" )           
        cmds.button (label='Change Selection', p='listBuildButtonLayout', command = lambda *args:self.controllerSize())
        cmds.showWindow(window)    
Esempio n. 4
0
    def create(self, *args ):

        pWidth = cmds.window( self.pWinName, q=1, width=1  )
        pHeight= cmds.window( self.pWinName, q=1, height=1 )

        top, left = cmds.window( self.pWinName, q=1, tlc=1 )

        self.top  = top  + pHeight*0.5 - self.height*0.5
        self.left = left + pWidth*0.5 - self.width*0.5

        if cmds.window( self.winName, ex=1 ):
            cmds.deleteUI( self.winName )
        cmds.window( self.winName, title=self.title )
        column = cmds.columnLayout()

        makeCategoryFrame = cmds.frameLayout( lv=0, bs='etchedIn' )
        cmds.setParent( '..' )
        currentCategoryFrame = cmds.frameLayout( lv=0, bs='etchedIn' )
        cmds.setParent( '..' )

        self.makeCategoryInst = UI_makeANewCategory( makeCategoryFrame, self.width-2, self.cmdLoadCategory )
        self.currentCategoryInst = UI_currentCategory( currentCategoryFrame, self.width-2 )

        self.makeCategoryInst.cmdCreateMakeDefaultButton()
        self.currentCategoryInst.cmdLoadCategoryList()
        
        cmds.setParent( column )
        cmds.rowColumnLayout( nc=1, cw=(1,self.width-2))
        cmds.button( l='UPDATE APP', c=self.cmdUpdateApp )
        
        cmds.showWindow( self.winName )
        cmds.window( self.winName, e=1,
                     width=self.width, height=self.height,
                     tlc=[self.top, self.left] )
def stabilizer ():
	global _camera_
	_point = cmds.ls (selection = True)
	
	if cmds.objExists ('stabilizator_expression') == False and len(_point) > 0:
		_camera_	= Camera()
		_point		= _point[0]

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

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

	else:
		if cmds.objExists ('stabilizator_expression') == True:
			cmds.delete ('stabilizator_expression')
		
		cmds.symbolButton	('button_stabilizer', edit = True, image = 'ford_matchMoveUtilities__stabilize.xpm', annotation = 'deStabilizer')
		cmds.frameLayout	('adjustCam_frml', edit = True, collapse = True, visible = False)
		
		try:
			_camera_.reset_camera()
		except:
			pass
Esempio n. 6
0
	def ui(self) : 
		if mc.window(self.win, exists = True) : 
			mc.deleteUI(self.win)
		mc.window('ConstraintHelperWin', t = 'Constraint Finder')
		mc.columnLayout(adj = 1, rs = 4)

		mc.frameLayout(borderStyle = 'etchedIn', l = 'Constraint List')
		mc.rowColumnLayout(nc = 3, cw = ([1, 150], [2, 150], [3, 150]), cs = ([2, 4], [3, 4]))

		mc.text(l = 'Object Lists')
		mc.text(l = 'Constraint Nodes')
		mc.text(l = 'Target Lists')

		mc.textScrollList('objTSL', numberOfRows = 12, sc = partial(self.listConstraintNodes))
		mc.textScrollList('constraintListTSL', numberOfRows = 12, sc = partial(self.listTargets))
		mc.textScrollList('targetListTSL', numberOfRows = 12)

		mc.setParent('..')
		mc.setParent('..')

		mc.columnLayout(adj = 1, rs = 2)

		mc.button(l = 'Add to List', h = 30, c = partial(self.loadConstraintObject))
		mc.button(l = 'Break Constraint', h = 30, c = partial(self.breakConstraint))
		mc.button(l = 'Restore Constraint', h = 30, c = partial(self.restoreConstraint))
		mc.button(l = 'Remove from List', h = 30, c = partial(self.clearData))

		mc.setParent('..')

		mc.showWindow()
		mc.window('ConstraintHelperWin', e = True, wh = [464, 361])

		self.initFunction()
def csMainWindow():
	csWin = "CreateSkeleton"
	if mc.window(csWin,q=True,ex=True):
		mc.deleteUI(csWin)

	mc.window(csWin,title = "Create Skeleton")
	mc.scrollLayout(horizontalScrollBarThickness=16)
	csMainCL = mc.columnLayout(columnAttach=("both",5),rowSpacing=10,columnWidth=320)
	#GUIDES CREATION
	csFL1 = mc.frameLayout(label="Create Guides",bs="etchedOut",w=300,mw=5,cll=1,p=csMainCL)
	csCL1= mc.columnLayout(rs=5,adj=1,p=csFL1)
		#Character Name
	mc.textFieldGrp("csChName",l="Character Name",tx="")
		#Number of Fingers/Toes
	#mc.intSliderGrp("csFingersNumber",label="Number of Fingers",field=True,minValue=1,maxValue=5,fieldMinValue=1,fieldMaxValue=5,value=4,cw3=(100,30,10),dc=csSetFingersNumber)
	#mc.checkBoxGrp("csHasThumb",numberOfCheckBoxes=1, label='Thumb?')
	#mc.intSliderGrp("csToesNumber",label="Number of Toes",field=True,minValue=1,maxValue=5,fieldMinValue=1,fieldMaxValue=5,value=4,cw3=(100,30,10),dc=csSetToesNumber)
	mc.button(l="Create Guides",c=csCreateGuides)
		#Character Scale Slider
	mc.floatSliderGrp("csScaleSlider",en=0,label="Guide scale",field=True,minValue=1,maxValue=100,fieldMinValue=1,fieldMaxValue=100,value=1,cw3=(70,30,10),dc=csScaleGuides)
		#Character Mirror
	mc.rowColumnLayout(nc=2,cw=[(1,138),(2,138)],p=csCL1);
	mc.button(l="Mirror left << ",al="right",c = functools.partial(csMirrorGuide,"left"))
	mc.button(l=">> Mirror right",al="left",c = functools.partial(csMirrorGuide,"right"));
	#END GUIDES CREATION
	
	#JOINTS CREATION
	csFL2 = mc.frameLayout(label="Create Joints",bs="etchedOut",w=300,mw=5,cll=1,p=csMainCL)
	csCL2 = mc.columnLayout(rs=5,adj=1,p=csFL2)
	mc.button(l="Create Joints",c =csCreateJoints)
	#floatSliderGrp -en 0 -label "THUMB Orient" -field true	-minValue 0 -maxValue 180 -fieldMinValue 1 -fieldMaxValue 100	-value 0 -cw3 80 40 10 -dc csJointOrientX csJointXSlider;
	#END JOINTS CREATION
	
	mc.showWindow(csWin)
    def viewLogUI(self,assetSelection):
        #get log list
        logList=veRegCore.listLogTable()

        cmds.formLayout()
        cmas=cmds.columnLayout(adj=True)
        rcmas=cmds.rowColumnLayout(nc=2,cw=[(1,150),(2,300)])
        f1=cmds.frameLayout(l='Log Date',p=rcmas)
        cmds.textScrollList('logTextScroll',sc=self.populateViewLog)
        f2=cmds.frameLayout(l='Detail',p=rcmas)
        cmds.text(l='Id:',al='left',fn='boldLabelFont')
        cmds.textField('idTextField',en=False)
        cmds.text(l='User:'******'left',fn='boldLabelFont')
        cmds.textField('userTextField',en=False)
        cmds.text(l='Date:',al='left',fn='boldLabelFont')
        cmds.textField('dateTextField',en=False)
        cmds.text(l='Operation:',al='left',fn='boldLabelFont')
        cmds.textField('operationTextField',en=False)
        cmds.text(l='Detail:',al='left',fn='boldLabelFont')
        cmds.textField('descTextField',en=False)

        #populate log date
        cmds.textScrollList('logTextScroll',e=True,ra=True)
        for chk in logList:
            if chk[2]==assetSelection:cmds.textScrollList('logTextScroll',e=True,a=str(chk[0])+'_'+chk[5])
        return
Esempio n. 9
0
def bdMainWindow():
	bdWin = "CreateSkeleton"
	if cmds.window(bdWin,q=True,ex=True):
		cmds.deleteUI(bdWin)

	cmds.window(bdWin,title = "Create Skeleton")
	cmds.scrollLayout(horizontalScrollBarThickness=16)
	bdMainCL = cmds.columnLayout(columnAttach=("both",5),rowSpacing=10,columnWidth=320)
	#GUIDES CREATION
	bdFL1 = cmds.frameLayout(label="Template Guides",bs="etchedOut",w=300,mw=5,cll=1,p=bdMainCL)
	bdCL1= cmds.columnLayout(rs=5,adj=1,p=bdFL1)
	#Character Name
	cmds.textFieldGrp("bdChName",l="Character Name",tx="")
	#Number of Fingers/Toes
	#cmds.intSliderGrp("bdFingersNumber",label="Number of Fingers",field=True,minValue=1,maxValue=5,fieldMinValue=1,fieldMaxValue=5,value=4,cw3=(100,30,10),dc=bdSetFingersNumber)
	#cmds.checkBoxGrp("bdHasThumb",numberOfCheckBoxes=1, label='Thumb?')
	#cmds.intSliderGrp("bdToesNumber",label="Number of Toes",field=True,minValue=1,maxValue=5,fieldMinValue=1,fieldMaxValue=5,value=4,cw3=(100,30,10),dc=bdSetToesNumber)
	cmds.button(l="Import Template",c=bdImportTemplate)
	#Character Scale Slider
	cmds.floatSliderGrp("bdScaleSlider",en=0,label="Guide scale",field=True,minValue=1,maxValue=100,fieldMinValue=1,fieldMaxValue=100,value=1,cw3=(70,30,10),dc=bdScaleGuides)
	#Character Mirror
	cmds.rowColumnLayout(nc=2,cw=[(1,138),(2,138)],p=bdCL1);
	cmds.button(l="Mirror left << ",al="right",c = functools.partial(bdMirrorGuide,"left"))
	cmds.button(l=">> Mirror right",al="left",c = functools.partial(bdMirrorGuide,"right"));
	#END GUIDES CREATION
	
	#JOINTS CREATION
	bdFL2 = cmds.frameLayout(label="Create Joints",bs="etchedOut",w=300,mw=5,cll=1,p=bdMainCL)
	bdCL2 = cmds.columnLayout(rs=5,adj=1,p=bdFL2)
	cmds.button(l="Create Joints",c =bdCreateSkeleton)
	#floatSliderGrp -en 0 -label "THUMB Orient" -field true	-minValue 0 -maxValue 180 -fieldMinValue 1 -fieldMaxValue 100	-value 0 -cw3 80 40 10 -dc bdJointOrientX bdJointXSlider;
	#END JOINTS CREATION
	
	cmds.showWindow(bdWin)
def UI():
    bdWin = "FootballUtils"
    if cmds.window(bdWin,q=True,ex=True):
        cmds.deleteUI(bdWin)

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

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


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

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

    cmds.showWindow(bdWin)    
def extendUI(*args):
    """UI for the script"""
    #UI
    if cmds.window("curbWin", exists=True):
        cmds.deleteUI("curbWin")

    cmds.window("curbWin", t="zbw_polyExtender", w=200, h=200)
    cmds.columnLayout("colLO")
    cmds.frameLayout("topFrame", l="Covert Edge", cll=True, bgc=(.2,.2,.2))
    cmds.text("Select poly edge to convert")
    cmds.button("convertBut", l="Convert!", w=200, h=30, bgc=(.8, .8,.6), c=convertEdge)
    cmds.separator(h=5)

    cmds.setParent("colLO")

    cmds.frameLayout("midFrame", l="Create Poly", cll=True, bgc=(.2,.2,.2))
    cmds.text("Select curve")
    cmds.separator(h=5)
    cmds.textFieldGrp("name", l="Name", w=200, cw=[(1,30), (2,170)], tx="newPoly")
    cmds.checkBox("curbCB", l="Positive Direction", v=True)
    # cmds.checkBox("bumpCB", l="Add vertical hump?", v=True)
    cmds.floatFieldGrp("curbFFG", l="Curb Width", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=10)
    cmds.intFieldGrp("UDivIFG", l="Width Subdivisions", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=1)
    cmds.intFieldGrp("VDivIFG", l="Length Subdivisions", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=1)
    cmds.checkBox("polyHistory", l="Keep history on final poly?", v=False)
    cmds.checkBox("history", l="Keep history objects?", v=True, cc=enableHistory)

    cmds.separator(h=5)
    cmds.button("curbBut", l="Create Curb", h=40, w=200, bgc=(.6, .8, .6), c=extendPoly)

    cmds.showWindow("curbWin")
    cmds.window("curbWin", e=True, h=150, w=200)
Esempio n. 12
0
    def setEditMode(self, topJoint, endJoint, curveEdit=True ):

        self.dragOn = False

        endJoint = cmds.ls( endJoint, l=1 )[0]
        jntChildren = cmds.listRelatives( topJoint, c=1, ad=1, f=1 )
        jntChildren.append( topJoint )
        jntChildren.reverse()
        
        if not endJoint in jntChildren:
            cmds.frameLayout( WinA_Global.frame, e=1, en=0 )
            cmds.floatSliderGrp( WinA_Global.slider_joint, e=1, v=0 )
            return False
        
        index = jntChildren.index( endJoint )
        self.jntH = jntChildren[:index+1]
        self.numPoints = len( self.jntH )
        
        cmds.intField( WinA_Global.num_original, e=1, v=self.numPoints )
        cmds.floatSliderGrp( WinA_Global.slider_joint, e=1, v=0 )
        
        self.editCurveByPosition()
        self.setGlobalValue( self.getGlobalValue() )
        
        return True
Esempio n. 13
0
def UI():
    mc.frameLayout('Furioso',w=ui.rowWidth,cll=1,bgc=[.2,.2,.2],fn='smallBoldLabelFont',bs='in',l='Furioso')
    
    mc.columnLayout('furiosoObjectConform',cal='center',w=ui.rowWidth-10)
    mc.rowColumnLayout(numberOfColumns=8)
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,ann="Create 10x10 Tile",l= "Tile" ,i= "polyPlane.png",c=partial(delay,'mel.eval','("polyPlane -w 10 -h 10 -sx 10 -sy 10 -ax 0 1 0 -cuv 2 -ch 1")'))	
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,ann="Create 1x1 Tile",l= "Tile" ,i= "plane.png",c=partial(delay,'mel.eval','("polyPlane -w 10 -h 10 -sx 1 -sy 1 -ax 0 1 0 -cuv 2 -ch 1;")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "cube.png",c=partial(delay,'mel.eval','("polyCube -w 10 -h 10 -d 10 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "historyPulldownIcon.png",bgc=[.5,0,0],c=partial(delay,'mel.eval','("DeleteHistory")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "",en=0,c=partial(delay,'mel.eval','("polyPlane -w 10 -h 10 -sx 1 -sy 1 -ax 0 1 0 -cuv 2 -ch 1;")'))  
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,ann="Set Camera to Meters",en=1,l= "Set Camera" ,i= "CameraAE.png",c=partial(delay,'mel.eval','("rcSetCameraClip .5 100000")'))
    mc.iconTextButton(w=ui.iconSize,h=ui.iconSize,i= "polyQuad",c=partial(delay,'mel.eval','("TogglePolyCount")'))
    mc.iconTextCheckBox(w=ui.iconSize,h=ui.iconSize,ann="Snap",l= "Tile" ,i= "snapGrid.png",onc=partial(delay,'rc.stepSnap','(5,1)'),ofc=partial(delay,'rc.stepSnap','(5,0)'),v=mc.manipMoveContext('Move',q=1,s=1))    
    mc.setParent('..')

    mc.rowLayout(w=ui.rowWidth,numberOfColumns=3)
    mc.button(w=ui.rowWidth/3,h=ui.btn_large,al='left',l=' + ',c=partial(delay,'btnPlus','(mc.ls(sl=1))'))  #
    mc.button(h=ui.btn_large,w=ui.rowWidth/3,al='center',l=' - ',c=partial(delay,'btnDel','("sel")')) 
    mc.button(h=ui.btn_large,w=ui.rowWidth/3,al='right',l='NUKE',c=partial(delay,'btnDel','("all")'))
    mc.setParent('..')
    
    mc.checkBox('Object',vis=0,l='Object',v=int(furiosoPrefs.get('Object')),cc=partial(delay,'furiosoPrefs.checkBox',"('Object')"))
    mc.checkBox('Material',l='Material',vis=1,v=int(furiosoPrefs.get('Material')),cc=partial(delay,'furiosoPrefs.checkBox',"('Material')"))
    mc.checkBox('Flag',l='Flag',vis=0,v=int(furiosoPrefs.get('Flag')),cc=partial(delay,'furiosoPrefs.checkBox',"('Flag')"))
    mc.iconTextScrollList('FuriosoObjScroll',w=ui.rowWidth,h=500)
    mc.setParent('furiosoObjectConform')
    mc.setParent('..')
    
    buildUILists()
Esempio n. 14
0
    def create_ui(self):
        tab = str(cmds.columnLayout())
        cmds.separator(style="none")
        cmds.frameLayout(collapsable=True, label="Common")
        cmds.columnLayout()
        cmds.button(command=lambda *args: mel.abAutoRig(), label="AB Auto Rig", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.rbSetLocalPivot(), label="Set Geo Pivot To Sel",
                    backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.joint_at_pivot(), label="Joint at Pivot", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.JointTool(), label="Joint Tool", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.rbZeroTransformer("_zero"), label="Zero Out Joint",
                    backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.IKHandleTool(), label="IK Handle Tool", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.scMoveJntsModeOnOff(1), label="Move Joints On", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.scMoveJntsModeOnOff(0), label="Move Joints Off",
                    backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.rb_ShapesWindow(), label="Controller Shapes", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.wp_shapeParent(), label="Parent Shape", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.ArtPaintSkinWeightsTool(), label="Maya Paint Skin Weights",
                    backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.paintSkinWeights(), label="Vertex Paint Skin Weights",
                    backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.cometSaveWeights(), label="-Comet- Save Skin Weights",
                    backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.objectColorPalette(), label="Wireframe Colour", backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.lockNonKeyable_all(), label="Lock and make Non-keyable (Selected)",
                    backgroundColor=bg_colour)
        cmds.button(command=lambda *args: mel.NodeEditorWindow(), label="Node Editor", backgroundColor=bg_colour)
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        return tab, "Rig"
Esempio n. 15
0
def process():
    '''
        Brings up the Dome Light Rig UI.
    '''

    dlWin = "domeLightWin"

    if cmds.window(dlWin, exists=True):
        cmds.deleteUI(dlWin)
    if cmds.windowPref(dlWin, exists=True):
        cmds.windowPref(dlWin, remove=True)

    winWidth = 425
    winHeight = 485

    cmds.window(dlWin, width=winWidth, height=winHeight, sizeable=False, menuBar=True, 
        title="Dome Light Rig")

    cmds.menu(label="Help")
    cmds.menuItem(label="About...", 
        command="from project import domeLight; domeLight.aboutWin()")

    cmds.frameLayout(borderVisible=1, borderStyle="etchedIn", labelVisible=0)
    mainForm = cmds.formLayout("mainForm")

    _buildControls( dlWin )
    _positionControls( dlWin, mainForm )

    cmds.window(dlWin, edit=True, width=winWidth, height=winHeight)

    cmds.showWindow(dlWin)
Esempio n. 16
0
def snapper():
    '''
        Builds the interface and pulls the values into the window
        Get the values of the one object into the window
    '''
    #check to see if the UI exists
    if cmds.window("snapperUI", exists=True):
        cmds.deleteUI("snapperUI")

    #create the window
    wSnapper = cmds.window("snapperUI", title = "Snapper", width=350, height=300, sizeable=False, toolbox=1)
    cmds.columnLayout()
    #cmds.frameLayout( label='CLICK to set')
    cmds.rowColumnLayout( numberOfColumns=4, columnWidth=[(1, 80), (2, 90), (3,90), (4,90)], height=60 )
    cmds.button( label='translate', command=setTrans, height=30)
    trX = cmds.textField("transXVal", editable=False, text=globalTransX, backgroundColor=(1,0.7,0.7))
    trY = cmds.textField("transYVal", editable=False, text=globalTransY, backgroundColor=(0.6,1,0.6))
    trZ = cmds.textField("transZVal", editable=False, text=globalTransZ, backgroundColor=(0.7,0.7,1))
    '''
    trX = cmds.textField("transXVal", editable=False, text='0')
    trY = cmds.textField("transYVal", editable=False, text='0')
    trZ = cmds.textField("transZVal", editable=False, text='0')
    '''
    cmds.button( label='rotate', command=setRot, height=30)
    rtX = cmds.textField("rotXVal", editable=False, text=globalRotX, backgroundColor=(1,0.6,0.6))
    rtY = cmds.textField("rotYVal", editable=False, text=globalRotY, backgroundColor=(0.7,1,0.7))
    rtZ = cmds.textField("rotZVal", editable=False, text=globalRotZ, backgroundColor=(0.6,0.6,1))
    cmds.setParent( '..' )
    cmds.setParent( '..' )
    cmds.frameLayout( labelVisible=False )
    cmds.button( label='Copy All', command=getWorldValues, width=350, height=40)
    cmds.setParent( '..' )
    cmds.setParent( '..' )
    #show the window
    cmds.showWindow(wSnapper)
Esempio n. 17
0
 def setAllFollow( self, *args ):
     headChildrenLay = cmds.frameLayout( self.headFollow, q=1, ca=1 )
     collarChildrenLay = cmds.frameLayout( self.collarFollow, q=1, ca=1 )
     armChildrenLay = cmds.frameLayout( self.armFollow, q=1, ca=1 )
     legChildrenLay = cmds.frameLayout( self.legFollow, q=1, ca=1 )
     
     for head in headChildrenLay:
         followName = cmds.checkBox( head, q=1, l=1 )
         if cmds.checkBox( head, q=1, v=1 ):
             self.followAttrVis( ['Head_CTL'], followName.lower()+'Follow', True )
     
     for collar in collarChildrenLay:
         followName = cmds.checkBox( collar, q=1, l=1 )
         if cmds.checkBox( collar, q=1, v=1 ):
             self.followAttrVis( ['Collar_L_CTL','Collar_R_CTL'], followName.lower()+'Follow', True )
             
     for arm in armChildrenLay:
         followName = cmds.checkBox( arm, q=1, l=1 )
         if cmds.checkBox( arm, e=1, v=1 ):
             self.followAttrVis( ['Arm_L_Switch_CTL','Arm_R_Switch_CTL'], followName.lower()+'Follow', True )
             
     for leg in legChildrenLay:
         followName = cmds.checkBox( leg, q=1, l=1 )
         if cmds.checkBox( leg, e=1, v=1 ):
             self.followAttrVis( ['Leg_L_Switch_CTL','Leg_R_Switch_CTL'], followName.lower()+'Follow', True )
Esempio n. 18
0
def showUI():
    win = 'lsWireOffset_window'
    
    # if window exists, delete
    if mc.window(win, ex=True):
        mc.deleteUI(win, wnd=True)
        
    # delete window prefs... if you want...
    mc.windowPref(win, remove=True)
    
    # create window
    mc.window(win, t='lsWireOffset v0.1', wh=(200,335), mxb=False)
    
    # main column
    mainCol = mc.columnLayout(columnAttach=('both', 5), rowSpacing=10, columnWidth=200)
    
    # creation frame
    createFrm = mc.frameLayout(p=mainCol, cl=False, l='Create New Module')
    createCol = mc.columnLayout(columnAttach=('both', 5), rowSpacing=5, columnWidth=188)
    nameTxtFld = mc.textFieldGrp( label='Name: ', text='', cw2=(40,125), p=createCol)
    mc.text(l='Select edge loop OR \n vertices and...')
    creationBtn = mc.button(l='Create', c="lsWireOffset.ui.createNew('%s')"%nameTxtFld)
    
    # edit frame
    editFrm = mc.frameLayout(p=mainCol, cl=False, l='Edit Existing Modules')
    editCol = mc.columnLayout(columnAttach=('both', 5), rowSpacing=5, columnWidth=188)
    scrollList = mc.textScrollList(win+'_wTSL')
    
    refreshTSL(scrollList)
    
    # popop menu for right click
    mc.popupMenu(win+'_wTSL_MM', p=scrollList, mm=True, button=3, pmc=buildMM)
    
    mc.showWindow(win)
Esempio n. 19
0
	def create(self):
		if cmds.window('uvShellAlignWindow', exists = True):
			cmds.deleteUI('uvShellAlignWindow')

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

				




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

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

		cmds.setParent("..")	
		cmds.showWindow()
Esempio n. 20
0
 def create(self):
     
     try:frame = cmds.frameLayout( l='Follow Area', bgs=1, bgc=[0.2,0.2,.4] )
     except:frame = cmds.frameLayout( l='Follow Area', bgc=[0.2,0.2,.4] )
     form = cmds.formLayout()
     text  = cmds.text( l='Select Ik And Set' )
     root  = cmds.checkBox( l='Root', v=1 )
     fly   = cmds.checkBox( l='Fly', v=1 )
     move  = cmds.checkBox( l='Move', v=1 )
     world = cmds.checkBox( l='World', v=1 )
     btSet = cmds.button( l='Set', c= Win_Cmd.addFollow )
     cmds.setParent( '..' )
     cmds.setParent( '..' )
     
     cmds.formLayout( form, e=1,
                      af=[ ( text, 'left', 0 ), ( text, 'right', 0 ), ( text, 'top', 0 ),
                           ( root, 'left', 0 ), ( world, 'right', 0 ),
                           ( btSet, 'left', 0 ), ( btSet, 'right', 0 ) ],
                      ac=[ ( root, 'top', 5, text ), ( fly, 'top', 5, text ), ( move, 'top', 5, text ), ( world, 'top', 5, text ),
                           ( btSet, 'top', 5, move ) ],
                      ap=[ ( root, 'right', 0, 25 ), 
                           ( fly, 'left', 0, 25 ), ( fly, 'right', 0, 50 ),
                           ( move, 'left', 0, 50 ), ( move, 'right', 0, 75 ),
                           ( world, 'left', 0, 75 ) ] )
     
     Win_Global.rootfollow = root
     Win_Global.flyfollow = fly
     Win_Global.movefollow = move
     Win_Global.worldfollow = world
     
     return frame
Esempio n. 21
0
File: mayaUI.py Progetto: gj210/upy
    def drawFrame(self,bloc,x,y):
        """
        Function to draw a block as a collapsable frame layout of the gui. 
        
        @type  block: array or dictionary
        @param block: list or dictionary of item dictionary
        @type  x: int
        @param x: position on x in the gui windows, used for blender
        @type  y: int
        @param y: position on y in the gui windows, used for blender
        
        @rtype:   int
        @return:  the new horizontal position, used for blender
        """    
        
#        cmds.scrollLayout(bloc["name"]+"_scrol",w=self.w*self.scale)
        cmds.frameLayout( label=bloc["name"], collapsable=True,
                             cl=bloc["collapse"],borderVisible=False,
                             w=self.w*self.scale*2.5)#borderStyle='in' ,
        for k,blck in enumerate(bloc["elems"]):
#            print bloc["name"],len(blck),blck
            if len(blck) == 0 :
                continue
            kw = {}
            N = len(blck)
            if N < 6 :
                kw ["columnAlign"+str(N)] = "left" if N == 1 else ["left",]*N
            cmds.rowLayout(numberOfColumns=N,w=self.w*self.scale*2.5,**kw)
            for index, item in enumerate(blck):
                self._drawElem(item,x,y)
            self.endBlock()
        self.endBlock()
#        self.endBlock()
        return y
Esempio n. 22
0
 def build(self):
     if mc.windowPref(self.win, exists=1):
         mc.windowPref(self.win, remove=1)
     if mc.window(self.win,exists=1):
         mc.deleteUI(self.win)
     mc.window( self.win, title=self.title, widthHeight=(500, 210) )
     cl1 = mc.columnLayout( columnAttach=('both', 2), rowSpacing=3, columnWidth=500, adjustableColumn = True)
     mc.radioCollection()
     self.mouth = mc.radioButton( l='user import', select=1, p=cl1 )
     self.autoR = mc.radioButton( l='auto import', p=cl1 )
     mc.separator()
     mc.frameLayout('selected')
     mc.rowLayout(numberOfColumns=3, columnWidth3=(80, 75, 150), adjustableColumn=2, columnAlign=(1, 'right'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)] )
     mc.text(l='Mode')
     mc.columnLayout()
     mc.radioCollection()
     self.prop = mc.radioButton( l='Prop', select=1 )
     self.character = mc.radioButton( l='Character' )
     mc.setParent( '..' )
     mc.setParent( '..' )
     self.numText = mc.floatFieldGrp( l='Num' )
     self.txtProp = mc.textFieldButtonGrp( label='File Path', text='', buttonLabel='Browse', cw3 = (40,400,50), adjustableColumn3 = 2, cl3 = ('left', 'center', 'right'), bc = self.browse,cc=self.getPath )
     #mc.separator()
     #self.txtCharacter = mc.textFieldButtonGrp( label='Path', text='', buttonLabel='Browse', cw3 = (40,400,50), adjustableColumn3 = 2, cl3 = ('left', 'center', 'right'), bc = self.browse,cc=self.getPath )
     #mc.separator()
     mc.separator(p=cl1)
     mc.button( 'importR', l='Import   Reference   File', p=cl1 )
     mc.setParent( '..' )
Esempio n. 23
0
    def installCopyRightInfo(self):
        """"""
        cmds.frameLayout(lv=False, bs='etchedIn', mh=6, mw=6, w=1)
        cmds.text(l="Soft Cluster EX", fn='boldLabelFont', align='center')
        cmds.rowColumnLayout( numberOfColumns=2,
                             rowSpacing=[1, 8],
                             columnAttach=[1, "right", 5], 
                             columnAlign=[1, "right"])

        cmds.text(l="Version: ", fn='boldLabelFont')
        cmds.text(l=setup.getVersion(), align='left')

        cmds.text(l="Author: ", fn='boldLabelFont')
        cmds.text(l="Webber Huang", align='left')
        
        cmds.text(l="Contact: ", fn='boldLabelFont')
        cmds.text(l="*****@*****.**", align='left')
        
        cmds.text(l="Project Site: ", fn='boldLabelFont')
        cmds.iconTextButton( style='textOnly',
                             l='http://riggingtd.com/downloads/soft-cluster-ex',
                             ann="Click to open in brower.", 
                             c = lambda *args: setup.openBlog() )
        
        cmds.setParent( ".." )
        cmds.setParent( ".." )
Esempio n. 24
0
def secondaryUI():
    sec_UIname = 'secondary'
    if cmds.window(sec_UIname,exists = True):
        cmds.deleteUI(sec_UIname)
    cmds.window(sec_UIname,title = 'rosa_secondary')
    clmLot = cmds.columnLayout( adjustableColumn=True)
    cmds.textField('ctrl_name',text = 'ctrl_name')
    cmds.button('createctrl',label = 'create ctrl',h = 30,c = 'ctrl()')
    cmds.button('load_model',label = 'load "org" model',c = 'load_org()')
    cmds.textField('org_model',text = '"org" model')
    cmds.button('load_property_obj',label = 'loading property add object',c = 'load_vis()')
    cmds.textField('vis',text = 'Visibility')
    #
    flLot = cmds.flowLayout(columnSpacing = 6)
    cmds.text(label = 'ctrl axial:')
    cmds.radioCollection()
    cmds.radioButton('follic',label = 'follic',select = 0)
    cmds.radioButton('Custom',label = 'Custom',select = 1)
    #
    cmds.setParent( clmLot)
    cmds.button(label = 'Generate',c = 'secondary_add()')
    cmds.button('add_ctrl',label = 'add controller',c = 'add_controller()')
    cmds.button('Add_modelSec',label = 'Add_modelSec',c = 'Add_modelSec()')
    cmds.button(label = 'inverse_connect',c =  'inverse_connect01()')
    #
    cmds.frameLayout( label='modify ctrl:',borderStyle='etchedOut')
    cmds.setParent( clmLot)
    cmds.button(label = 'loding want to modify the controller',c = 'load_ctrl()')
    cmds.textField('sec_ctrl',text = 'secondary_ctrl')
    cmds.button(label = 'modify the controller position',c = 'ctrl_modify()')
    cmds.button(label = 'complete controller modifies',c = 'modify_complete()')
    cmds.showWindow()
def gradeTotalsFrame():	
	cmds.frameLayout( label='Grade Totals', cll=True, labelAlign='center', borderStyle='etchedIn', w=480 )
	cmds.columnLayout()
	gradeFrm = cmds.formLayout()
	global gradeTotal
	global cflDeductGradeTotal
	global aanDeductGradeTotal
	global proDeductGradeTotal
	global lateGradeTotal
	global totalGradeTotal
	# Create the Output Grades and Comments to Text File button
	textOutputButton=cmds.button( label='Output Grades and Comments to Text File', align='center', command=textOutputButtonFunction )
	cmds.formLayout( gradeFrm, edit=1, attachForm=[[textOutputButton, "left", 5], [textOutputButton, "top", 5]])
	# Create the Art Grade Total label and intField
	gradeGradeField=cmds.intFieldGrp( "gradeIntField", numberOfFields=1, label='Grade Total', changeCommand=updateGradeTotal)
	cmds.formLayout( gradeFrm, edit=1, attachOppositeControl=[[gradeGradeField, "top", 35, textOutputButton], [gradeGradeField, "left", 0, textOutputButton]])
	# Create the Comp/Focal Length Deductions Grade Total label and intField
	cflDeductGradeField=cmds.intFieldGrp( "cflDeductGradeIntField", numberOfFields=1, label='Comp/Focal Len Deductions', changeCommand=updateGradeTotal)
	cmds.formLayout( gradeFrm, edit=1, attachOppositeControl=[[cflDeductGradeField, "top", 35, gradeGradeField], [cflDeductGradeField, "left", 0, gradeGradeField]])
	# Create the Antialias/Noise Deductions Grade Total label and intField
	aanDeductGradeField=cmds.intFieldGrp( "aanDeductGradeIntField", numberOfFields=1, label='Alias/Noise Deductions', changeCommand=updateGradeTotal)
	cmds.formLayout( gradeFrm, edit=1, attachOppositeControl=[[aanDeductGradeField, "top", 35, cflDeductGradeField], [aanDeductGradeField, "left", 0, cflDeductGradeField]])
	# Create the Professionalism Deductions Grade Total label and intField
	proDeductGradeField=cmds.intFieldGrp( "proDeductGradeIntField", numberOfFields=1, label='Prof Deductions', changeCommand=updateGradeTotal)
	cmds.formLayout( gradeFrm, edit=1, attachOppositeControl=[[proDeductGradeField, "top", 35, aanDeductGradeField], [proDeductGradeField, "left", 0, aanDeductGradeField]])
	# Create the Late Deductions Grade Total label and intField
	lateGradeField=cmds.intFieldGrp( "lateGradeIntField", numberOfFields=1, label='Late Deductions', changeCommand=updateGradeTotal)
	cmds.formLayout( gradeFrm, edit=1, attachOppositeControl=[[lateGradeField, "top", 35, proDeductGradeField], [lateGradeField, "left", 0, proDeductGradeField]])
	# Create the Overall Grade Total label and intField
	totalGradeField=cmds.intFieldGrp( "totalGradeIntField", numberOfFields=1, label='Grade Total')
	cmds.formLayout( gradeFrm, edit=1, attachOppositeControl=[[totalGradeField, "top", 35, lateGradeField], [totalGradeField, "left", 0, lateGradeField]])
	cmds.setParent('..')
	cmds.setParent('..')
	cmds.setParent('..')
Esempio n. 26
0
    def create(self):

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

#===================================================================================
# GUIの定義
#===================================================================================

#-----------------------------------------------------------------------------------
# 1オブジェクトからバンドポーズ情報を取得
#-----------------------------------------------------------------------------------  


        self.window = cmds.window(self.window, title = self.title, widthHeight = self.size)
        self.frameFrm1 = cmds.frameLayout(label = u"シーンのバインドポーズを取得/追加", bgc = (0.5, 0.25, 0.3), cll = False)
        
        self.getBtn = cmds.button( l = u"取得", command = self.doGetDagPose, height = 30 )    
        self.textScllist = cmds.textScrollList('bpList', ams = True, dkc = self.removeAt, dcc = self.selectAt)
   
        cmds.setParent('..')  
        cmds.setParent('..') 

        self.frameFrm2 = cmds.frameLayout(label = u"未使用のバインドポーズを削除", bgc = (0.5, 0.25, 0.3), cll = False)
        self.getBtn = cmds.button( l = u"削除", command = self.doRemoveUnusedDagPose, height = 30 )    

        cmds.setParent('..')             
        cmds.showWindow()
	def remappingWindow(self,exsitingData,importedData):
		#if (cmds.window(MainSkinUI.RemapWindowID,ex=True)):
			#cmds.deleteUI(MainSkinUI.RemapWindowID, wnd=True)
		#cmds.window(MainSkinUI.RemapWindowID,w=500,h=340,title='Influence Remapping Dialog')
		formLayout=cmds.setParent(q=True)
		cmds.formLayout(formLayout,e=True,w=500,h=340)
		mainColumnLayout = cmds.columnLayout(w=500,h=340)
		cmds.columnLayout(h=5)
		cmds.setParent('..')
		cmds.columnLayout(cat=['left',25])
		cmds.text(l='The following influences hace no corresponding influence from the imported weight\n'\
					' data. You can remap the influences or skip them',al='left', w=450,h=40)
		cmds.setParent('..')
		cmds.separator(w=500, st='in')
		formLayout = cmds.formLayout()
		exsitingInfluences = cmds.columnLayout()
		cmds.frameLayout(l='Exsiting Influences:')
		self.exsitingInfluencesBox = cmds.textScrollList(w=230,h=230)
		cmds.setParent('..')
		cmds.setParent('..')
		importedInfluences = cmds.columnLayout()
		cmds.frameLayout(l='Imported Influences:')
		self.importedInfluencesLayout = cmds.columnLayout(w=230,h=230)
		cmds.columnLayout(h=5)
		cmds.setParent('..')
		#self.importedInfluencesLayout = cmds.columnLayout(cat=['left',40])
		cmds.formLayout(formLayout,e=True,af=[(exsitingInfluences,'left',10)],ac=[(importedInfluences,'left',10,exsitingInfluences)])
		cmds.setParent(mainColumnLayout)
		cmds.columnLayout(h=5)
		cmds.setParent('..')
		cmds.columnLayout(cat=['left',150])
		cmds.button(l='Import Remapped Skin Weight', w=200, c=self.passRemappingData)
		self.setInfluenceDialog(exsitingData,importedData)
Esempio n. 28
0
    def _buildSettings(s, *args):
        """
        Load the settings page
        """
        s.page = "settings"

        s._clear()
        cmds.columnLayout(adj=True, p=s.wrapper)
        cmds.iconTextButton(
            h=30,
            ann="Click to return to your Todo list.",
            image="revealSelected.png",
            label="<- Todo",
            style="iconAndTextHorizontal",
            c=s._buildTodo)
        cmds.separator()
        cmds.text(label="Settings are unique to each Maya scene.", h=50)
        frame = cmds.frameLayout(l="Archive options:")
        # Settings module
        s.fireHook("settings.archive", settings=s._buildSettings, callback=lambda x: cmds.setParent(frame))
        cmds.setParent("..")
        cmds.frameLayout(l="Feedback:")
        cmds.iconTextButton(
            image="party.png",
            ann="Have any feedback? Good or bad. Love to hear it! :)",
            l="Leave Feedback...",
            style="iconAndTextHorizontal",
            c=lambda: universalOpen("mailto:[email protected]?subject=Todo Feedback"))  # TODO errors when no folder is chosen because of 0 index
Esempio n. 29
0
 def __init__(self,*args):
     if(cmds.window("rbbnChainBuilder",exists=True)):
         cmds.deleteUI("rbbnChainBuilder",window=True)
 	
     cmds.window("rbbnChainBuilder",title="Build Ribbon Rig v1.0", rtf=True)
     cmds.columnLayout()
     
 	self.prefixFld = cmds.textFieldGrp(label='Prefix',text='L_upLegRbbn_')	        
     self.ribbonFld = cmds.textFieldButtonGrp( label="Ribbon:", buttonLabel="Load", bc = self.loadRibbon)#,text='main_plane'  )
     self.startFld = cmds.textFieldButtonGrp( label="Start Control:", buttonLabel="Load", bc = self.loadStart,text='cnt_1'  )
     self.endFld = cmds.textFieldButtonGrp( label="End Control:", buttonLabel="Load", bc = self.loadEnd,text='cnt_2' )
     self.numFld = cmds.intFieldGrp(label='Controls:',nf=1,v1=5)
     self.skinFld = cmds.intFieldGrp(label='Skin Joints:',nf=1,v1=5)
     self.buildFld = cmds.radioButtonGrp(nrb=2,labelArray2=('U','V'),label='Build along:',sl=1)
     
     
     cmds.frameLayout(label='Control Options: ',fn='boldLabelFont',cll=False)
     cmds.columnLayout()
     self.crvCreateFld = cmds.radioButtonGrp(nrb=2,labelArray2=('Yes','No'),label='Create bend-bo controls?',sl=1)
     self.radFld = cmds.floatFieldGrp(label='Radius:',nf=1,v1=0.2)
     self.crvNrFld = cmds.radioButtonGrp(nrb=3,labelArray3=('X','Y','Z'),label='Controller normal Axis:',sl=2)
     cmds.setParent("..")
     cmds.setParent("..")
     
     cmds.rowLayout(nc=2,cw2=(200,100))
     cmds.text(' ')
     cmds.button(label = "          Create", c = self.buildRig,w=100 )
 	cmds.setParent('..')
 		
     cmds.showWindow("rbbnChainBuilder")
Esempio n. 30
0
    def createWin(self):

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

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

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

        self.addSubUIs()

        # shows toolbar
        cmds.toolBar(self.toolbarName, area="bottom", content=self.mainWin, allowedArea=["bottom"])
Esempio n. 31
0
def snapToMeshUI():
	'''
	UI for snapToMesh()
	'''
	# Window
	window = 'snapToMeshUI'
	if mc.window(window,q=True,ex=1): mc.deleteUI(window)
	window = mc.window(window,t='Snap To Mesh')

	# Layout
	FL = mc.formLayout(numberOfDivisions=100)

	# UI Elements
	#---

	# Mesh
	meshTFB = mc.textFieldButtonGrp('snapToMeshTFB',label='Target Mesh',text='',buttonLabel='Load Selected')

	# Orient
	orientCBG = mc.checkBoxGrp('snapToMeshOrientCBG',label='Orient To Face',ncb=1,v1=False)

	# ----------
	# - Orient -
	# ----------

	# Orient Frame
	orientFrameL = mc.frameLayout('snapToMeshOriFL',l='Orient Options',cll=0,en=0)
	orientFormL = mc.formLayout(numberOfDivisions=100)

	# OptionMenuGrp
	axList = ['X','Y','Z','-X','-Y','-Z']
	orientNormAxisOMG = mc.optionMenuGrp('snapToMeshNormOMG',label='Normal Axis',en=False)
	for ax in axList: mc.menuItem(label=ax)
	orientUpVecAxisOMG = mc.optionMenuGrp('snapToMeshUpVecOMG',label='UpVector Axis',en=False)
	for ax in axList: mc.menuItem(label=ax)
	# Set Default Value
	mc.optionMenuGrp('snapToMeshUpVecOMG',e=True,sl=2)

	# Up Vector
	upVectorFFG = mc.floatFieldGrp('snapToMeshUpVecFFG',label='UpVector',nf=3,v1=0,v2=1,v3=0,en=0)
	upVectorObjectTFB = mc.textFieldButtonGrp('snapToMeshUpVecObjTFG',label='WorldUpObject',text='',buttonLabel='Load Selected',en=0)

	mc.setParent('..')
	mc.setParent('..')

	# UI callback commands
	mc.textFieldButtonGrp(meshTFB,e=True,bc='glTools.ui.utils.loadMeshSel("'+meshTFB+'")')
	mc.checkBoxGrp(orientCBG,e=True,cc='glTools.ui.utils.checkBoxToggleLayout("'+orientCBG+'","'+orientFrameL+'")')
	mc.textFieldButtonGrp(upVectorObjectTFB,e=True,bc='glTools.ui.utils.loadObjectSel("'+upVectorObjectTFB+'")')

	# Buttons
	snapB = mc.button('snapToMeshSnapB',l='Snap!',c='glTools.ui.mesh.snapToMeshFromUI(False)')
	snapCloseB = mc.button('snapToMeshSnapCloseB',l='Snap and Close',c='glTools.ui.mesh.snapToMeshFromUI(True)')
	cancelB = mc.button('snapToMeshCancelB',l='Cancel',c='mc.deleteUI("'+window+'")')

	# Form Layout - MAIN
	mc.formLayout(FL,e=True,af=[(meshTFB,'top',5),(meshTFB,'left',5),(meshTFB,'right',5)])
	mc.formLayout(FL,e=True,ac=[(orientCBG,'top',5,meshTFB)],af=[(orientCBG,'left',5),(orientCBG,'right',5)])
	mc.formLayout(FL,e=True,ac=[(orientFrameL,'top',5,orientCBG),(orientFrameL,'bottom',5,snapB)],af=[(orientFrameL,'left',5),(orientFrameL,'right',5)])
	mc.formLayout(FL,e=True,ac=[(snapB,'bottom',5,snapCloseB)],af=[(snapB,'left',5),(snapB,'right',5)])
	mc.formLayout(FL,e=True,ac=[(snapCloseB,'bottom',5,cancelB)],af=[(snapCloseB,'left',5),(snapCloseB,'right',5)])
	mc.formLayout(FL,e=True,af=[(cancelB,'left',5),(cancelB,'right',5),(cancelB,'bottom',5)])

	# Form Layout - Orient
	mc.formLayout(orientFormL,e=True,af=[(orientNormAxisOMG,'top',5),(orientNormAxisOMG,'left',5),(orientNormAxisOMG,'right',5)])
	mc.formLayout(orientFormL,e=True,ac=[(orientUpVecAxisOMG,'top',5,orientNormAxisOMG)])
	mc.formLayout(orientFormL,e=True,af=[(orientUpVecAxisOMG,'left',5),(orientUpVecAxisOMG,'right',5)])

	mc.formLayout(orientFormL,e=True,ac=[(upVectorFFG,'top',5,orientUpVecAxisOMG)])
	mc.formLayout(orientFormL,e=True,af=[(upVectorFFG,'left',5),(upVectorFFG,'right',5)])

	mc.formLayout(orientFormL,e=True,ac=[(upVectorObjectTFB,'top',5,upVectorFFG)])
	mc.formLayout(orientFormL,e=True,af=[(upVectorObjectTFB,'left',5),(upVectorObjectTFB,'right',5)])

	# Show Window
	mc.showWindow(window)
Esempio n. 32
0
 def setVisible(self, visible):
     self.isVisible.set(visible)
     cmds.frameLayout(self.mainLayout,
                      e=True,
                      collapse=self.isVisible.get())
Esempio n. 33
0
def showUI():
    """Build and show the main installer window.
    """
    deleteExistingWindow(EULA_WIN)
    deleteExistingWindow(INSTALL_WIN)

    cmds.window(INSTALL_WIN,
                title="Install {}".format(MODULE_NAME),
                width=550,
                sizeable=False,
                resizeToFitChildren=True)

    layout = cmds.rowColumnLayout()

    showLogo()

    # ------------------------------------------------------------------
    # paths
    # ------------------------------------------------------------------

    cmds.frameLayout(label="Paths",
                     width=550,
                     collapsable=False,
                     collapse=False,
                     marginWidth=5,
                     marginHeight=5)
    cmds.columnLayout(columnAlign="left", adjustableColumn=True)
    cmds.separator(style="none", height=5)
    cmds.text(INFO_TEXT, label="", align="center")
    cmds.separator(style="none", height=15)
    cmds.textFieldButtonGrp(CONTENT_PATH_FIELD,
                            label="Install Path",
                            buttonLabel="Select",
                            columnAttach3=("left", "both", "right"),
                            columnWidth3=(80, 405, 55),
                            columnOffset3=(5, 0, 5),
                            buttonCommand=selectContentPath)
    addFieldComment(
        "The path where all files of the module{} will be installed.".format(
            multiSuffix()))
    cmds.separator(style="none", height=5)
    cmds.textFieldButtonGrp(MODULE_PATH_FIELD,
                            label="Module Path",
                            buttonLabel="Select",
                            columnAttach3=("left", "both", "right"),
                            columnWidth3=(80, 405, 55),
                            columnOffset3=(5, 0, 5),
                            buttonCommand=selectModulePath)
    addFieldComment("The path where the {}.mod file{} will be saved.".format(
        MODULE_NAME, multiSuffix()))
    cmds.setParent(layout)

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

    # ------------------------------------------------------------------
    # progress
    # ------------------------------------------------------------------

    cmds.frameLayout(label="Progress",
                     width=550,
                     collapsable=False,
                     collapse=False,
                     marginWidth=5,
                     marginHeight=5)
    cmds.columnLayout(columnAlign="left")
    cmds.textScrollList(PROGRESS_LIST, width=537, height=120)
    cmds.setParent(layout)

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

    # ------------------------------------------------------------------
    # buttons
    # ------------------------------------------------------------------

    form = cmds.formLayout(width=550)
    cmds.button(INSTALL_BUTTON,
                label="Install",
                width=150,
                height=30,
                command=performInstallation)
    cmds.button(UNINSTALL_BUTTON,
                label="Uninstall",
                width=150,
                height=30,
                command=performUninstall)
    cmds.button(HELP_BUTTON,
                label="Help",
                width=60,
                height=30,
                command=openHelp,
                enable=helpExists())
    cmds.button(MODULE_BUTTON,
                label="Create .mod file{} only".format(multiSuffix()),
                width=150,
                height=30,
                command=performBuildModuleFiles)
    cmds.formLayout(form,
                    edit=True,
                    attachForm=[(INSTALL_BUTTON, "left", 0),
                                (INSTALL_BUTTON, "bottom", 0),
                                (UNINSTALL_BUTTON, "bottom", 0),
                                (MODULE_BUTTON, "bottom", 0),
                                (HELP_BUTTON, "right", 0),
                                (HELP_BUTTON, "bottom", 0)],
                    attachControl=[
                        (UNINSTALL_BUTTON, "left", 5, INSTALL_BUTTON),
                        (MODULE_BUTTON, "left", 5, UNINSTALL_BUTTON)
                    ],
                    attachNone=[(HELP_BUTTON, "left")])
    cmds.setParent(layout)

    cmds.showWindow(INSTALL_WIN)
Esempio n. 34
0
def attachToMeshUI():
	'''
	UI for attachToMesh()
	'''
	# Window
	window = 'attachToMeshUI'
	if mc.window(window,q=True,ex=1): mc.deleteUI(window)
	window = mc.window(window,t='Attach To Mesh')
	# Layout
	FL = mc.formLayout(numberOfDivisions=100)
	# UI Elements
	#---
	# Surface
	meshTFB = mc.textFieldButtonGrp('attachToMeshTFB',label='Target Mesh',text='',buttonLabel='Load Selected')
	# Transform
	transformTFB = mc.textFieldButtonGrp('attachToMeshTransformTFB',label='Transform',text='',buttonLabel='Load Selected')
	# Transform
	prefixTFG = mc.textFieldGrp('attachToMeshPrefixTFG',label='Prefix',text='')
	# Orient
	orientCBG = mc.checkBoxGrp('attachToMeshOrientCBG',label='Orient To Face',ncb=1,v1=False)

	# Orient Frame
	orientFrameL = mc.frameLayout('attachToMeshOriFL',l='Orient Options',cll=0,en=0)
	orientFormL = mc.formLayout(numberOfDivisions=100)
	# OMG
	axList = ['X','Y','Z','-X','-Y','-Z']
	orientNormAxisOMG = mc.optionMenuGrp('attachToMeshNormOMG',label='Normal Axis',en=False)
	for ax in axList: mc.menuItem(label=ax)
	orientTanAxisOMG = mc.optionMenuGrp('attachToMeshTanOMG',label='Tangent Axis',en=False)
	for ax in axList: mc.menuItem(label=ax)
	# Set Default Value
	mc.optionMenuGrp(orientTanAxisOMG,e=True,sl=2)

	mc.setParent('..')
	mc.setParent('..')

	# UI callback commands
	mc.textFieldButtonGrp(meshTFB,e=True,bc='glTools.ui.utils.loadMeshSel("'+meshTFB+'")')
	mc.textFieldButtonGrp(transformTFB,e=True,bc='glTools.ui.utils.loadObjectSel("'+transformTFB+'","'+prefixTFG+'")')
	mc.checkBoxGrp(orientCBG,e=True,cc='glTools.ui.utils.checkBoxToggleLayout("'+orientCBG+'","'+orientFrameL+'")')

	# Buttons
	snapB = mc.button('attachToMeshAttachB',l='Attach',c='glTools.ui.mesh.attachToMeshFromUI(False)')
	snapCloseB = mc.button('attachToMeshAttachCloseB',l='Attach and Close',c='glTools.ui.mesh.attachToMeshFromUI(True)')
	cancelB = mc.button('attachToMeshCancelB',l='Cancel',c='mc.deleteUI("'+window+'")')

	# Form Layout - MAIN
	mc.formLayout(FL,e=True,af=[(meshTFB,'top',5),(meshTFB,'left',5),(meshTFB,'right',5)])
	mc.formLayout(FL,e=True,ac=[(transformTFB,'top',5,meshTFB)])
	mc.formLayout(FL,e=True,af=[(transformTFB,'left',5),(transformTFB,'right',5)])
	mc.formLayout(FL,e=True,ac=[(prefixTFG,'top',5,transformTFB)])
	mc.formLayout(FL,e=True,af=[(prefixTFG,'left',5),(prefixTFG,'right',5)])
	mc.formLayout(FL,e=True,ac=[(orientCBG,'top',5,prefixTFG)])
	mc.formLayout(FL,e=True,af=[(orientCBG,'left',5),(orientCBG,'right',5)])
	mc.formLayout(FL,e=True,ac=[(orientFrameL,'top',5,orientCBG)])
	mc.formLayout(FL,e=True,af=[(orientFrameL,'left',5),(orientFrameL,'right',5)])
	mc.formLayout(FL,e=True,ac=[(orientFrameL,'bottom',5,snapB)])
	mc.formLayout(FL,e=True,ac=[(snapB,'bottom',5,snapCloseB)])
	mc.formLayout(FL,e=True,af=[(snapB,'left',5),(snapB,'right',5)])
	mc.formLayout(FL,e=True,ac=[(snapCloseB,'bottom',5,cancelB)])
	mc.formLayout(FL,e=True,af=[(snapCloseB,'left',5),(snapCloseB,'right',5)])
	mc.formLayout(FL,e=True,af=[(cancelB,'left',5),(cancelB,'right',5),(cancelB,'bottom',5)])

	# Form Layout - Orient
	mc.formLayout(orientFormL,e=True,af=[(orientNormAxisOMG,'top',5),(orientNormAxisOMG,'left',5),(orientNormAxisOMG,'right',5)])
	mc.formLayout(orientFormL,e=True,ac=[(orientTanAxisOMG,'top',5,orientNormAxisOMG)])
	mc.formLayout(orientFormL,e=True,af=[(orientTanAxisOMG,'left',5),(orientTanAxisOMG,'right',5)])

	# Show Window
	mc.showWindow(window)
Esempio n. 35
0
def attrUI(*args):
    """UI for the script"""

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

    widgets["win"] = cmds.window("attrWin",
                                 t="zbw_attributes",
                                 h=370,
                                 w=250,
                                 s=True)
    widgets["tabLO"] = cmds.tabLayout()
    widgets["channelColLO"] = cmds.columnLayout("Object/Attr Controls",
                                                w=250,
                                                bgc=(.8, .8, .8))

    widgets["lockFrLO"] = cmds.frameLayout(l="Lock/Hide",
                                           cll=True,
                                           w=250,
                                           bgc=(.7, .6, .6))
    widgets["lockColLO"] = cmds.columnLayout(bgc=(.8, .8, .8))
    #lock and hide controls

    #switch to Row column layout to break up the channels
    widgets["attrRCLO"] = cmds.rowColumnLayout(nc=2, cw=([1, 100], [2, 150]))
    widgets["transCB"] = cmds.checkBox(l="Translates",
                                       v=0,
                                       cc=partial(enableChannel, "transCB",
                                                  "translateCBG"))
    widgets["translateCBG"] = cmds.checkBoxGrp(w=150,
                                               cw3=(50, 50, 50),
                                               ncb=3,
                                               l1="TX",
                                               l2="TY",
                                               l3="TZ",
                                               l4="Vis",
                                               va3=(0, 0, 0),
                                               bgc=(.5, .5, .5),
                                               en=False)
    widgets["rotCB"] = cmds.checkBox(l="Rotates",
                                     v=0,
                                     cc=partial(enableChannel, "rotCB",
                                                "rotateCBG"))
    widgets["rotateCBG"] = cmds.checkBoxGrp(w=150,
                                            cw3=(50, 50, 50),
                                            ncb=3,
                                            l1="RX",
                                            l2="RY",
                                            l3="RZ",
                                            l4="Vis",
                                            va3=(0, 0, 0),
                                            bgc=(.5, .5, .5),
                                            en=False)
    widgets["scaleCB"] = cmds.checkBox(l="Scales",
                                       v=1,
                                       cc=partial(enableChannel, "scaleCB",
                                                  "scaleCBG"))
    widgets["scaleCBG"] = cmds.checkBoxGrp(w=150,
                                           cw3=(50, 50, 50),
                                           ncb=3,
                                           l1="SX",
                                           l2="SY",
                                           l3="SZ",
                                           l4="Vis",
                                           va3=(1, 1, 1),
                                           bgc=(.5, .5, .5),
                                           en=True)
    widgets["visCB"] = cmds.checkBox(l="Visibility", v=1)

    #back to frame layout
    cmds.setParent(widgets["lockFrLO"])
    widgets["lockRBG"] = cmds.radioButtonGrp(nrb=2,
                                             l1="Unlock",
                                             l2="Lock",
                                             sl=2)
    widgets["hideRBG"] = cmds.radioButtonGrp(nrb=2, l1="Show", l2="Hide", sl=2)
    widgets["channelsBut"] = cmds.button(l="Lock/Hide Channels",
                                         w=150,
                                         h=30,
                                         bgc=(.5, .5, .5),
                                         rs=True,
                                         c=channelLockHide)
    cmds.separator(h=5, st="none")

    #back to columnLayout
    cmds.setParent(widgets["channelColLO"])
    widgets["colorFrLO"] = cmds.frameLayout(l="Object Color",
                                            cll=True,
                                            w=250,
                                            bgc=(.7, .6, .6))
    widgets["colorRCLO"] = cmds.rowColumnLayout(nr=4, bgc=(.8, .8, .8))

    #color controls (red, green, blue, yellow, other)
    cmds.canvas(w=50,
                h=20,
                rgb=(1, 0, 0),
                pc=partial(changeColor, colors["red"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.5, .1, .1),
                pc=partial(changeColor, colors["darkRed"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.659, .275, .449),
                pc=partial(changeColor, colors["lightRed"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(1, .8, .965),
                pc=partial(changeColor, colors["pink"]))

    cmds.canvas(w=50,
                h=20,
                rgb=(0, 1, 0),
                pc=partial(changeColor, colors["green"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(0, .35, 0),
                pc=partial(changeColor, colors["darkGreen"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(0, .55, .335),
                pc=partial(changeColor, colors["medGreen"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.35, .635, .15),
                pc=partial(changeColor, colors["yellowGreen"]))

    cmds.canvas(w=50,
                h=20,
                rgb=(0, 0, 1),
                pc=partial(changeColor, colors["blue"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(0, 0, .35),
                pc=partial(changeColor, colors["darkBlue"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(0, .2, .6),
                pc=partial(changeColor, colors["medBlue"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.65, .8, 1),
                pc=partial(changeColor, colors["lightBlue"]))

    cmds.canvas(w=50,
                h=20,
                rgb=(1, 1, 0),
                pc=partial(changeColor, colors["yellow"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.225, .1, 0),
                pc=partial(changeColor, colors["darkBrown"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.5, .275, 0),
                pc=partial(changeColor, colors["brown"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.922, .707, .526),
                pc=partial(changeColor, colors["darkYellow"]))

    cmds.canvas(w=50,
                h=20,
                rgb=(.33, 0, .33),
                pc=partial(changeColor, colors["purple"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.2, 0, .25),
                pc=partial(changeColor, colors["darkPurple"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(.0, 0, .0),
                pc=partial(changeColor, colors["black"]))
    cmds.canvas(w=50,
                h=20,
                rgb=(1, 1, 1),
                pc=partial(changeColor, colors["white"]))

    #TO-DO----------------figure out breaking connections(to delete or not?), call add attr win
    # cmds.setParent(widgets["channelColLO"])
    # widgets["channelFrLO"] = cmds.frameLayout(l="Channels", cll=True, w=250, bgc=(1,1,1))
    # widgets["channelRCLO"] = cmds.columnLayout(bgc=(.8,.8,.8))
    # widgets["breakAllBut"] = cmds.button(l="Break All Connections", w=150, h=30, bgc=(.5,.5,.5))
    # widgets["breakSelBut"] = cmds.button(l="Break Selected Connections", w=150, h=30, bgc=(.5,.5,.5))
    # cmds.separator(h=10, st="none")
    # widgets["addAttBut"] = cmds.button(l="Show 'Add Attribute' win", w=150, h=30, bgc=(.5,.5,.5))

    cmds.setParent(widgets["tabLO"])
    widgets["connectColLO"] = cmds.columnLayout("Connections",
                                                w=250,
                                                bgc=(.8, .8, .8))
    widgets["connectFrame"] = cmds.frameLayout(l="Make General Connections",
                                               cll=True,
                                               bgc=(.6, .8, .6))
    widgets["connectionColLO"] = cmds.columnLayout(bgc=(.8, .8, .8))

    #connection stuff
    cmds.text("Select a source object and a channel:")
    widgets["connector"] = cmds.textFieldButtonGrp(
        l="Connector",
        w=250,
        bl="<<<",
        cal=[(1, "left"), (2, "left"), (3, "left")],
        cw3=[60, 140, 30],
        bc=partial(getChannel, "connector"))
    cmds.separator(h=5, st="none")
    cmds.text("Select a target object and channel:")
    widgets["connectee"] = cmds.textFieldButtonGrp(
        l="Connectee",
        w=250,
        bl="<<<",
        cal=[(1, "left"), (2, "left"), (3, "left")],
        cw3=[60, 140, 30],
        bc=partial(getChannel, "connectee"))
    cmds.separator(h=10, st="none")
    widgets["connectBut"] = cmds.button(l="Connect Two Channels",
                                        w=240,
                                        h=30,
                                        bgc=(.5, .5, .5),
                                        c=connectChannels)
    cmds.separator(h=5, st="none")

    cmds.setParent(widgets["connectColLO"])
    widgets["shapeFrame"] = cmds.frameLayout(l="Connect to Shape Visibility",
                                             cll=True,
                                             bgc=(.6, .8, .6))
    widgets["shapeColLO"] = cmds.columnLayout(bgc=(.8, .8, .8))

    widgets["toShapeVis"] = cmds.textFieldButtonGrp(l="Vis Driver",
                                                    w=250,
                                                    bl="<<<",
                                                    cal=[(1, "left"),
                                                         (2, "left"),
                                                         (3, "left")],
                                                    cw3=[60, 140, 30],
                                                    bc=partial(
                                                        getChannel,
                                                        "toShapeVis"))
    cmds.separator(h=5, st="none")
    cmds.text("Now select the objs to drive:")
    widgets["shapeBut"] = cmds.button(l="Connect to Shapes' vis",
                                      w=240,
                                      h=30,
                                      bgc=(.5, .5, .5),
                                      c=connectShapeVis)
    cmds.separator(h=5, st="none")

    cmds.setParent(widgets["connectColLO"])
    widgets["inoutFrame"] = cmds.frameLayout(
        l="Select Connections (and print)", cll=True, bgc=(.6, .8, .6))
    widgets["inOutColLO"] = cmds.columnLayout(bgc=(.8, .8, .8))

    widgets["conversionCB"] = cmds.checkBox(l="Skip 'conversion' nodes?", v=1)
    cmds.text("Select an attribute in the channel box:")
    widgets["getInputBut"] = cmds.button(l="Select inConnection object",
                                         w=240,
                                         h=30,
                                         bgc=(.5, .5, .5),
                                         c=getInput)
    widgets["getOutputBut"] = cmds.button(l="Select outConnection objects",
                                          w=240,
                                          h=30,
                                          bgc=(.5, .5, .5),
                                          c=getOutput)

    #show window
    cmds.showWindow(widgets["win"])
    cmds.window(widgets["win"], e=True, w=250, h=370)
Esempio n. 36
0
def createWindow():
    if cmds.window('MeshLightSetter',ex=True):
        cmds.deleteUI('MeshLightSetter')

    cmds.window('MeshLightSetter',t='MeshLight Setter',w=600,h=800)
    cmds.rowLayout(nc=2)
    cmds.frameLayout(l='aiTranslatorAttributes',w=450)
    cmds.formLayout('MeshLight_FormLayout')
    f1 = cmds.optionMenu('MeshLight_aiTranslator')
    cmds.menuItem(l='polymesh',p='MeshLight_aiTranslator')
    cmds.menuItem(l='mesh_light',p='MeshLight_aiTranslator')
    cmds.menuItem(l='procedural',p='MeshLight_aiTranslator')
    f2 = cmds.colorSliderGrp('MeshLight_aiColor',l='Color')
    f3 = cmds.floatFieldGrp('MeshLight_aiIntensity',l='Intensity')
    f4 = cmds.floatSliderGrp('MeshLight_aiExposure',l='Exposure',field=True)
    f5 = cmds.checkBox('MeshLight_aiUseTemp',l='Use Temperature')
    f6 = cmds.floatSliderGrp('MeshLight_aiTemperature',l='Temperature',minValue=0.0,maxValue=20000.0,field=True)
    f7 = cmds.checkBox('MeshLight_aiVisible',l='Light Visible')
    f8 = cmds.intFieldGrp('MeshLight_aiSample',l='Sample')
    f9 = cmds.checkBox('MeshLight_aiNormalize',l='Normalize')
    f10 = cmds.checkBox('MeshLight_aiCastShadows',l='Cast Shadows')
    f11 = cmds.floatSliderGrp('MeshLight_aiShadowDensity',l='ShadowDensity',minValue=0.0,maxValue=1.0,field=True)
    f12 = cmds.colorSliderGrp('MeshLight_aiShadowColor',l='Shadow Color')
    f13 = cmds.checkBox('MeshLight_aiCastVolumeShadow',l='Cast Volumeric Shadow')
    f14 = cmds.intFieldGrp('MeshLight_aiVolumeSample',l='Volume Sample')
    f15 = cmds.textFieldGrp('MeshLight_aiAov',l='AOV Group')
    f16 = cmds.rowLayout(nc=2)
    f17 = cmds.button(l='List LightGroup',c=lambda *args:refreshLightGroupMenu(),w=98)
    f18 = cmds.button(l='Set LightGroup',c=lambda *args:setLightGroupFromMenu(),w=98)
    cmds.setParent(u=True)
    f19 = cmds.textScrollList('MeshLight_LightGroupList',w=200,h=372)
    cmds.formLayout('MeshLight_FormLayout',e=True,af = [(f1,'top',0),(f1,'left',140),
                                                        (f2,'top',22),(f2,'left',0),
                                                        (f3,'top',44),(f3,'left',0),
                                                        (f4,'top',66),(f4,'left',0),
                                                        (f5,'top',88),(f5,'left',130),
                                                        (f6,'top',110),(f6,'left',0),
                                                        (f7,'top',132),(f7,'left',130),
                                                        (f8,'top',154),(f8,'left',0),
                                                        (f9,'top',176),(f9,'left',130),
                                                        (f10,'top',198),(f10,'left',130),
                                                        (f11,'top',220),(f11,'left',0),
                                                        (f12,'top',242),(f12,'left',0),
                                                        (f13,'top',264),(f13,'left',130),
                                                        (f14,'top',286),(f14,'left',0),
                                                        (f15,'top',308),(f15,'left',0),
                                                        (f16,'top',333),(f16,'left',130),
                                                        (f19,'top',360),(f19,'left',130)
                                                        ])
    
    
    cmds.setParent(u=True)
    cmds.setParent(u=True)
    cmds.frameLayout(l='Mesh Light List')
    cmds.rowLayout(nc=5)
    cmds.button(l='ALL MESH light',c=lambda *args:lightListRefresh(True))
    cmds.button(l='Sel MESH Light',c=lambda *args:lightListRefresh(False))
    cmds.textFieldGrp('MeshLight_Template',l='Template')
    cmds.button(l='Set Template',c=lambda *args:cmds.textFieldGrp('MeshLight_Template',e=True,tx=cmds.ls(sl=True,dag=True,ni=True,type='mesh')[0]))
    cmds.button(l='Convert!',c=lambda *args:convertMeshToMeshLight())
    cmds.setParent(u=True)
    
    cmds.textScrollList('MeshLightList',w=600,h=700,ams=True)
    cmds.setParent(u=True)

    cmds.popupMenu('MeshLightListMenu',p='MeshLightList')
    cmds.menuItem(l='Select...',p='MeshLightListMenu',c=lambda *args:cmds.select([item for item in cmds.textScrollList('MeshLightList',q=True,si=True)]))

    cmds.showWindow('MeshLightSetter')

    cmds.textScrollList('MeshLightList',e=True,dcc=lambda *args:cmds.select(cmds.textScrollList('MeshLightList',q=True,si=True),r=True))
    cmds.textScrollList('MeshLightList',e=True,sc=lambda *args:getMeshLightAttrsAndShow())
    cmds.textScrollList('MeshLight_LightGroupList',e=True,dcc=lambda *args:selectLightByGroupName())
    cmds.optionMenu(f1,e=True,cc=lambda *args:setMeshLightAttrsAndShow('translator'))
    cmds.colorSliderGrp(f2,e=True,cc=lambda *args:setMeshLightAttrsAndShow('color'))
    cmds.floatFieldGrp(f3,e=True,cc=lambda *args:setMeshLightAttrsAndShow('intensity'))
    cmds.floatSliderGrp(f4,e=True,cc=lambda *args:setMeshLightAttrsAndShow('exposure'))
    cmds.checkBox(f5,e=True,cc=lambda *args:setMeshLightAttrsAndShow('useTemp'))
    cmds.floatSliderGrp(f6,e=True,cc=lambda *args:setMeshLightAttrsAndShow('temp'))
    cmds.checkBox(f7,e=True,cc=lambda *args:setMeshLightAttrsAndShow('visible'))
    cmds.intFieldGrp(f8,e=True,cc=lambda *args:setMeshLightAttrsAndShow('sample'))
    cmds.checkBox(f9,e=True,cc=lambda *args:setMeshLightAttrsAndShow('normalize'))
    cmds.checkBox(f10,e=True,cc=lambda *args:setMeshLightAttrsAndShow('castShadows'))
    cmds.floatSliderGrp(f11,e=True,cc=lambda *args:setMeshLightAttrsAndShow('shadowDensity'))
    cmds.colorSliderGrp(f12,e=True,cc=lambda *args:setMeshLightAttrsAndShow('shadowColor'))
    cmds.checkBox(f13,e=True,cc=lambda *args:setMeshLightAttrsAndShow('castVolumeShadow'))
    cmds.intFieldGrp(f14,e=True,cc=lambda *args:setMeshLightAttrsAndShow('volumeSample'))
    cmds.textFieldGrp(f15,e=True,cc=lambda *args:setMeshLightAttrsAndShow('aiAov'))