// =========================================================================== // 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: October 2003 // // Written by: jpakalns // // Procedure Name: // annotateLocator // // Description: // Add annotation to an existing locator. Annotation transform // is parented under the locators transform. // // Input Arguments: // locator - transform node of existing locator // annotation - string to annotate // // Return Value: // None. global proc string annotateLocator(string $locator, string $annotationText, string $annotationName) { // add annotation, right on top of the locator // see annotateNode.mel for how to place annotation // near edge of bounding box, if it turns out we want that select -r $locator; string $locShape[] = `listRelatives -shapes $locator`; float $locPos[] = `getAttr ($locShape[0]+".localPosition")`; $annotationNode = `annotate -tx $annotationText -p $locPos[0] $locPos[1] $locPos[2]`; setAttr ($annotationNode + ".displayArrow") 0; // get parent transform of annotation string $transform[] = `listRelatives -parent $annotationNode`; string $actualTransform = $transform[0]; if(size ($annotationName) > 0) { $actualTransform = `rename $transform[0] $annotationName`; } // parent annotation to locator parent $actualTransform $locator; return $actualTransform; }