// =========================================================================== // 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. // =========================================================================== // // // Creation Date: July 7, 1997 // // Procedure Name: // AEperParticleNew // // Description: // Creates attribute editor controls for perParticle Attributes // // Input Value: // attributeUIName // attributeType (vector, float) // perParticleAttr (nodeName + attributeName) // // Output Value: // None // global proc AEperParticleNew ( string $attributeUIName, string $type, string $perParticleAttr ) { string $nodeName[]; tokenize($perParticleAttr, ".", $nodeName); string $layoutName = ($nodeName[1] + "RowLayout"); if (`attributeQuery -exists -node $nodeName[0] $nodeName[1]`) { setUITemplate -pst attributeEditorPresetsTemplate; rowLayout -nc 4 -vis 0 -cat 1 right 5 -cat 2 both 0 -cat 3 both 0 -cat 4 both 0 $layoutName; text -l $attributeUIName ; button -label (uiRes("m_AEperParticleNew.kExprEd")) -c ( "particleExpressionEditor " + $perParticleAttr ) ($nodeName[1] + "ExprEditButton"); button -label (uiRes("m_AEperParticleNew.kCompEd")) -c "componentEditorWindow" ($nodeName[1] + "CompEditButton"); button -label (uiRes("m_AEperParticleNew.kRamp")) -c ("ArrayMapperWnd " + $nodeName[0] + " " + $nodeName[1] ) ($nodeName[1] + "RampButton"); setParent ..; rowLayout -e -vis 1 $layoutName; setUITemplate -ppt; } } global proc AEperParticleReplace ( string $attributeUIName, string $type, string $perParticleAttr ) { string $nodeName[]; tokenize($perParticleAttr, ".", $nodeName); string $layoutName = ( $nodeName[1] + "RowLayout" ); if (`attributeQuery -exists -node $nodeName[0] $nodeName[1]`) { if (`rowLayout -exists $layoutName`) { button -e -c ( "particleExpressionEditor " + $perParticleAttr ) ($nodeName[1] + "ExprEditButton"); button -e -c "componentEditorWindow" ($nodeName[1] + "CompEditButton"); button -e -c ("ArrayMapperWnd " + $nodeName[0] + " " + $nodeName[1] ) ($nodeName[1] + "RampButton"); } else { AEperParticleNew $attributeUIName $type $perParticleAttr; } } else if (`rowLayout -exists $layoutName`){ rowLayout -e -vis 0 $layoutName; deleteUI -layout $layoutName; } }