// =========================================================================== // 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: May 2000 // // // // Procedure Name: // artFluidAttrAutoSaveInitialStateCurrentFluid // // Description: // Normally, this would be just as simple as a // "performFluids 1 FluidSave 0" but in case the selection // list has changed, we're still holding on to an autoSave // flag for the last painted fluid (which might no longer // be selected!) so we might need to reselect the fluid before // invoking the performFluids autoSave cmd... // // Return Value: // None. // global proc artFluidAttrAutoSaveInitialStateCurrentFluid( string $tool ) { // We're responding to an "autoSave" request... Check and // see if the fluid we want to save is actually on the selection // list. If not, invoking FluidSave will produce an error, so // we'd better select it beforehand. // string $fluid = `artFluidAttrCtx -q -currentPaintableFluid $tool`; if( size( $fluid ) == 0 ) { return; } string $selList[] = `ls -sl`; int $fluidSelected = ( stringArrayCount( $fluid, $selList ) > 0 ); if( !$fluidSelected ) { select $fluid; } // Save the state. // SetInitialState; // Restore the selection list if we need to. // if( !$fluidSelected ) { select $selList; } }