// =========================================================================== // 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_SetProgress // // Description: // // Utility function used by the various components of the // "Optimize Scene Size" function (otherwise known as scene cleanup). // // This function is called during a cleanup operation to indicate // how far along that operation is. Usually this is measured in // terms of how many nodes the operation has processed so far. // // Input Arguments: // // $cur - the number of nodes that the operation has processed // so far. The $count argument provided to // cleanUp_StartProgress() indicated how many nodes the // operation expected to process in total. // // Return Value: // // 1 if the user pressed the ESC key during the cleanup operation, // indicating that the operation should be interrupted. // // 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. // // Side Effects: // // This routine sets the global variable $gCleanUpInterrupted, which // is used by the cleanUp_CheckInterrupt() routine. // //----------------------------------------------------------------------- global proc int cleanUp_SetProgress( int $cur ) { global string $gMainProgressBar; global int $gCleanUpInterrupted; // set the progress of the current operation // progressBar -e -pr $cur $gMainProgressBar; // check for an interrupt // if( `progressBar -q -ic $gMainProgressBar` ) { // $gCleanUpInterrupted = 1 means that the user interrupted // the last operation that was running (see cleanUp_CheckInterrupt() // for more details) // $gCleanUpInterrupted = 1; // return 1 to indicate that the operation was interrupted. // return 1; } else { // return 0 to indicate that the operation has not been interrupted yet. // return 0; } }