import maya.mel
from mtoa.ui.ae.shaderTemplate import ShaderAETemplate

class AEapMicrofacetRefractionBSDFTemplate(ShaderAETemplate):
    def setup(self):
        self.addSwatch()
        self.beginScrollLayout()
        self.beginLayout("BSDF Attribues", collapse=False)
        self.addControl('weight', label='Weight')
        self.addControl('distribute', label='Distribute', annotation='MICROFACET_BECKMANN or MICROFACET_GGX')
        self.addControl('eta', label='IOR', annotation='Refractive index for Fresnel, use 0 to disable Fresnel')
        self.addControl('roughness_u', label='Roughness U', annotation='Specular roughness along the U direction')
        self.addControl('roughness_v', label='Roughness V', annotation='Specular roughness along the V direction')
        self.addControl('dispersion', label='Dispersion', annotation='Cauchy coefficient for dispersion. zero for no dispersion, higher values give more dispersion')
        self.addControl('use_fresnel', label='Use Fresnel', annotation='Set to true to include Fresnel term')
        self.addControl('interior', label='Interior', annotation='Volume closures that define the interior of the object, like volume absorption')
        self.addControl('exit_type', label='Exit Type', annotation='zero, background or white')
        self.addControl('opacity', label='Opacity')
        self.endLayout()
        maya.mel.eval('AEdependNodeTemplate '+self.nodeName)
        self.addExtraControls()
        self.endScrollLayout()
        