// =========================================================================== // 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 14, 1997 // // Procedure Name: // AEreplaceTime // // Description Name; // Updates the timeFieldGrp to reflect a new selection // // Input Value: // The control name, plug name and changedCommand // // Output Value: // none // global proc AEreplaceTime(string $controlName, string $plugName, string $changedCommand ) { string $buffer[]; tokenize($plugName, ".", $buffer); string $node = (size($buffer) > 0) ? $buffer[0] : ""; // Change the label on the control to match the new // plug's attribute name for the case of dynamic attributes only if( `timeFieldGrp -exists $controlName` ) { string $attrName[] = `listAttr -userDefined $plugName`; if( size( $attrName ) == 1 ) { string $niceName = `attributeName -nice ($node + "." + $attrName[0])`; timeFieldGrp -e -label $niceName $controlName; } } // connect the control with the attribute // connectControl -index 2 $controlName $plugName; if ( $changedCommand != "") { string $buffer[]; tokenize($plugName,".",$buffer); string $cmd = $changedCommand+" \""+$buffer[0]+"\""; scriptJob -p $controlName -rp -ac $plugName $cmd; } }