// =========================================================================== // 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. // =========================================================================== // This is a simple function to return the first // node connected to by an attribute, returning // an empty string if there is no connection. global proc string sourceNodeNameFromConnection( string $dest ) { string $outStr = ""; string $con = `connectionInfo -sfd $dest`; // There is likely a more efficient way of doing // this than the following tokenization. if( size( $con ) > 0 ){ string $buffer[]; int $numTokens = `tokenize $con "." $buffer`; if( $numTokens > 1 ){ $outStr = $buffer[0]; } } return $outStr; }