// =========================================================================== // 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 // // // // // // int isSameObject(string $objectA, string $objectB) // // // int : True if $objectA and $objectB are the same object. // // // This procedure returns true if $objectA and $objectB exist, are // unique, and are the same object. // // // // Create a NURBS sphere. // // // string $createdNodes[] = `sphere -constructionHistory false`; // string $sphere = $createdNodes[0]; // // isSameObject($sphere, longNameOf($sphere)); // // Result: 1 // // // isSameObject($sphere, "foo"); // // Result: 0 // // // global proc int isSameObject(string $objectA, string $objectB) { int $isSameObject = false; // Make sure that we've been provided with two objects that exist. // if (($objectA != "") && objExists($objectA) && ($objectB != "") && objExists($objectB)) { // Retrieve the long-names. If a long-name is blank, that means // that the object-name we've been given is not unique. // string $longObjectA = longNameOf($objectA); string $longObjectB = longNameOf($objectB); if (($longObjectA != "") && ($longObjectB != "")) { if ($longObjectA == $longObjectB) { $isSameObject = true; } } } return $isSameObject; } // === END OF FILE isSameObject.mel =========================================