// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // AEmaterialInfoTemplate // // Description Name; // Creates the attribute editor controls for the materialInfo Node // // Input Value: // nodeName // // Output Value: // None // global proc AEgoToMIConnected ( string $connected ) { select $connected; editSelected; } global proc AEshowMIConnectionsReplace ( string $shadingGroup, string $material, string $texture ) { string $conShadGrp[] = `listConnections $shadingGroup`; textField -e -tx $conShadGrp[0] shadingGroupConnected; if ($conShadGrp[0] == ""){ symbolButton -e -en 0 goToConnectedShadingGroup; } else { symbolButton -e -c ("AEgoToMIConnected " + $conShadGrp[0] ) goToConnectedShadingGroup; } string $conMat[] = `listConnections $material`; textField -e -tx $conMat[0] materialConnected; if ($conMat[0] == ""){ symbolButton -e -en 0 goToConnectedMaterial; } else { symbolButton -e -c ("AEgoToMIConnected " + $conMat[0] ) goToConnectedMaterial; } string $conTxt[] = `listConnections $texture`; textField -e -tx $conTxt[0] textureConnected; if ($conTxt[0] == ""){ symbolButton -e -en 0 goToConnectedTexture; } else { symbolButton -e -c ("AEgoToMIConnected " + $conTxt[0] ) goToConnectedTexture; } } global proc AEshowMIConnectionsNew ( string $shadingGroup, string $material, string $texture ) { setUITemplate -pst attributeEditorTemplate; string $conShadGrp[] = `listConnections $shadingGroup`; rowLayout -nc 3; text -label (uiRes("m_AEmaterialInfoTemplate.kShadingGroup")) shadingGroupName; textField -ed 0 -tx $conShadGrp[0] shadingGroupConnected; if ($conShadGrp[0] == ""){ symbolButton -i "inArrow.png" -en 0 goToConnectedShadingGroup; } else { symbolButton -i "inArrow.png" -c ("AEgoToMIConnected " + $conShadGrp[0] ) goToConnectedShadingGroup; } setParent ..; string $conMat[] = `listConnections $material`; rowLayout -nc 3; text -label (uiRes("m_AEmaterialInfoTemplate.kMaterial")) materialName; textField -ed 0 -tx $conMat[0] materialConnected; if ($conMat[0] == ""){ symbolButton -i "inArrow.png" -en 0 goToConnectedMaterial; } else { symbolButton -i "inArrow.png" -c ("AEgoToMIConnected " + $conMat[0] ) goToConnectedMaterial; } setParent ..; string $conTxt[] = `listConnections $texture`; rowLayout -nc 3; text -label (uiRes("m_AEmaterialInfoTemplate.kTexture")) textureName; textField -ed 0 -tx $conTxt[0] textureConnected; if ($conTxt[0] == ""){ symbolButton -i "inArrow.png" -en 0 goToConnectedTexture; } else { symbolButton -i "inArrow.png" -c ("AEgoToMIConnected " + $conTxt[0] ) goToConnectedTexture; } setParent ..; setUITemplate -ppt; } global proc AEmaterialInfoTemplate ( string $nodeName ) { AEswatchDisplay $nodeName; editorTemplate -beginScrollLayout; editorTemplate -callCustom "AEshowMIConnectionsNew" "AEshowMIConnectionsReplace" "shadingGroup" "material" "texture"; editorTemplate -addControl "texturePlug"; editorTemplate -suppress "textureChannel"; // include/call base class/node attributes AEdependNodeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }