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

class AEapTextureRandomTemplate(ShaderAETemplate):
    def setup(self):
        self.addSwatch()
        self.beginScrollLayout()
        self.beginLayout('Color', collapse=False)
        self.addControl('default_color', label='Default Color', annotation='Default Color')
        self.addControl('background', label='Background', annotation='Background Color')
        self.addControl('background_alpha', label='Background Alpha', annotation='Background Color')
        self.endLayout()

        self.beginLayout("Inputs", collapse=False)
        self.addControl('num_layer', label='Num of Layers', annotation='Number of Layer for Randomized')
        self.addControl('color0', label='Color 0', annotation='Color Input 0')
        self.addControl('alpha0', label='Alpha 0', annotation='Alpha Input 0')
        self.addControl('color1', label='Color 1', annotation='Color Input 1')
        self.addControl('alpha1', label='Alpha 1', annotation='Alpha Input 1')
        self.addControl('color2', label='Color 2', annotation='Color Input 2')
        self.addControl('alpha2', label='Alpha 2', annotation='Alpha Input 2')
        self.addControl('color3', label='Color 3', annotation='Color Input 3')
        self.addControl('alpha3', label='Alpha 3', annotation='Alpha Input 3')
        self.endLayout()

        self.beginLayout('Randomize Controls', collapse=False)
        self.addControl('scale', label='Scale', annotation='UV Scale')
        self.addControl('seed', label='Seed', annotation='Random Seed')
        self.addControl('probability', label='Probability', annotation='Probability of distribution')
        self.addControl('pos_random', label='Position', annotation='Position Random')
        self.addControl('scale_min', label='Scale Min', annotation='Scale Minimum Value')
        self.addControl('scale_max', label='Scale Max', annotation='Scale Maximum Value')
        self.addControl('uniform_scale', label='Uniform Scale', annotation='Uniform Scale')
        # self.addControl('pixel_scale', label='Pixel Scale', annotation='Pixel Scale')
        self.addControl('rotate_min', label='Rotate Min', annotation='Rotate Minimum Value')
        self.addControl('rotate_max', label='Rotate Max', annotation='Rotate Maximum Value')
        self.addControl('rotate_step', label='Rotate Step', annotation='Rotate Step')
        self.addControl('overlap', label='Overlap', annotation='Overlap')
        self.endLayout()

        self.beginLayout('Color Randomize', collapse=False)
        self.addControl('hsv_min', label='HSV Min', annotation='Minimum HSV Value')
        self.addControl('hsv_max', label='HSV Max', annotation='Maximum HSV Value')
        self.addControl('alpha_min', label='Alpha Min', annotation='Minimum Alpha Value')
        self.addControl('alpha_max', label='Alpha Max', annotation='Maximum Alpha Value')
        self.addControl('gamma_min', label='Gamma Min', annotation='Minimum Gamma Value')
        self.addControl('gamma_max', label='Gamma Max', annotation='Maximum Gamma Value')
        self.addControl('auto_gamma', label='Auto Gamma', annotation='Auto Gamma (Input Mode:File Only)')
        self.addControl('manual_gamma', label='Manual Gamma', annotation='Manual Gamma Value')
        self.addControl('clamp', label='Clamp', annotation='Clamp Max Value to 1');
    
        self.endLayout()

        maya.mel.eval('AEdependNodeTemplate '+self.nodeName)
        self.addExtraControls()
        self.endScrollLayout()