// =========================================================================== // 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: AErenderSphereRelated.mel // INPUT: string (node name) // RETURN: string[] (list of related nodes, with the node whose // tab you want to be opened duplicated at the // end of the array) // global proc string[] AErenderSphereRelated (string $node) { string $retval[]; string $shadingNode; // Make sure that the shape is first in the list $retval[0] = $node; // Get the default tabs for this node string $relNodes[] = `defaultNavigation -ren -d $node`; string $preferredNode = `defaultNavigation -dwn -d $node`; for ($relNode in $relNodes) { $retval[size($retval)] = $relNode; } // Get the connections to the nurbsSurface node string $plugs[] = `listConnections -s false -d true $node`; // Look for a connected shading engine - this is // the jumping off point to get to the rendering nodes // from a selected surface for( $plug in $plugs ) { if ( `nodeType $plug` == "shadingEngine" ) { // Get the shading engine that's connected to this // nurbsSurface node string $tmp[] = `listConnections ( $plug + ".volumeShader" )`; // If the connection is null, then there is no // shading group attached to this node - simply // return the node itself. if( $tmp[0] == "" ) { $shadingNode = $plug; } else { $shadingNode = $tmp[0]; } $retval[size($retval)] = $shadingNode; break; } } if ( $preferredNode != "" ) { $retval[size($retval)] = $preferredNode; } if( size( $retval ) == 0 ) { $retval[0] = $node; } return $retval; }