-
Notifications
You must be signed in to change notification settings - Fork 202
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-277 fix lost muted anonymous layers #3320
Conversation
pierrebai-adsk
commented
Sep 8, 2023
- Add a global functionality to hold onto muted layers.
- This is to work around the fact that OpenUSD will not keep muted layers in memory.
- Make sure to clean up the list of muted layers when a new Maya scene is created.
- Use the muted layer holder in the MuteLayer command.
- The base class of the command was trying to hold onto layer, but when the undo stack is cleared, so would be the anonymous layers.
- In particular, when unloading a Maya Reference, Maya always clears the undo stack.
- Add a test that check if muted anonymous layers are lost when editing a Maya Reference.
- The test fails without my fix, works with it.
- Improved test helper functions to enable creating anonymous sub-layers.
- Add a global functionality to hold onto muted layers. - This is to work around the fact that OpenUSD will not keep muted layers in memory. - Make sure to clean up the list of muted layers when a new Maya scene is created. - Use the muted layer holder in the MuteLayer command. - The base class of the command was trying to hold onto layer, but when the undo stack is cleared, so would be the anonymous layers. - In particular, when unloading a Maya Reference, Maya always clears the undo stack. - Add a test that check if muted anonymous layers are lost when editing a Maya Reference. - The test fails without my fix, works with it. - Improved test helper functions to enable creating anonymous sub-layers.
f3777ff
to
5907c81
Compare
@@ -620,7 +621,7 @@ class MuteLayer : public BaseCmd | |||
// we perfer not holding to pointers needlessly, but we need to hold on to the layer if we | |||
// mute it otherwise usd will let go of it and its modifications, and any dirty children | |||
// will also be lost |
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.
I dont think we need this comment anymore, so does L643
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.
Actually, the comment says exactly why we are calling addMutedLayer, so I'll keep the comment.
// we can release the pointer | ||
_mutedLayer = nullptr; | ||
removeMutedLayer(layer); |
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.
Question here: In AddMutedLayer, we recursively added all dirty sublayers to the mutedLayer list, so when remvoeMutedLayer should we do the same? For now it just removes one layer.
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.
You're right, I will look into it.
Also, improve comments explaining why we add and remove muted layers.