// =========================================================================== // 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: // AEblendColorSetsTemplate // // Description Name; // Creates the attribute editor controls for the blendColorSets Node // // Input Value: // nodeName // // Output Value: // None // global proc AEblendColorSetsSwapSets (string $base, string $source) { setUITemplate -pst attributeEditorTemplate; rowLayout -nc 3 -cl3 "center" "center" "center"; text -label ""; button -label (uiRes("m_AEblendColorSetsTemplate.kSwapBaseBlendSets")) -c ("AEblendColorSetsSwapCmd " + $base + " " + $source) swapBtn; text -label ""; setParent ..; setUITemplate -ppt; } global proc AEblendColorSetsSwapReplace (string $base, string $source) { button -e -c ("AEblendColorSetsSwapCmd " + $base + " " + $source) swapBtn; } global proc AEblendColorSetsSwapCmd (string $base, string $source) { string $baseValue = `getAttr $base`; string $sourceValue = `getAttr $source`; setAttr -type "string" $base $sourceValue; setAttr -type "string" $source $baseValue; } global proc AEblendColorSetsDimWeights(string $nodeName){ if (!`objExists $nodeName`) return; string $nodeAttr = $nodeName + ".blendFunc"; string $blend = `getAttr $nodeAttr`; if ($blend == 4)//linear { editorTemplate -dimControl $nodeName "blendWeightA" false; editorTemplate -dimControl $nodeName "blendWeightB" true; editorTemplate -dimControl $nodeName "blendWeightC" true; editorTemplate -dimControl $nodeName "blendWeightD" true; } else if ($blend == 5)//bilinear { editorTemplate -dimControl $nodeName "blendWeightA" false; editorTemplate -dimControl $nodeName "blendWeightB" false; editorTemplate -dimControl $nodeName "blendWeightC" true; editorTemplate -dimControl $nodeName "blendWeightD" true; } else if ($blend == 6)// color { editorTemplate -dimControl $nodeName "blendWeightA" false; editorTemplate -dimControl $nodeName "blendWeightB" false; editorTemplate -dimControl $nodeName "blendWeightC" false; editorTemplate -dimControl $nodeName "blendWeightD" false; } else { editorTemplate -dimControl $nodeName "blendWeightA" true; editorTemplate -dimControl $nodeName "blendWeightB" true; editorTemplate -dimControl $nodeName "blendWeightC" true; editorTemplate -dimControl $nodeName "blendWeightD" true; } } global proc AEblendColorSetsTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEblendColorSetsTemplate.kBlendingControls")) -collapse false; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kBlendStyle")) -addControl "blendFunc" "AEblendColorSetsDimWeights"; string $nodeAttr = $nodeName + ".blendFunc"; string $blend = `getAttr $nodeAttr`; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kPrimaryWeight")) -addControl "blendWeightA"; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kSecondaryWeight")) -addControl "blendWeightB"; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kBlueWeight")) -addControl "blendWeightC"; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kAlphaWeight")) -addControl "blendWeightD"; editorTemplate -addSeparator; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kBaseColorSet")) -addControl "baseColorName"; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kBlendColorSet")) -addControl "srcColorName"; editorTemplate -label (uiRes("m_AEblendColorSetsTemplate.kDestinationColorSet")) -addControl "dstColorName"; editorTemplate -callCustom "AEblendColorSetsSwapSets" "AEblendColorSetsSwapReplace" "baseColorName" "srcColorName"; editorTemplate -endLayout; // include/call base class/node attributes AEpolyBaseTemplate $nodeName; editorTemplate -suppress "inputComponents"; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }