Skip to content
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

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

pierrebai-adsk
Copy link
Collaborator

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 conditionally 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.

@pierrebai-adsk pierrebai-adsk added the adsk Related to Autodesk plugin label Jan 17, 2024
@pierrebai-adsk pierrebai-adsk self-assigned this Jan 17, 2024
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.
@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jan 18, 2024
void mayaStartWaitCursor() { MGlobal::executeCommand("waitCursor -state 1"); }
void mayaStartWaitCursor()
{
ProxyRenderDelegate::setLongDurationRendering();
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@seando-adsk seando-adsk added vp2renderdelegate Related to VP2RenderDelegate and removed adsk Related to Autodesk plugin labels Jan 19, 2024
@seando-adsk seando-adsk merged commit 7bd83b8 into dev Jan 19, 2024
12 of 13 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-65/long-update-wait-cursor branch January 19, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge vp2renderdelegate Related to VP2RenderDelegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants