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


class AEaiCurveCollectorTemplate(ShaderAETemplate):

    def setup(self):
        self.beginScrollLayout()
        self.beginLayout("曲线设置", collapse=False)
        self.addControl('aiMode', label='模式')
        
        self.addControl('aiCurveWidth', label='宽度')
        pm.mel.AEaddRampControl(self.nodeName + '.aiWidthProfile')
        self.addSeparator()
        self.addControl('aiSampleRate', label='采样率')

        self.addControl('aiCurveShader', label='着色器')
        self.addControl('aiExportRefPoints', label='导出参考点')

        self.addControl('aiMinPixelWidth', label='最小像素宽度')
        self.addSeparator()
        
        self.addControl("aiUserOptions", label="用户选项")
        self.addSeparator()

        # FIXME is there a way to use the code in templates.py in ShapeMixin ?
        self.addControl("aiOpaque", label="不透明")
        self.addControl("aiMatte", label="哑光")

        self.beginLayout("能见度", collapse=False)
        self.addControl("primaryVisibility", label="摄像机")
        self.addControl("castsShadows", label="阴影")
        self.addControl("aiVisibleInDiffuseReflection", label="漫反射")
        self.addControl("aiVisibleInSpecularReflection", label="镜面反射")
        self.addControl("aiVisibleInDiffuseTransmission", label="漫反射透射")
        self.addControl("aiVisibleInSpecularTransmission", label="镜面透射")
        self.addControl("aiVisibleInVolume", label="体积")
        self.addControl("aiSelfShadows", label="自阴影")
        self.addControl("aiTraceSets", label="跟踪集")
        self.endLayout()

        self.endLayout()

        self.beginLayout('对象显示', collapse=True)
        self.addControl('visibility', label="能见度")
        self.addControl('template', label="模板")
        self.addControl('ghosting', label="重影")
        self.addControl('intermediateObject', label="中间对象")
        self.endLayout()
        
        self.beginLayout('绘制覆盖', collapse=True)
        self.addControl('overrideDisplayType', label="覆盖显示内容")
        self.addControl('overrideLevelOfDetail', label="覆盖细节级别")
        self.addControl('overrideShading', label="覆盖着色")
        self.addControl('overrideTexturing', label="覆盖纹理")
        self.addControl('overridePlayback', label="覆盖播放")
        self.addControl('overrideEnabled', label="覆盖启用")
        self.addControl('useObjectColor', label="使用对象颜色")
        self.addControl('objectColor', label="对象颜色")
        self.endLayout()
    

        # include/call base class/node attributes
        pm.mel.AEdependNodeTemplate(self.nodeName)
        
        self.suppress('blackBox')
        self.suppress('containerType')
        self.suppress('templateName')
        self.suppress('viewName')
        self.suppress('iconName')
        self.suppress('templateVersion')
        self.suppress('uiTreatment')
        self.suppress('customTreatment')
        self.suppress('creator')
        self.suppress('creationDate')
        self.suppress('rmbCommand')
        self.suppress('templatePath')
        self.suppress('viewMode')
        self.suppress('ignoreHwShader')
        self.suppress('boundingBoxScale')
        self.suppress('featureDisplacement')
        self.suppress('boundingBoxScale')
        self.suppress('initialSampleRate')
        self.suppress('extraSampleRate')
        self.suppress('textureThreshold')
        self.suppress('normalThreshold')
        self.suppress('lodVisibility')
        self.suppress('ghostingControl')
        self.suppress('ghostPreSteps')
        self.suppress('ghostPostSteps')
        self.suppress('ghostStepSize')
        self.suppress('ghostRangeStart')
        self.suppress('ghostRangeEnd')
        self.suppress('ghostDriver')
        self.suppress('ghostFrames')
        self.suppress('ghosting')
        self.suppress('ghostCustomSteps')
        self.suppress('ghostColorPreA')
        self.suppress('ghostColorPre')
        self.suppress('ghostColorPostA')
        self.suppress('ghostColorPost')
        self.suppress('tweak')
        self.suppress('relativeTweak')
        self.suppress('currentUVSet')
        self.suppress('displayImmediate')
        self.suppress('displayColors')
        self.suppress('displayColorChannel')
        self.suppress('currentColorSet')
        self.suppress('smoothShading')
        self.suppress('drawOverride')
        self.suppress('shadingSamples')
        self.suppress('maxVisibilitySamplesOverride')
        self.suppress('maxVisibilitySamples')
        self.suppress('antialiasingLevel')
        self.suppress('maxShadingSamples')
        self.suppress('shadingSamplesOverride')
        self.suppress('geometryAntialiasingOverride')
        self.suppress('antialiasingLevel')
        self.suppress('volumeSamplesOverride')
        self.suppress('volumeSamples')
        self.suppress('depthJitter')
        self.suppress('ignoreSelfShadowing')
        self.suppress('controlPoints')
        self.suppress('colorSet')
        self.suppress('uvSet')
        self.suppress('weights')
        self.suppress('renderInfo')
        self.suppress('renderLayerInfo')
        self.suppress('compInstObjGroups')
        self.suppress('instObjGroups')
        self.suppress('collisionOffsetVelocityIncrement')
        self.suppress('collisionOffsetVelocityMultiplier')
        self.suppress('collisionDepthVelocityMultiplier')
        self.suppress('collisionDepthVelocityIncrement')
    

        self.addExtraControls()        
        self.endScrollLayout()
