// =========================================================================== // 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: 09 Feb 2004 // // Description: // This is part of a set of methods for changing // a property sheet to point to a new node. // (A way of efficiently re-using existing controls) // This method re-connects a control of matrix type. // // Input Arguments: // The name of the existing control // The name of the new plug // // Return Value: // None // global proc AEreplaceMatrix ( string $controlName, string $plugName, string $changedCommand ) { string $floatFieldGrps[] = `columnLayout -q -ca $controlName`; float $val[] = `getAttr $plugName`; string $buffer[]; tokenize($plugName, ".", $buffer); string $node = (size($buffer) > 0) ? $buffer[0] : ""; string $attr = (size($buffer) > 0) ? $buffer[size($buffer) - 1] : ""; // AEnewMatrix gets the lovely looked-up version of // $attrName passed in, but doesn't do anything with it. // AEreplaceMatrix, then, is stuck doing a nice name query // as a last resort, since the lookup is thrown away. // string $attrUI = `attributeName -nice $plugName`; string $cmd ; if( $changedCommand == "" ) $cmd = "AEupdateMatrix(\"" + $controlName + "\",\"" + $plugName + "\")"; else $cmd = $changedCommand+" \""+$node+"\""; floatFieldGrp -edit -label $attrUI -v1 $val[0] -v2 $val[1] -v3 $val[2] -v4 $val[3] -cc $cmd $floatFieldGrps[0]; floatFieldGrp -edit -v1 $val[4] -v2 $val[5] -v3 $val[6] -v4 $val[7] -cc $cmd $floatFieldGrps[1]; floatFieldGrp -edit -v1 $val[8] -v2 $val[9] -v3 $val[10] -v4 $val[11] -cc $cmd $floatFieldGrps[2]; floatFieldGrp -edit -v1 $val[12] -v2 $val[13] -v3 $val[14] -v4 $val[15] -cc $cmd $floatFieldGrps[3]; }