// =========================================================================== // 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: June 13, 2003 // // // // // // string longNameOf(string $object) // // // string : Long name of $object. // // // This procedure returns the long name of $object, or blank // if $object does not exist or is not unique. // // // // Create a sphere. // // // string $spheres[] = `polySphere -name "sphere1"`; // string $sphere = $spheres[0]; // // longNameOf($sphere); // // Result: |sphere1 // // global proc string longNameOf(string $object) { string $longNameOf; // Make sure that we've been provided with an object that exists. // if (($object != "") && objExists($object)) { // Retrieve the long name. Do nothing if the object is not unique. // string $longNames[] = `ls -long $object`; if (size($longNames) == 1) { $longNameOf = $longNames[0]; } } return $longNameOf; } // === END OF FILE longNameOf.mel ===========================================