Skip to content

Commit

Permalink
Merge pull request #3912 from dj-mcg/pr/Fix_ProgressBar_Warning
Browse files Browse the repository at this point in the history
Fix Progress Bar warnings
  • Loading branch information
seando-adsk authored Sep 18, 2024
2 parents a17e33d + 2cb3de8 commit 1b6471a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/mayaUsd/utils/progressBarScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ ProgressBarScope::~ProgressBarScope()
// If we created the MComputation we end and delete it.
if (_created) {
// Verify that we advances the number of steps added.
if (progBar->progress() != totalStepsAdded) {
const int progress = progBar->progress();

// `progress == -1` means the query failed.
//
// The "did not advance" warning below is not necessarily relevant -- we
// may have advanced the correct number of steps, but the `progBar`
// failed for other reasons, for example, running without the UI.
if (progress != -1 && progress != totalStepsAdded) {
TF_WARN("ProgressBarScope: did not advance progress bar correct number of steps.");
}
totalStepsAdded = 0;
Expand Down

0 comments on commit 1b6471a

Please sign in to comment.