Exemple #1
0
 def createLightColorTemperatureUI(self, attrName):
     cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True)
     isEnabled = True
     isEnabled = cmds.getAttr(self.nodeAttr('aiUseColorTemperature'))
     aeUtils.attrBoolControlGrp(
         self.checkBoxName,
         attribute=self.nodeAttr('aiUseColorTemperature'),
         label='Use Color Temperature',
         changeCommand=self.updateUseColorTemperature)
     cmds.setParent('..')
     cmds.rowLayout(numberOfColumns=2,
                    columnWidth2=(80, 220),
                    adjustableColumn=2,
                    columnAttach=[(1, 'left', 0), (2, 'left', -10)])
     cmds.canvas(self.canvasName, width=65, height=12)
     cmds.attrFieldSliderGrp(self.sliderName,
                             label='Temperature',
                             width=220,
                             attribute=self.nodeAttr('aiColorTemperature'),
                             enable=isEnabled,
                             precision=0,
                             columnWidth=[(1, 70), (2, 70), (3, 80)],
                             changeCommand=self.updateColorTemperature)
     cmds.setParent('..')
     colorTemp = cmds.arnoldTemperatureToColor(
         cmds.getAttr(self.nodeAttr('aiColorTemperature')))
     cmds.canvas(self.canvasName, edit=True, rgbValue=colorTemp)
     cmds.setUITemplate(popTemplate=True)
Exemple #2
0
 def updateColorTemperature(self, *args, **kwargs):
     try:
         temperature = cmds.getAttr(self.nodeAttr('aiColorTemperature'))
         colorTemp = cmds.arnoldTemperatureToColor(temperature)
         cmds.canvas(self.canvasName, edit=True, rgbValue=colorTemp)
     except:
         pass
Exemple #3
0
 def updateColorTemperature(self, *args, **kwargs):
     try:
         temperature = cmds.getAttr(self.nodeAttr('aiColorTemperature'))
         colorTemp = cmds.arnoldTemperatureToColor(temperature)
         cmds.canvas(self.canvasName, edit=True, rgbValue=colorTemp)
     except:
         pass
Exemple #4
0
 def updateLightColorTemperatureUI(self, attrName):
     isEnabled = True
     isEnabled = cmds.getAttr(self.nodeAttr('aiUseColorTemperature'))
     aeUtils.attrBoolControlGrp(self.checkBoxName, edit=True, attribute=self.nodeAttr('aiUseColorTemperature'), 
                                changeCommand=self.updateUseColorTemperature)
     cmds.attrFieldSliderGrp(self.sliderName, edit=True, 
                             attribute=self.nodeAttr('aiColorTemperature'), enable=isEnabled,
                             changeCommand=self.updateColorTemperature)
     colorTemp = cmds.arnoldTemperatureToColor(cmds.getAttr(self.nodeAttr('aiColorTemperature')))
     cmds.canvas(self.canvasName, edit=True, rgbValue=colorTemp)
Exemple #5
0
 def updateLightColorTemperatureUI(self, attrName):
     isEnabled = True
     isEnabled = cmds.getAttr(self.nodeAttr('aiUseColorTemperature'))
     aeUtils.attrBoolControlGrp(
         self.checkBoxName,
         edit=True,
         attribute=self.nodeAttr('aiUseColorTemperature'),
         changeCommand=self.updateUseColorTemperature)
     cmds.attrFieldSliderGrp(self.sliderName,
                             edit=True,
                             attribute=self.nodeAttr('aiColorTemperature'),
                             enable=isEnabled,
                             changeCommand=self.updateColorTemperature)
     colorTemp = cmds.arnoldTemperatureToColor(
         cmds.getAttr(self.nodeAttr('aiColorTemperature')))
     cmds.canvas(self.canvasName, edit=True, rgbValue=colorTemp)
Exemple #6
0
    def set_aiColorTemperature(self):
        print(self.tempertaure)
        temperature = cmds.intSliderGrp(self.tempertaure, q=True, value=True)
        colorTemp = cmds.arnoldTemperatureToColor(temperature)
        displayColor = colorTemp
        if maya.mel.eval("exists \"colorManagementConvert\""):
            displayColor = cmds.colorManagementConvert(toDisplaySpace=colorTemp)

        displayColor[0] = min(max(displayColor[0], 0.0), 1.0)
        displayColor[1] = min(max(displayColor[1], 0.0), 1.0)
        displayColor[2] = min(max(displayColor[2], 0.0), 1.0)
        cmds.canvas(self.canvasName, edit=True, rgbValue=displayColor)
        for light in self.current_selected_lights:
            try:
                cmds.setAttr("%s.aiColorTemperature" % light, temperature)
            except:
                continue
Exemple #7
0
 def createLightColorTemperatureUI(self, attrName):
     cmds.setUITemplate('attributeEditorPresetsTemplate', pushTemplate=True)
     isEnabled = True
     isEnabled = cmds.getAttr(self.nodeAttr('aiUseColorTemperature'))
     aeUtils.attrBoolControlGrp(self.checkBoxName, attribute=self.nodeAttr('aiUseColorTemperature'),
                                label='Use Color Temperature', changeCommand=self.updateUseColorTemperature)
     cmds.setParent('..')        
     cmds.rowLayout(numberOfColumns=2, columnWidth2=(80,220), adjustableColumn=2, columnAttach=[(1, 'left', 0), (2, 'left', -10)])
     cmds.canvas(self.canvasName, width=65, height=12)
     cmds.attrFieldSliderGrp(self.sliderName, label='Temperature', width=220, 
                             attribute=self.nodeAttr('aiColorTemperature'),
                             enable=isEnabled,
                             precision=0, columnWidth=[(1, 70), (2, 70), (3, 80)], changeCommand=self.updateColorTemperature)
     cmds.setParent('..')
     colorTemp = cmds.arnoldTemperatureToColor(cmds.getAttr(self.nodeAttr('aiColorTemperature')))
     cmds.canvas(self.canvasName, edit=True, rgbValue=colorTemp)
     cmds.setUITemplate(popTemplate=True)