Exemple #1
0
def add_aov(aov_name):
    aov_names = [i.name for i in aovs.getAOVs()]
    if aov_name not in aov_names:
        try:
            aovs.AOVInterface().addAOV(aov_name)
        except:
            pass
    def updateLayerHalfPrecision(self):
        aovList = aovs.getAOVs(enabled=True)

        deepexrHalfPrecisionTemplates[:] = [
            tup for tup in deepexrHalfPrecisionTemplates
            if cmds.columnLayout(tup, exists=True)
        ]
        for templateName in deepexrHalfPrecisionTemplates:
            cmds.setParent(templateName)
            for child in cmds.columnLayout(
                    templateName, query=True, childArray=True) or []:
                cmds.deleteUI(child)
            cmds.attrControlGrp(label='alpha',
                                a='defaultArnoldDriver.alphaHalfPrecision')
            cmds.attrControlGrp(label='depth',
                                a='defaultArnoldDriver.depthHalfPrecision')
            cmds.attrControlGrp(label='beauty',
                                a='defaultArnoldDriver.layerHalfPrecision[0]')
            for i in range(0, len(aovList)):
                if aovList[i].node.attr('outputs')[0].driver.inputs()[0].name(
                ) == 'defaultArnoldDriver':
                    labelStr = aovList[i].name
                    attrStr = 'defaultArnoldDriver.layerHalfPrecision[' + str(
                        i + 1) + ']'
                    cmds.attrControlGrp(label=labelStr, a=attrStr)
Exemple #3
0
    def buildAOVFrame(self, nodeAttr):
        # TODO: move this into AttributeEditorTemplate
        self._setActiveNodeAttr(nodeAttr)
        nodeAttr = pm.Attribute(nodeAttr)

        aovList = aovs.getAOVs()
        self.updateNetworkData()
        self.updateCustomArrayData(nodeAttr, aovList)

        pm.setUITemplate('attributeEditorTemplate', pushTemplate=True)

        pm.cmds.frameLayout(label='AOVs', collapse=False)
        pm.cmds.columnLayout(adjustableColumn=True)

        pm.cmds.frameLayout(label='Surface Shader AOVs', collapse=False)
        pm.cmds.columnLayout(adjustableColumn=True)

        pm.cmds.rowLayout(nc=2)
        pm.cmds.text(label='')
        pm.cmds.button(
            label='AOV Browser',
            c=lambda *args: aoveditor.arnoldAOVBrowser(
                listAOVGroups=True, nodeTypes=self.networkNodeTypes))
        pm.setParent('..')  # rowLayout

        pm.cmds.frameLayout(labelVisible=False, collapsable=False)
        self.networkCol = pm.cmds.columnLayout(adjustableColumn=True)
        self.buildNetworkAOVs(nodeAttr, aovList)
        pm.setParent('..')  # columnLayout
        pm.setParent('..')  # frameLayout

        pm.setParent('..')  # columnLayout
        pm.setParent('..')  # frameLayout

        pm.cmds.frameLayout(label='Other AOVs', collapse=False)
        pm.cmds.columnLayout(adjustableColumn=True)

        pm.cmds.rowLayout(nc=2)
        pm.cmds.text(label='')
        pm.cmds.button(label='Add Custom',
                       c=lambda *args: shaderTemplate.newAOVPrompt())
        pm.setParent('..')  # rowLayout

        pm.cmds.frameLayout(labelVisible=False, collapsable=False)
        self.otherCol = pm.cmds.columnLayout(adjustableColumn=True)
        self.buildOtherAOVs(nodeAttr, aovList)
        pm.setParent('..')  # columnLayout
        pm.setParent('..')  # frameLayout

        pm.setParent('..')  # columnLayout
        pm.setParent('..')  # frameLayout

        pm.setParent('..')  # columnLayout
        pm.setParent('..')  # frameLayout
        pm.setUITemplate('attributeEditorTemplate', popTemplate=True)
    def buildAOVFrame(self, nodeAttr):
        # TODO: move this into AttributeEditorTemplate
        self._setActiveNodeAttr(nodeAttr)
        nodeAttr = pm.Attribute(nodeAttr)

        aovList = aovs.getAOVs()
        self.updateNetworkData()
        self.updateCustomArrayData(nodeAttr, aovList)

        pm.setUITemplate('attributeEditorTemplate', pushTemplate=True)

        pm.cmds.frameLayout(label='AOVs', collapse=False)
        pm.cmds.columnLayout(adjustableColumn=True)

        pm.cmds.frameLayout(label='Surface Shader AOVs', collapse=False)
        pm.cmds.columnLayout(adjustableColumn=True)
        
        pm.cmds.rowLayout(nc=2)
        pm.cmds.text(label='')
        pm.cmds.button(label='AOV Browser',
                       c=lambda *args: aoveditor.arnoldAOVBrowser(listAOVGroups=True,
                                                                  nodeTypes=self.networkNodeTypes))
        pm.setParent('..') # rowLayout

        pm.cmds.frameLayout(labelVisible=False, collapsable=False)
        self.networkCol = pm.cmds.columnLayout(adjustableColumn=True)
        self.buildNetworkAOVs(nodeAttr, aovList)
        pm.setParent('..') # columnLayout
        pm.setParent('..') # frameLayout

        pm.setParent('..') # columnLayout
        pm.setParent('..') # frameLayout

        pm.cmds.frameLayout(label='Other AOVs', collapse=False)
        pm.cmds.columnLayout(adjustableColumn=True)

        pm.cmds.rowLayout(nc=2)
        pm.cmds.text(label='')
        pm.cmds.button(label='Add Custom', c=lambda *args: shaderTemplate.newAOVPrompt())
        pm.setParent('..') # rowLayout

        pm.cmds.frameLayout(labelVisible=False, collapsable=False)
        self.otherCol = pm.cmds.columnLayout(adjustableColumn=True)
        self.buildOtherAOVs(nodeAttr, aovList)
        pm.setParent('..') # columnLayout
        pm.setParent('..') # frameLayout

        pm.setParent('..') # columnLayout
        pm.setParent('..') # frameLayout
        
        pm.setParent('..') # columnLayout
        pm.setParent('..') # frameLayout
        pm.setUITemplate('attributeEditorTemplate', popTemplate=True)
 def updateLayerEnableFiltering(self):
     aovList = aovs.getAOVs(enabled=True)
     
     deepexrEnableFilteringTemplates[:] = [tup for tup in deepexrEnableFilteringTemplates if cmds.columnLayout(tup, exists=True)]
     for templateName in deepexrEnableFilteringTemplates:
         cmds.setParent(templateName)
         for child in cmds.columnLayout(templateName, query=True, childArray=True) or []:
             cmds.deleteUI(child)
         cmds.attrControlGrp(label='beauty' , a='defaultArnoldDriver.layerEnableFiltering[0]' )
         for i in range(0,len(aovList)):
             if aovList[i].node.attr('outputs')[0].driver.inputs()[0].name() == 'defaultArnoldDriver':
                 labelStr = aovList[i].name
                 attrStr = 'defaultArnoldDriver.layerEnableFiltering['+str(i+1)+']'
                 cmds.attrControlGrp(label=labelStr , a=attrStr )
 def updateLayerTolerance(self):
     aovList = aovs.getAOVs(enabled=True)
     
     deepexrToleranceTemplates[:] = [tup for tup in deepexrToleranceTemplates if cmds.columnLayout(tup, exists=True)]
     for templateName in deepexrToleranceTemplates:
         cmds.setParent(templateName)
         for child in cmds.columnLayout(templateName, query=True, childArray=True) or []:
             cmds.deleteUI(child)
             
         cmds.attrFieldSliderGrp(label='alpha' , at='defaultArnoldDriver.alphaTolerance' )
         cmds.attrFieldSliderGrp(label='depth' , at='defaultArnoldDriver.depthTolerance' )
         cmds.attrFieldSliderGrp(label='beauty' , at='defaultArnoldDriver.layerTolerance[0]' )
         for i in range(0,len(aovList)):
             if aovList[i].node.attr('outputs')[0].driver.inputs()[0].name() == 'defaultArnoldDriver':
                 labelStr = aovList[i].name
                 attrStr = 'defaultArnoldDriver.layerTolerance['+str(i+1)+']'
                 cmds.attrFieldSliderGrp(label=labelStr , at=attrStr )
    def updateAOVFrame(self, nodeAttr):
        # TODO: move this into AttributeEditorTemplate
        self._setActiveNodeAttr(nodeAttr)
        nodeAttr = pm.Attribute(nodeAttr)

        self.updateNetworkData()
        for ctrl in self._msgCtrls:
            pm.deleteUI(ctrl)
        self._msgCtrls = []

        pm.setUITemplate('attributeEditorTemplate', pushTemplate=True)

        aovList = aovs.getAOVs()
        self.updateCustomArrayData(nodeAttr, aovList)

        pm.setParent(self.networkCol)
        self.buildNetworkAOVs(nodeAttr, aovList)

        pm.setParent(self.otherCol)
        self.buildOtherAOVs(nodeAttr, aovList)

        pm.setUITemplate('attributeEditorTemplate', popTemplate=True)
Exemple #8
0
    def updateAOVFrame(self, nodeAttr):
        # TODO: move this into AttributeEditorTemplate
        self._setActiveNodeAttr(nodeAttr)
        nodeAttr = pm.Attribute(nodeAttr)

        self.updateNetworkData()
        for ctrl in self._msgCtrls:
            pm.deleteUI(ctrl)
        self._msgCtrls = []

        pm.setUITemplate('attributeEditorTemplate', pushTemplate=True)

        aovList = aovs.getAOVs()
        self.updateCustomArrayData(nodeAttr, aovList)

        pm.setParent(self.networkCol)
        self.buildNetworkAOVs(nodeAttr, aovList)

        pm.setParent(self.otherCol)
        self.buildOtherAOVs(nodeAttr, aovList)

        pm.setUITemplate('attributeEditorTemplate', popTemplate=True)
Exemple #9
0
 def get_aov_name_lists(self, *args):
     if self.renderer == "arnold":
         return [i.name for i in aovs.getAOVs()]
     elif self.renderer == "mentalRay":
         return [i.name() for i in pm.ls(type="renderPass")]
Exemple #10
0
def get_aov_name_lists():
    return [i.name for i in aovs.getAOVs()]
Exemple #11
0
def get_aov_names():
    aov_names = [i.name for i in aovs.getAOVs()]
    return aov_names