Ejemplo n.º 1
0
    def create(self):
        '''
        this function creates the components
        '''
        self.layout = pm.frameLayout(label= str(self.node), width= 340, collapsable= True, collapse= True )
        pm.attrEnumOptionMenu( label='Pre Infinity ', attribute='%s.preInfinity' % (self.node) )
        pm.attrEnumOptionMenu( label='Post Infinity ', attribute='%s.postInfinity' % (self.node) )

        pm.rowColumnLayout(numberOfColumns= 5, columnWidth= ([1, 10], [2, 50], [3, 50], [4, 115], [5, 115]))
        pm.text(label= '')
        pm.text(label= 'Time')
        pm.text(label= 'Value')
        pm.text(label= 'inTan Type')
        pm.text(label= 'OutTan Type')
        
        # create components for each key
        for num in xrange(self.count):
            pm.text(label= str(num), annotation= 'Key Index')
            
            time = Time_int(index= num, node= self.node)
            time.create()
            
            value = Value_float(index= num, node= self.node)
            value.create()
            
            in_tan = In_Tangent(index= num, node= self.node)
            in_tan.create()
            
            out_tan = Out_Tangent(index= num, node= self.node)
            out_tan.create()
Ejemplo n.º 2
0
    def create(self):
        '''
        this function creates the components
        '''
        self.layout = pm.frameLayout(label= str(self.node), width= 340, collapsable= True, collapse= True )
        pm.attrEnumOptionMenu( label='Pre Infinity ', attribute='%s.preInfinity' % (self.node) )
        pm.attrEnumOptionMenu( label='Post Infinity ', attribute='%s.postInfinity' % (self.node) )

        pm.rowColumnLayout(numberOfColumns= 5, columnWidth= ([1, 10], [2, 50], [3, 50], [4, 115], [5, 115]))
        pm.text(label= '')
        pm.text(label= 'Time')
        pm.text(label= 'Value')
        pm.text(label= 'inTan Type')
        pm.text(label= 'OutTan Type')
        
        # create components for each key
        for num in xrange(self.count):
            pm.text(label= str(num), annotation= 'Key Index')
            
            time = Time_int(index= num, node= self.node)
            time.create()
            
            value = Value_float(index= num, node= self.node)
            value.create()
            
            in_tan = In_Tangent(index= num, node= self.node)
            in_tan.create()
            
            out_tan = Out_Tangent(index= num, node= self.node)
            out_tan.create()
Ejemplo n.º 3
0
	def UI_custom(self):
		
		numJoints = len(self.jointInfo)
		
		pm.rowLayout(numberOfColumns = 2, columnWidth = [1, 100], adjustableColumn = 2)
		pm.text(label = "Number of Joints: ")
		self.numberOfJointsField = pm.intField(value = numJoints, minValue = 2, changeCommand = self.ChangeNumberOfJoints)
		
		pm.setParent('..')
		
		joints = self.GetJoints()
		self.CreateRotationOrderUIControl(joints[0])
		
		pm.separator(style = 'in')
		
		pm.text(label = "Orientation: ", align = "left")
		pm.rowLayout(numberOfColumns = 3)
		pm.attrEnumOptionMenu(attribute = "%s:module_grp.sao_local" %self.moduleNamespace, label = "Local: ")
		pm.text(label = " will be oriented to ")
		pm.attrEnumOptionMenu(attribute = "%s:module_grp.sao_world" %self.moduleNamespace, label = "World: ")
		
		pm.setParent('..')
		
		pm.separator(style = 'in')
		
		interpolating = False
		if pm.objExists("%s:interpolation_container" %self.moduleNamespace):
			interpolating = True
		
		
		pm.rowLayout(numberOfColumns = 2, columnWidth = [1, 80], adjustableColumn = 2)
		pm.text(label = "Interpolate: ")
		pm.checkBox(label = "", value = interpolating, onCommand = partial(self.SetupInterpolation, True), offCommand = self.DeleteInterpolation)
Ejemplo n.º 4
0
    def create(self):
        
        
        
        self.main_layout = pm.columnLayout(adjustableColumn= True, width= 400)
       
        main_frame = pm.frameLayout( label='%s' % (self.light), collapsable= True)
        pm.frameLayout( label='Light Attributes', collapsable= True)
        pm.attrColorSliderGrp( at='%s.color' % (self.light), columnWidth4= [100, 75, 175, 50])
        pm.attrFieldSliderGrp(at='%s.intensity' % (self.light), columnWidth4= [100, 75, 175, 50])
        pm.attrFieldSliderGrp(at='%s.coneAngle' % (self.light), columnWidth4= [100, 75, 175, 50])
        pm.attrFieldSliderGrp(at='%s.penumbraAngle' % (self.light), columnWidth4= [100, 75, 175, 50])
        pm.attrFieldSliderGrp(at='%s.dropoff' % (self.light), columnWidth4= [100, 75, 175, 50])
        pm.attrEnumOptionMenu( label='Decay Rate', attribute='%s.decayRate' % (self.light) )
        
        pm.setParent(main_frame)
        pm.frameLayout(label= 'Shadows', collapsable= True)
        pm.attrColorSliderGrp( at='%s.shadowColor' % (self.light),
                              columnWidth4= [100, 75, 175, 50])
        self.check_box = pm.checkBox(label= 'Use Ray Trace Shadows',
                        changeCommand= pm.Callback(self.shadows))
        
        self.light_radius = pm.attrFieldSliderGrp( at='%s.lightRadius' % (self.light),
                                enable= False, columnWidth4= [100, 75, 175, 50])
        
        self.shadow_rays = pm.attrFieldSliderGrp( at='%s.shadowRays' % (self.light),
                                enable= False, columnWidth4= [100, 75, 175, 50])
        
        self.ray_depth = pm.attrFieldSliderGrp( at='%s.rayDepthLimit' % (self.light),
                                enable= False, columnWidth4= [100, 75, 175, 50])

        pm.setParent(main_frame)
        pm.frameLayout(label= 'Decay Regions', collapsable= True)
        # useDecayRegions
        decay_regions_value = pm.getAttr('%s.useDecayRegions' % (self.light))
        self.decay_check_box = pm.checkBox(label= 'Use Decay Regions',
                        value= decay_regions_value, 
                    changeCommand= pm.Callback(self.chane_decay_regions))

        pm.attrControlGrp(attribute= '%s.startDistance1' % (self.light))
        pm.attrControlGrp(attribute= '%s.endDistance1' % (self.light))

        pm.attrControlGrp(attribute= '%s.startDistance2' % (self.light))
        pm.attrControlGrp(attribute= '%s.endDistance2' % (self.light))

        pm.attrControlGrp(attribute= '%s.startDistance3' % (self.light))
        pm.attrControlGrp(attribute= '%s.endDistance3' % (self.light))
       
        pm.setParent(main_frame)
        pm.rowColumnLayout(numberOfColumns= 2, columnWidth= [200, 200])
        pm.button(label= 'Select Light', width= 200, command= pm.Callback(self.select))
        pm.button(label= 'Save Preset', width= 200, command= pm.Callback(self.preset))
        pm.button(label= 'Hide', command= pm.Callback(self.hide))
        pm.button(label= 'Show',  command= pm.Callback(self.show))
        return self.main_layout
Ejemplo n.º 5
0
def dimConnections(element):
    print "DimConnections"
    if element['name'] in ['motionblur']:
        value = pm.checkBoxGrp( element['name'], query = True, v1 = True)
        print element['uielement']
        valueInv = value
        #groups = mantraGlobalsAttributes.mantraGlobalsAttributes
        #if el['name'] in ['xftimesamples', 'geotimesamples', 'motionfactor', 'mbtype']:
        if value:
            print "enabling ctrls"            
        else:
            print "disabling ctrls"
        pm.intFieldGrp('xftimesamples', edit = True, enable = valueInv)
        pm.intFieldGrp('geotimesamples', edit = True, enable = valueInv)
        pm.floatFieldGrp('motionfactor', edit = True, enable = valueInv)
        pm.attrEnumOptionMenu('mbtype', edit = True, enable = valueInv)
        pm.checkBoxGrp('imagemotionblur',  edit = True, enable = valueInv)
Ejemplo n.º 6
0
 def create(self):
     
     self.main_layout = pm.columnLayout(adjustableColumn= True, width= 400)
    
     main_frame = pm.frameLayout( label='%s' % (self.light), collapsable= True)
     pm.frameLayout( label='Light Attributes', collapsable= True)
     pm.attrColorSliderGrp( at='%s.color' % (self.light), columnWidth4= [100, 75, 175, 50])
     pm.attrFieldSliderGrp(at='%s.intensity' % (self.light), columnWidth4= [100, 75, 175, 50])
     
     pm.attrEnumOptionMenu( label='Light Shape', attribute='%s.lightShape' % (self.light) )
     
     pm.setParent(main_frame)
     pm.frameLayout(label= 'Shadows', collapsable= True)
     pm.attrColorSliderGrp( at='%s.shadowColor' % (self.light),
                           columnWidth4= [100, 75, 175, 50])
     self.check_box = pm.checkBox(label= 'Use Ray Trace Shadows',
                     changeCommand= pm.Callback(self.shadows))
     
     self.light_angle = pm.attrFieldSliderGrp( at='%s.lightAngle' % (self.light),
                             enable= False, columnWidth4= [100, 75, 175, 50])
     
     self.light_radius = pm.attrFieldSliderGrp( at='%s.lightRadius' % (self.light),
                             enable= False, columnWidth4= [100, 75, 175, 50])
     
     self.shadow_rays = pm.attrFieldSliderGrp( at='%s.shadowRays' % (self.light),
                             enable= False, columnWidth4= [100, 75, 175, 50])
     
     self.ray_depth = pm.attrFieldSliderGrp( at='%s.rayDepthLimit' % (self.light),
                             enable= False, columnWidth4= [100, 75, 175, 50])
    
     pm.setParent(main_frame)
     pm.rowColumnLayout(numberOfColumns= 2, columnWidth= [200, 200])
     pm.button(label= 'Select Light', width= 200, command= pm.Callback(self.select))
     pm.button(label= 'Save Preset', width= 200, command= pm.Callback(self.preset))
     pm.button(label= 'Hide', command= pm.Callback(self.hide))
     pm.button(label= 'Show',  command= pm.Callback(self.show))
     return self.main_layout
Ejemplo n.º 7
0
	def SetupActiveModuleControls(self):
		existingControls = pm.columnLayout(self.UIElements["activeModuleColumn"], query = True, childArray = True)
		if existingControls != None:
			pm.deleteUI(existingControls)
		
		largeButtonSize = 100
		enumOptionWidth = self.windowWidth - (2 * largeButtonSize)
		
		self.settingsLocator = "%s:SETTINGS" %self.selectedBlueprintModule
		activeModuleAttribute = "%s.activeModule" %self.settingsLocator
		
		currentEntries = pm.attributeQuery("activeModule", node = self.settingsLocator, listEnum = True)
		enable = True
		
		if currentEntries[0] == "None":
			enable = False
		
		self.UIElements["activeModue_rowLayout"] = pm.rowLayout(numberOfColumns = 3, adjustableColumn = 1, columnAttach3 = ("both", "both", "both"), columnWidth3 = (enumOptionWidth, largeButtonSize, largeButtonSize), parent = self.UIElements["activeModuleColumn"])
		
		attributes = pm.listAttr(self.settingsLocator, keyable = False)
		weightAttributes = []
		for attr in attributes:
			if attr.find("_weight") != -1:
				weightAttributes.append(attr)
		
		self.UIElements["activeModule"] = pm.attrEnumOptionMenu(label = "Active Module", width = enumOptionWidth, attribute = activeModuleAttribute, changeCommand = partial(self.ActiveModule_enumCallback, weightAttributes), enable = enable, parent = self.UIElements["activeModue_rowLayout"])
		self.UIElements["keyModuleWeights"] = pm.button(label = "Key All", command = partial(self.KeyModuleWeights, weightAttributes), enable = enable, parent = self.UIElements["activeModue_rowLayout"])
		self.UIElements["graphModuleWeights"] = pm.button(label = "Graph Weights", command = self.GraphModuleWeights, enable = enable, parent = self.UIElements["activeModue_rowLayout"])
		
		
		self.UIElements["moduleWeights_frameLayout"] = pm.frameLayout(collapsable = True, collapse = False, label = "Module Weights", height = 100, collapseCommand = self.ModuleWeights_UICollapse, expandCommand = self.ModuleWeights_UIExpand, parent = self.UIElements["activeModuleColumn"])
		pm.scrollLayout("frame_scroll", horizontalScrollBarThickness = 0, parent = self.UIElements["moduleWeights_frameLayout"])
		pm.columnLayout("frameScroll_column", adjustableColumn = True, parent = "frame_scroll")
		
		pm.attrFieldSliderGrp(attribute = "%s.creationPoseWeight" %self.settingsLocator, enable = False, parent = "frameScroll_column")
		pm.separator(style = "in", parent = "frameScroll_column")
		
		for attr in weightAttributes:
			self.UIElements[attr] = pm.floatSliderGrp(label = attr, field = True, precision = 4, minValue = 0.0, maxValue = 1.0, value = pm.getAttr("%s.%s" %(self.settingsLocator, attr)), changeCommand = partial(self.ModuleWeights_sliderCallback, attr, weightAttributes), parent = "frameScroll_column")
		
		parentUIElement = self.UIElements["moduleWeights_frameLayout"]
		self.Create_moduleWeightScriptJob(parentUIElement, weightAttributes)
		
		self.ModuleWeights_updateMatchingButton()
Ejemplo n.º 8
0
    def create(self):
        
        
        
        self.main_layout = pm.columnLayout(adjustableColumn= True, width= 400)
       
        main_frame = pm.frameLayout( label='%s' % (self.light), collapsable= True)
        pm.frameLayout( label='Light Attributes', collapsable= True)
        pm.attrColorSliderGrp( at='%s.color' % (self.light), columnWidth4= [100, 75, 175, 50])
        pm.attrFieldSliderGrp(at='%s.intensity' % (self.light), columnWidth4= [100, 75, 175, 50])
        
        
        pm.attrEnumOptionMenu( label='Decay Rate', attribute='%s.decayRate' % (self.light) )
        
        pm.setParent(main_frame)
        pm.frameLayout(label= 'Shadows', collapsable= True)
        pm.attrColorSliderGrp( at='%s.shadowColor' % (self.light),
                              columnWidth4= [100, 75, 175, 50])
        self.check_box = pm.checkBox(label= 'Use Ray Trace Shadows',
                        changeCommand= pm.Callback(self.shadows))
        
        self.shadow_rays = pm.attrFieldSliderGrp( at='%s.shadowRays' % (self.light),
                                enable= False, columnWidth4= [100, 75, 175, 50])
        
        self.ray_depth = pm.attrFieldSliderGrp( at='%s.rayDepthLimit' % (self.light),
                                enable= False, columnWidth4= [100, 75, 175, 50])
        
        pm.setParent(main_frame)
        pm.frameLayout(label= 'Mental Ray', collapsable= True)
        pm.frameLayout(label= 'Area Light', collapsable= True)
        
        pm.setAttr('%s.areaLight' % (self.light), 1)
        print 'yeah so far so good 01'
        
        self.checkbox_shape = pm.checkBox(label= 'Use Light Shape',value= 1,
                        changeCommand= pm.Callback(self.use_shape))
        
        # setAttr "areaLightShape1.areaType" 1; areaHiSamples areaHiSampleLimit areaLoSamples
        pm.attrEnumOptionMenu( label='Type', attribute='%s.areaType' % (self.light))
        print 'yeah so far so good 02'
        # areaVisible
        value = pm.getAttr('%s.areaHiSamples' % (self.light))
        pm.intSliderGrp(label='High Samples', field= True, value= value,
                       changeCommand= pm.Callback(self.change_hisamples))
        print 'yeah so far so good 03'
        value = pm.getAttr('%s.areaHiSampleLimit' % (self.light))
        pm.intSliderGrp(label='High Sample Limit', field= True, value= value,
                       changeCommand= pm.Callback(self.change_hisample_limit))
        
        value = pm.getAttr('%s.areaLoSamples' % (self.light))
        pm.intSliderGrp(label='Low Samples', field= True, value= value,
                       changeCommand= pm.Callback(self.change_losamples))
        # areaShapeIntensity
        self.checkbox_vis = pm.checkBox(label= 'Visible',
                        changeCommand= pm.Callback(self.visibility))
        
        pm.attrFieldSliderGrp( at='%s.areaShapeIntensity' % (self.light),
                                enable= True, columnWidth4= [100, 75, 175, 50])


       
        pm.setParent(main_frame)
        pm.rowColumnLayout(numberOfColumns= 2, columnWidth= [200, 200])
        pm.button(label= 'Select Light', width= 200, command= pm.Callback(self.select))
        pm.button(label= 'Save Preset', width= 200, command= pm.Callback(self.preset))
        pm.button(label= 'Hide', command= pm.Callback(self.hide))
        pm.button(label= 'Show',  command= pm.Callback(self.show))
        return self.main_layout