// =========================================================================== // 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. // =========================================================================== global proc int blendShapeTargetDirectoryIndexFromName(string $bsdName, string $targetDirectoryName) // // Description: // Get the target directory index by given the blendShape node and the target directory name. // // Return: // -1 if there is not match name. // >=0 if there is a match. // { $tempAttr = $bsdName + ".targetDirectory"; int $directoryIndices[] = `getAttr -mi $tempAttr`; for ($id in $directoryIndices) { string $dirName = blendShapeTargetDirectoryNameFromIndex($bsdName, $id); if ($dirName == $targetDirectoryName) return $id; } return -1; // fail to find. }