// =========================================================================== // 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: 5 Apr 1996 // // Description: // This procedure selects history/future of the object proc string needTheLead() { string $result = ""; string $all[] = `ls -l -sl -tail 1 -type dagNode`; if( size($all) > 0 ) { $result = $all[0]; } else { $all = `ls -sl -tail 1`; if( size($all) > 0 ) { $result = $all[0]; } } return $result; } proc string fillOutSection( string $chain[] ) { string $cmdString = ""; string $item, $each; string $list[]; int $n; for( $item in $chain ) { tokenize( $item, "|", $list ); $n = size($list); if( 1 == $n ) { $cmdString = ( $cmdString + " \"" + $item + "\"" ); } else if( $n > 0 ) { for( $each in $list ) { $cmdString = ( $cmdString + " \"" + $each + "\"" ); } } } return $cmdString; } proc string selectInputOutputGiven( string $lead, int $future ) { string $chainFalse[]; string $chainTrue[]; string $cmdString; int $showLevel = 2; int $pruneDag = 1; if( "" != $lead ) { if( "transform" == `nodeType $lead`) { $chainFalse2 = `listHistory -gl true -pdo $pruneDag -lf false -f $future -il $showLevel $lead`; $cmdString = fillOutSection( $chainFalse2 ); } $chainTrue2 = `listHistory -gl true -pdo $pruneDag -lf true -f $future -il $showLevel $lead`; $cmdString = $cmdString + fillOutSection( $chainTrue2 ); eval( "select -add " + $cmdString + ""); } return $cmdString; } global proc string selectAllInputOutput( int $future ) // // Select all objects in the history (input) if flag is false // or future (output) if flag is true of the lead object selected. { // Get the list of selected items and do the list // for the lead/last item. // return selectInputOutputGiven( `needTheLead`, $future ); }