// =========================================================================== // 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. // =========================================================================== // FILE: AEparticleRelated.mel // INPUT: name of the particle node that is in the editor, that we are // finding related nodes for. At this time, we are just looking for // emitters that are connected to it. // // RETURN: list of related nodes, with the node whose tab you want to be // opened -- i.e. the particle node -- added at the end of the // array. For now the only related nodes will be emitters connected // to -- emitting into -- this particle. // global proc string[] AEinstancerRelated (string $node) { string $relatedNodes[]; int $i; int $numRelated = 0; $connections = `listConnections -shapes true $node`; // See if the particle is connected to the emitter's output attribute. // If it is, add it to the list of related nodes. // for ($i = 0; $i < size($connections); $i++) { $relatedNodes[$numRelated] = $connections[$i]; $numRelated++; } // The AE will first open the tab at the end of the list, so add the particle // shape node name at the end of the list so it will be opened. // Actually, we have to add it twice, because "they" are assuming the last one // is a duplicate and are stripping it out. // int $index = size($relatedNodes); $relatedNodes[$index] = $node; $relatedNodes[$index+1] = $node; return $relatedNodes; }