// =========================================================================== // 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: June 11, 1997 // // Procedure Name: // AEinputNew // // Description Name; // Creates a custom attribute editor control for a typed attribute type // In most of the cases it will be an input curve/surface/geometry // This procedure only allows single attributes. // // Input Value: // attribute UI name // nodeName.attributeName // // Output Value: // None // global proc AEmultiInputReplace ( string $attributeUIName, string $input ) { setUITemplate -pst attributeEditorTemplate; string $connections[] = `listConnections -d false -sh true $input`; int $numInputs = size( $connections ); int $i; string $textName; int $index; string $buffer[]; tokenize($input, ".", $buffer); string $nodeName = $buffer[0]; string $att = $buffer[1]; setParent ($att + "Column"); $layoutName=`setParent -q`; int $oldCount = `columnLayout -q -nch $layoutName`; for ( $i = 0; $i < $numInputs; $i++ ) { if ( `rowLayout -ex ("row" + $i)` ) { // replace existing one $index = $i + 1; $textName = $attributeUIName + " " + $index; text -e -l $textName inputName; textField -e -tx $connections[$i] ($att+$i); if ($connections[$i] == ""){ symbolButton -e -en 0 goToConnectedInput; } else { symbolButton -e -en 1 -c ("showEditor " + $connections[$i] ) goToConnectedInput; } } else { // add new one rowLayout -nc 3 ("row" + $i); $index = $i + 1; $textName = $attributeUIName + " " + $index; text -l $textName inputName; textField -ed 0 -tx $connections[$i] ($att+$i); if ($connections[$i] == ""){ symbolButton -i "inArrow.png" -en 0 goToConnectedInput; } else { symbolButton -i "inArrow.png" -c ("showEditor " + $connections[$i] ) goToConnectedInput; menuItem -e -l $connections[$i] -c ("showEditor "+$connections[$i]) goToConnectedMenuItem; } setParent ..; } } // delete any remaining layouts that are no longer required for ( $i = $numInputs; $i < $oldCount; $i++ ) { if ( `rowLayout -ex ("row" + $i)` ) { deleteUI ("row" + $i); } } setParent ..; setUITemplate -ppt; } global proc AEmultiInputNew ( string $attributeUIName, string $input ) { setUITemplate -pst attributeEditorTemplate; string $buffer[]; tokenize($input, ".", $buffer); string $nodeName = $buffer[0]; string $att = $buffer[1]; string $connections[] = `listConnections -d false -sh true $input`; int $numInputs = size( $connections ); int $i; string $textName; int $index; columnLayout ($att + "Column"); $layoutName = `setParent -q`; for ( $i = 0; $i < $numInputs; $i++ ) { rowLayout -nc 3 ("row" + $i); $index = $i + 1; $textName = $attributeUIName + " " + $index; text -l $textName inputName; textField -ed 0 -tx $connections[$i] ($att+$i); if ($connections[$i] == ""){ symbolButton -i "inArrow.png" -en 0 goToConnectedInput; } else { symbolButton -i "inArrow.png" -c ("showEditor " + $connections[$i] ) goToConnectedInput; popupMenu -b 3 goToConnectedMenu; menuItem -l $connections[$i] -c ("showEditor "+$connections[$i]) goToConnectedMenuItem; setParent -m ..; } setParent ..; } setParent ..; setUITemplate -ppt; }