# -*- coding: utf-8 -*-
import pymel.core as pm
import mtoa.utils as utils
import mtoa.ui.ae.utils as aeUtils
from mtoa.ui.ae.shaderTemplate import ShaderAETemplate


class AEaiStandardHairTemplate(ShaderAETemplate):
    convertToMayaStyle = True
   
    def setup(self):
        self.addSwatch()

        self.beginScrollLayout()

        self.addCustom('message', 'AEshaderTypeNew', 'AEshaderTypeReplace')
        

        self.beginLayout("颜色", collapse=False)
        self.addControl("base",  label="基础", annotation="Base Weight")
        self.addControl("baseColor", label="基础颜色", annotation="Base Color")
        self.addSeparator()
        self.addControl("melanin",  label="黑色素", annotation="Melanin")
        self.addControl("melaninRedness",  label="黑色素发红", annotation="Melanin Redness")
        self.addControl("melaninRandomize",  label="黑色素随机", annotation="Melanin Randomize")
        self.endLayout()

        self.beginLayout("高光", collapse=False)
        self.addControl("roughness",  label="粗糙度", annotation="Roughness")
        self.addControl("ior",  label="IOR", annotation="IOR")
        self.addControl("shift",  label="偏移", annotation="IOR")
        self.beginLayout("着色", collapse=True)
        self.addControl("specularTint",  label="高光色调", annotation="Specular Tint")
        self.addSeparator()
        self.addControl("specular2Tint",  label="次高光色调", annotation="2dn Specular Tint")
        self.addSeparator()
        self.addControl("transmissionTint",  label="透射色调", annotation="Transmission Tint")
        self.endLayout()
        self.endLayout()

        self.beginLayout("漫反射", collapse=True)
        self.addControl("diffuse",  label="漫反射", annotation="Specular")
        self.addControl("diffuseColor",  label="漫反射颜色", annotation="Specular Tint")
        self.endLayout()

        self.beginLayout("发射", collapse=True)
        self.addControl("emission",  label="发射", annotation="Emission")
        self.addControl("emissionColor",  label="发射颜色", annotation="Emission Color")
        self.endLayout()

        self.addControl("opacity",  label="不透明度", annotation="Opacity")

        self.beginLayout("哑光", collapse=True)
        self.addControl("aiEnableMatte", label="启用哑光")
        self.addControl("aiMatteColor", label="哑光颜色")
        self.addControl("aiMatteColorA", label="哑光不透明度")
        self.endLayout()

        self.beginLayout("高级", collapse=True)
        self.addControl("indirectDiffuse",  label="间接漫反射", annotation="Indirect Diffuse")
        self.addControl("indirectSpecular",  label="间接高光", annotation="Indirect Specular")
        self.endLayout()


        # include/call base class/node attributes
        pm.mel.AEdependNodeTemplate(self.nodeName)

        self.suppress('PhongExponent')
       
        self.addExtraControls()
        self.endScrollLayout()

