// =========================================================================== // 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: AEnurbsCurveRelated.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[] AEnurbsCurveRelated( string $node ) { string $retval[]; // Make sure that the shape is first in the list so that $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 nurbsCurve node string $plugs[] = `listConnections -s true -d true -sh true $node`; // currently we show the related follicle and hairsystem nodes for( $plug in $plugs ) { if ( `nodeType $plug` == "follicle" ) { $retval[size($retval)] = $plug; // Also get the hairSystem for this follicle string $hsys = destinationNodeNameFromConnection ( $plug + ".outHair" ); if( "" != $hsys ){ $retval[size($retval)] = $hsys; } break; } } if ( $preferredNode != "" ) { $retval[size($retval)] = $preferredNode; } if( size( $retval ) == 0 ) { $retval[0] = $node; } return $retval; }