// =========================================================================== // 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: December 2, 1998 // // Procedure Name: AEgeoConnectorRelated // // Description Name; // Return a list nodes related to the geoConnector that we want to // display tabs for when the geoConnector is in the AE. // For now the only related nodes will be emitters and particles // connected to it. // // Input Value: // nodeName: name of the geoConnector node that is in the editor, that // we are finding related nodes for. // // Output Value: // The list of related nodes, with the node whose tab we want to be // opened, with the geoConnector node added at the end of the // array. For now the only related nodes will be emitters and // particles connected to it. // global proc string[] AEgeoConnectorRelated (string $node) { string $relatedNodes[]; int $i; // Look for particle destination plugs. It the geoConnector is connected // to a particle's "collisionFriction" plug, then the object owned by // the geoConnector must be a collide object for the particle, and the // geoConnector owns the resilience and friction attributes for that // function. // // Get the list of the particle's destination connections. // string $connections[] = `listConnections -type "particle" -plugs true -s false -d true ($node)`; // See if the geoConnector is connected to the particle's // "collisionFricion" attribute. // If it is, add it to the list of related nodes. // int $numRelated = 0; for ($i = 0; $i < size($connections); $i++) { string $matchString = match("collisionFriction", $connections[$i]); if ($matchString == "collisionFriction") { string $buffer[]; tokenize($connections[$i], ".", $buffer); $relatedNodes[$numRelated] = $buffer[0]; $numRelated++; } } // Just look for emitter destination plugs. It the geoConnector is // connected an emitter's "ownerPosData" plug, then the object that owns // the geoConnector also owns the emitter. The user may wan to edit // the tesselation attribute of the geoConnector to control emission // from the geometry. // // Get the list of the emitter's destination connections. // $connections = `listConnections -type "pointEmitter" -plugs true -d true -s false ($node)`; // If the geoConnector is connected to the emitters's "ownerPosData" // attribute, add it to the list of related nodes. // for ($i = 0; $i < size($connections); $i++) { string $matchString = match("ownerPosData", $connections[$i]); if ($matchString == "ownerPosData") { string $buffer[]; tokenize($connections[$i], ".", $buffer); $relatedNodes[$numRelated] = $buffer[0]; $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; }