// =========================================================================== // 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: May 16, 2003 // source "removeDuplicateNetworksUtils.mel"; global proc removeDuplicateNetworks( string $importedNodes[] ) // // Description: // Compare each node in $importedNodes with every other node in the scene. // If the two nodes are found to be duplicates, any geometry connected to // the imported node's network will be assigned to the existing duplicate, // and the imported node's network will be deleted. // { if ( `optionVar -query removeDuplicateShadingNetworksOnImport` ) { // shadingEngines are the root of shading networks string $rootType = "shadingEngine"; // Store a list of all the imported shadingEngines string $importedEngines[] = `ls -type $rootType $importedNodes`; // Store a list of all existing shadingEngines string $existingEngines[] = findAllNodesOfType( $rootType, $importedNodes ); // Actually remove the duplicate shading networks doRemoveDuplicateShadingNetworks( $importedEngines, $existingEngines ); } }