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

simulate: fix display of loading message #1070

Merged

Conversation

aftersomemath
Copy link
Contributor

@aftersomemath aftersomemath commented Sep 25, 2023

Model loading was moved to the physics thread sometime back (for good reason). This broke the "loading" message shown in UI because the UI did not a know a model was being loaded until after the fact.

The proposed solution adds optional methods to the Simulate class that set and clear a loading message as part of the UI's model loading state machine.

This works with C++ simulate application and the Python managed viewer. It should not affect the passive viewer.

EDIT: It also moves the loading message for command line based reloads to the left of the screen. Previously it was on the right for command line filenames and the left for UI based reloads (button or drag-n-drop) which is inconsistent.

@@ -173,6 +181,7 @@ class Simulate {
std::atomic_int uiloadrequest = 0;

// loadrequest
// 3: display a loading message
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need "3" Isn't this already what "1" does (did 🙂) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two stages to the loading process. Transitioning from state 3 to 2 is handled by the physics thread (this is optional for the user). Transitioning from 2 to 0 is handled by the UI thread.

The UI thread needs two states so it can put a loading message on the screen (transition from 2 to 1) prior to the blocking call to Simulate's LoadOnRenderThread (transition from 1 to 0).

@yuvaltassa
Copy link
Collaborator

Can you resync please so the tests pass?
I think you happened to send this right after we broke something but before we fixed it 🙂

@aftersomemath
Copy link
Contributor Author

For sure, it is done.

@copybara-service copybara-service bot merged commit b8a91a0 into google-deepmind:main Sep 27, 2023
13 checks passed
@yuvaltassa
Copy link
Collaborator

@aftersomemath thanks so much ❤️

@aftersomemath aftersomemath deleted the simulate-load-message branch September 28, 2023 14:13
@aftersomemath aftersomemath restored the simulate-load-message branch September 28, 2023 14:14
@aftersomemath
Copy link
Contributor Author

You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants