-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EMSUSD-65 wait cursor during long VP2 updates #3563
Conversation
When a command may trigger a long viewport update, set a flag so that the proxy render delegate shows the wait cursor while it is updating the viewport data. We make the assumption that long-duration commands will generally cause long-duration viewport updates. This is done via the already-existing LongDurationCommand base class and wait cursor functions. - Modify the WaitCursor helper class to take a flag to control if the cursor is shown or not. - This allows conditionallly showing the wait cursor based on a condition. - Add a function to tell the render delegate that it should expect its update to take a long time. - Make the wait cursor function used by long-duration commands tell the render delegate to expect a long update.
7045caf
to
a9c69e3
Compare
void mayaStartWaitCursor() { MGlobal::executeCommand("waitCursor -state 1"); } | ||
void mayaStartWaitCursor() | ||
{ | ||
ProxyRenderDelegate::setLongDurationRendering(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When code somewhere creates a WaitCursor, it always sets the long duration. What happens if the action that used the wait cursor doesn't up in ProxyRenderDelegate::update()? The long duration flag will still be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any non-trivial modification to USD will trigger an update of the render delegate. If somehow we get into that situation, at worst the next update will show the wait cursor, which is benign. I just wanted to avoid toggling the wait cursor in all render delegate updates since showing the cursor requires calling commands.
When a command may trigger a long viewport update, set a flag so that the proxy render delegate shows the wait cursor while it is updating the viewport data. We make the assumption that long-duration commands will generally cause long-duration viewport updates. This is done via the already-existing LongDurationCommand base class and wait cursor functions.