// =========================================================================== // 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. // =========================================================================== /// \brief This file defines the attribute editor for our Shaderfx Game Hair Shader. /// \param $nodeName - the name of the node instance to display. /// global proc AEShaderfxGameHairTemplate( string $nodeName ) { if (!`exists( "AEShaderfxShaderTemplate")`) source AEShaderfxShaderTemplate; // the following controls will be in a scrollable layout editorTemplate -beginScrollLayout; // add shaderfx selected node properties and shader attributes layout: editorTemplate -beginLayout "ShaderFX" -collapse 0; editorTemplate -callCustom "ShaderFXGameHairOpenNew" "ShaderFXOpenReplace" ""; editorTemplate -endLayout; // include/call base class/node attributes AEdependNodeTemplate $nodeName; // add any extra attributes that have been added editorTemplate -addExtraControls; // Find the "Extra Attributes" frameLayout and hide it. editorTemplate -callCustom AEShaderFX_suppressExtraNew AEShaderFX_suppressExtraReplace; editorTemplate -endScrollLayout; } global proc ShaderFXGameHairOpenNew( string $attrName ) { // register global for active node name. // we need this because Maya only creates the template ones and does not run // this function again for other shaderfx nodes created. // during ShaderFXOpenReplace we get the opportunity to update what is the active (selected) shaderfx node global string $ShaderFXActiveShaderName[]; // Since maya passes us an attribute ( nodename.attributeName) we strip the attributes since we only want the node name tokenize($attrName, ".", $ShaderFXActiveShaderName); // Normally here we would create a UI control and connect to an attribute // But all we need is a button to launch shaderfx button -label "Open ShaderFX" -width 100 -command ("AEShaderFXOpen()"); frameLayout -label "Settings" -collapse 1 ShaderFXGameHairSettings; setParent ..; frameLayout -label "Attributes" -collapse 0 ShaderFXGameHairProperties; setParent ..; // update node property UI or attribute UI: AEShaderFXPropUI(); }