// =========================================================================== // 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: January 16, 2003 // // Procedure Name: // cleanUp_StartProgress // // Description: // // Utility function used by the various components of the // "Optimize Scene Size" function (otherwise known as scene cleanup). // // Cleanup operations that wish to provide interruptability and // progress reporting via the progress bar should call this function // before they begin processing scene nodes. // // Input Arguments: // // $count - the number of nodes that will be processed by the // operation // // $uiString - a string to indicate to the user what the // operation will be doing. This will be // displayed in the progress bar. // // $interruptable - indicates whether or not the operation // is interruptable. If it is, then the // progress bar will catch ESC keypresses // during the operation. See the // cleanUp_SetProgress() utility function // for more information on interruptability // of cleanup operations. // // Return Value: // None. // // Related Functions: // // cleanUp_StartProgress() - called before an operation begins // cleanUp_SetProgress() - called as the operation is running, to // update the progress bar. // cleanUp_EndProgress() - called to signal that the operation is // finished. // cleanUp_CheckInterrupt() - called between cleanup operations to // detect when a previous operation has // been interrupted. // cleanUp_Summary() - called to report the results of cleanup // operations. // //----------------------------------------------------------------------- global proc cleanUp_StartProgress( int $count, string $uiString, int $interruptable ) { global string $gMainProgressBar; // determine the "max" value for the progress bar. // int $max = $count; if( $max < 2 ) { $max = 2; } // start the progress bar // progressBar -e -beginProgress $gMainProgressBar; // set the interruptability flag on the progress bar // progressBar -e -ii $interruptable $gMainProgressBar; // set the min/max range values for the progress bar // progressBar -e -minValue 1 -maxValue $max $gMainProgressBar; // set the text string for the progress bar. Prepend // a string to indicate that this operation is part of the // Optimize Scene Size function, and append a string that // indicates how much work will need to be done (as given // by the $count argument supplied by the caller). // string $msgFormat = (uiRes("m_cleanUp_StartProgress.kOptimizeSceneSizeOneNode")); string $statusString = `format -s $uiString $msgFormat`; if( $count >= 0 ) { $msgFormat = (uiRes("m_cleanUp_StartProgress.kOptimizeSceneSizeMultNodes")); $statusString = `format -s $uiString -s $count $msgFormat`; } progressBar -e -st $statusString $gMainProgressBar; }