# -*- coding: utf-8 -*-
import pymel.core as pm
from mtoa.ui.ae.templates import TranslatorControl
from mtoa.ui.ae.shaderTemplate import ShaderAETemplate
import pymel.versions as versions

class AEaiAOVDriverTemplate(ShaderAETemplate):

    def setup(self):
        #mel.eval('AEswatchDisplay "%s"' % nodeName)

        self.beginScrollLayout()

        self.beginLayout('图像格式', collapse=False)
        driverTemplate = TranslatorControl(
                              nodeType='aiAOVDriver',
                              label='')
        driverTemplate._doSetup(self.nodeName)
        #self.addChildTemplate('imageFormat', driverTemplate)
        self.endLayout()

        self.beginLayout("高级输出", collapse=False)
        self.addControl('prefix', label="覆盖路径前缀")
        self.addControl('mergeAOVs', label="合并AOV")
        self.addControl('outputMode', label="输出模式")
        maya_version = versions.shortName()
        if int(float(maya_version)) >= 2017:
            self.addControl('colorManagement', label="颜色管理")

        self.addControl('lightPathExpression')
        self.addControl('lightGroups')


        #self.addControl('customAttributes')
        self.endLayout()

        # include/call base class/node attributes
        pm.mel.AEdependNodeTemplate(self.nodeName)
        
        self.suppress('customAttributes')
        self.suppress('layerHalfPrecision')
        self.suppress('layerTolerance')
        self.suppress('layerEnableFiltering')
        self.addExtraControls()

        self.endScrollLayout()
