// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // provided at the time of installation or download, or which otherwise accompanies // // Procedures specifying the UI layout for ilrHwBakeVisualizer // in Maya's Attribute Editor // global proc AEilrHwBakeVizShReloadNew(string $attr) { setUITemplate -pst attributeEditorTemplate; columnLayout -columnAttach "right" 0 -columnWidth 226; button -label "Reload" -width 80 -align "center" ilrHwBakeVisualizerCmdBtn; setParent ..; setUITemplate -ppt; AEilrHwBakeVizShReload($attr); } global proc AEilrHwBakeVizShReload(string $attr) { string $node; string $buffer[]; tokenize($attr, ".", $buffer); $node = $buffer[0]; button -edit -command ("ilrHwBakeVisualizerCmd -reloadsh -node " + $node) ilrHwBakeVisualizerCmdBtn; } global proc AEilrHwBakeVizShFileAssignCB(string $fileAttribute, string $filename, string $fileType) { setAttr $fileAttribute -type "string" $filename; string $node; string $buffer[]; tokenize($fileAttribute, ".", $buffer); $node = $buffer[0]; $cmd = "ilrHwBakeVisualizerCmd -reloadsh -node " + $node; print($cmd + "\n"); eval($cmd); } global proc AEilrHwBakeVizShFileBrowser(string $cmd) { string $workspace = `workspace -q -fn`; setWorkingDirectory $workspace "image" "sourceImages"; fileBrowser ($cmd, "Open", "", 0); } global proc AEilrHwBakeVizShFileFieldCommand(string $fileAttribute) { $filename = `getAttr $fileAttribute`; $filetype = ""; AEilrHwBakeVizShFileAssignCB($fileAttribute, $filename, $filetype); } global proc AEilrHwBakeVizShFileNew(string $fileAttribute) { setUITemplate -pst attributeEditorTemplate; rowLayout -nc 3 ilrHwBakeVizShFileLayout; text -l "Input File"; textField ilrHwBakeVizShFileField; symbolButton -image "navButtonBrowse.xpm" ilrHwBakeVizShFileBrowserBtn; setParent ..; setUITemplate -ppt; AEilrHwBakeVizShFileReplace $fileAttribute; } global proc AEilrHwBakeVizShFileReplace(string $fileAttribute) { connectControl -fileName ilrHwBakeVizShFileField $fileAttribute; string $buttoncommand = "AEilrHwBakeVizShFileAssignCB "+" "+$fileAttribute; button -e -c ("AEilrHwBakeVizShFileBrowser \"" + $buttoncommand + "\"" ) ilrHwBakeVizShFileBrowserBtn; string $fieldcommand = "AEilrHwBakeVizShFileFieldCommand "+" "+$fileAttribute; textField -e -cc $fieldcommand ilrHwBakeVizShFileField; } global proc AEilrHwBakeVisualizerTemplate(string $node) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout "Material Attributes"; editorTemplate -l "Color" -ac "color"; editorTemplate -l "Alpha" -ac "alpha"; editorTemplate -l "Ambient" -ac "ambientColor"; editorTemplate -l "Incandescence" -ac "incandescence"; editorTemplate -l "Light Map" -ac "lightMap"; editorTemplate -endLayout; editorTemplate -beginLayout "Specular Shading"; editorTemplate -l "Cosine Power" -ac "cosinePower"; editorTemplate -l "Specular Color" -ac "specularColor"; editorTemplate -endLayout; editorTemplate -beginLayout "Height Map"; editorTemplate -l "Height Map" -ac "heightMap"; editorTemplate -l "Offset" -ac "heightOffset"; editorTemplate -l "Scale" -ac "heightScale"; editorTemplate -endLayout; editorTemplate -beginLayout "Normal Map"; editorTemplate -label "Coordinate System" -adc "coordSys"; editorTemplate -label "Normal Map" -ac "normalMap"; editorTemplate -endLayout; editorTemplate -beginLayout "Directional Occlusion"; editorTemplate -label "Scale values" -ac "dirOccScaleValues"; editorTemplate -label "Vector 1" -ac "dirOccVec1"; editorTemplate -label "Vector 2" -ac "dirOccVec2"; editorTemplate -label "Vector 3" -ac "dirOccVec3"; editorTemplate -label "Vector 4" -ac "dirOccVec4"; editorTemplate -endLayout; editorTemplate -beginLayout "Radiosity Normal Map"; editorTemplate -label "Radiosity Map 1" -ac "rnm1"; editorTemplate -label "Radiosity Map 2" -ac "rnm2"; editorTemplate -label "Radiosity Map 3" -ac "rnm3"; editorTemplate -endLayout; editorTemplate -beginLayout "Spherical Harmonics (Vertex Lighting)"; editorTemplate -label "Coordinate System" -adc "vtxShCoordSys"; editorTemplate -callCustom "AEilrHwBakeVizShFileNew" "AEilrHwBakeVizShFileReplace" "vtxShInputFile"; editorTemplate -s "vtxShInputFile"; editorTemplate -callCustom "AEilrHwBakeVizShReloadNew" "AEilrHwBakeVizShReload" "message"; editorTemplate -endLayout; editorTemplate -beginLayout "Polynomial Texture Map"; editorTemplate -label "(Red) Light ABC" -ac "lightABC"; editorTemplate -label "(Red) Light DEF" -ac "lightDEF"; editorTemplate -label "Green Light ABC" -ac "glightABC"; editorTemplate -label "Green Light DEF" -ac "glightDEF"; editorTemplate -label "Blue Light ABC" -ac "blightABC"; editorTemplate -label "Blue Light DEF" -ac "blightDEF"; editorTemplate -label "Back Face Transition" -ac "transition"; editorTemplate -endLayout; editorTemplate -beginLayout "Hardware Shader Features"; editorTemplate -beginNoOptimize; editorTemplate -label "Alpha" -ac "alphaEnabled"; editorTemplate -label "Ambient" -ac "ambientColorEnabled"; editorTemplate -label "Incandescence" -ac "incandescenceEnabled"; editorTemplate -label "Light Map" -ac "lightMapEnabled"; editorTemplate -label "Specular Color" -ac "specularColorEnabled"; editorTemplate -label "Height Map" -ac "heightMapEnabled"; editorTemplate -label "Normal Map" -ac "normalMapEnabled"; editorTemplate -label "Directional Occlusion" -ac "directionalOcclusionEnabled"; editorTemplate -label "Radiosity Normal Map" -ac "rnmEnabled"; editorTemplate -label "Spherical Harmonics (Vertex Lighting)" -ac "vtxShEnabled"; editorTemplate -addSeparator; editorTemplate -label "Polynomial Texture Map" -ac "ptmEnabled"; editorTemplate -label "RGB" -ac "rgbEnabled"; editorTemplate -label "Extract Normal" -ac "extractNormalEnabled"; editorTemplate -endNoOptimize; editorTemplate -endLayout; editorTemplate -beginLayout "Hardware Texture Cache"; editorTemplate -callCustom "AEilrHardwareTextureCacheNew" "AEilrHardwareTextureCacheReload" "message"; editorTemplate -endLayout; // include/call base class/node attributes AEdependNodeTemplate $node; // suppressed attributes editorTemplate -s "version"; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }