ProgressBarScope not advanced the correct number of steps on early out or because of unrelated failure
michaeljefferies opened this issue · comments
The ProgressBarScope destructor issues a warning when the object being destroyed hasn't been advance through all steps. However, when used in UsdMayaExportTranslator::writer() and perhaps elsewhere, there are code paths because of early out or because of errors where the progress bar does not get advanced the total number of steps. This can lead to spurious warnings about the progress bar not being advanced the correct number of steps even though the flow is working as it should.
It seems as if the warning message should either be removed from the ProgressBarScope destructor, or to make it easier for clients to use the ProgressBarScope there should be an "advanceToEnd()" method that could be called in situations where the initially guessed number of steps is not needed because of early out or an error was encountered, thus de-cluttering any log files.
I seem to be getting this exact warning when doing maya usd exports through command-line mayabatch
exports. In my case I do have an Export Chaser as well so I'm not sure it's related to that.
Warning: ProgressBarScope: did not advance progress bar correct number of steps.
Just wanted to remark also that the warning itself made me assume I did something wrong - but maybe the progress bar scope should behave differently if no gui is present anyway so wanted to comment it here and wasn't sure whether it warranted its own issue.