-
Notifications
You must be signed in to change notification settings - Fork 201
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-749 fix how stages are updated when saved #3432
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pierrebai-adsk
force-pushed
the
bailp/EMSUSD-749/lost-edit-as-maya
branch
from
November 2, 2023 19:23
d03dd28
to
fdbb5b7
Compare
The interaction between how the stage were initially open or created and how they were updated did not match. This caused the code that attempted to update the stage cache when saving anonymous layers to fail to achieve its goal. This led to the proxy shape next compute to fail to find the original session layer. This caused the information about edited-as-Maya prim to be lost. This resulted in the stage being in a weird state where a Maya reference prim was edited but the stage had forgotten about it. Fix the code so that the way the stage os open in the proxy shape and in the function that update the stage cache match. - Changed how the proxy shape open the USD stage by always initially not loading payloads. - Also, do not pass an explicit resolver as it would affect which stage could be found in the cache. - Document in the helper function that updates stage after saving anonymous layer to open the stages the same way. We also needed to fix the layer manager UI update after save. The previous code worked by happenstance of the order of indirect operations. In particular, it only worked if the proxy shape was recomputed at just the right time. Recomputing the proxy shape emitted a notice that refreshed the layer manager. For complex reasons, when there is an edited Maya reference, the order changes, which prevented the layer manager UI from updating with the latest data. To avoid this reliance on the exact timing of when the proxy shape might get recomputed, an explicit call to refresh the underlying model of the layer manager is done when saving. Unfortunately, due to the complicated design of the layer manager, the underlying tree model and where the data is kept, multiple classes had to be modified to provide a path from the save code the the data model. - Add functions on the MayaSessionState to refresh the current displayed stage layers. - (The MayaSessionState is where the layer manager UI keeps its list of loaded USD stages... it really ough to be called LoadedStages instead... MayaSessionState is a combination of three meaningless words.) - Add a updateLayerModel() abstract function to the AbstractLayerEditorWindow interface. - Implement updateLayerModel() in MayaLayerEditorWindow by calling the refreshStageEntry() on the MayaSessionStage. - Add a updateLayerManagers(0 helper function to the LayerDatabase used by the LayerManager (that is, the data holder, not the UI), to refresh all layer manager UI. - Call it at the end of LayerDatabase::saveUsd(), which is where layers get saved.
pierrebai-adsk
force-pushed
the
bailp/EMSUSD-749/lost-edit-as-maya
branch
from
November 2, 2023 20:43
fdbb5b7
to
9a7886c
Compare
AramAzhari-adsk
previously approved these changes
Nov 2, 2023
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.
Just some minor comment updates but looks good to me.
…ules. Also improve two comments.
AramAzhari-adsk
approved these changes
Nov 3, 2023
pierrebai-adsk
added
the
ready-for-merge
Development process is finished, PR is ready for merge
label
Nov 3, 2023
seando-adsk
added
core
Related to core library
and removed
adsk
Related to Autodesk plugin
labels
Nov 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
core
Related to core library
ready-for-merge
Development process is finished, PR is ready for merge
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The interaction between how the stage were initially open or created and how they were updated did not match. This caused the code that attempted to update the stage cache when saving anonymous layers to fail to achieve its goal. This led to the proxy shape next compute to fail to find the original session layer. This caused the information about edited-as-Maya prim to be lost. This resulted in the stage being in a weird state where a Maya reference prim was edited but the stage had forgotten about it.
Fix the code so that the way the stage os open in the proxy shape and in the function that update the stage cache match.
We also needed to fix the layer manager UI update after save.
The previous code worked by happenstance of the order of indirect operations. In particular, it only worked if the proxy shape was recomputed at just the right time. Recomputing the proxy shape emitted a notice that refreshed the layer manager. For complex reasons, when there is an edited Maya reference, the order changes, which prevented the layer manager UI from updating with the latest data.
To avoid this reliance on the exact timing of when the proxy shape might get recomputed, an explicit call to refresh the underlying model of the layer manager is done when saving. Unfortunately, due to the complicated design of the layer manager, the underlying tree model and where the data is kept, multiple classes had to be modified to provide a path from the save code the the data model.