// =========================================================================== // 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: March 11, 2003 // // // // // // plugNode plugAttr listAttr attributeQuery attributeInfo // // // plugAttrNoIndex(string $plug) // // // string Attribute name portion of the specified plug, omitting the // index if it exists // // // This procedure returns the attribute name portion of the specified // plug without its associated index. For example, the attribute name // portion of the plug "ramp1.colorEntryList[0].color" would be // "color". // // // string $plug The plug name from which to extract the attribute name // portion. // // // // Find the attribute name portion of checker1.color1 // plugAttrNoIndex "checker1.color1"; // // Result: color1 // // // global proc string plugAttrNoIndex(string $plug) { string $buffer[]; tokenize($plug, ".", $buffer); string $tokens[]; string $lastAttr = $buffer[size($buffer)-1]; tokenize $lastAttr "[" $tokens; string $attr = $tokens[0]; return $attr; }