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
simulate: fix display of loading message #1070
Conversation
@@ -173,6 +181,7 @@ class Simulate { | |||
std::atomic_int uiloadrequest = 0; | |||
|
|||
// loadrequest | |||
// 3: display a loading message |
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.
Why do we need "3" Isn't this already what "1" does (did 🙂) ?
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.
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).
Can you resync please so the tests pass? |
13c37e4
to
9b00d3e
Compare
9b00d3e
to
e7d1f2f
Compare
For sure, it is done. |
@aftersomemath thanks so much ❤️ |
You are welcome! |
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.