-
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-277 fix lost muted anonymous layers #3320
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
#include "layerEditorCommand.h" | ||
|
||
#include <mayaUsd/ufe/Global.h> | ||
#include <mayaUsd/utils/layerMuting.h> | ||
#include <mayaUsd/utils/query.h> | ||
#include <mayaUsd/utils/utilFileSystem.h> | ||
|
||
|
@@ -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 | ||
_mutedLayer = layer; | ||
addMutedLayer(layer); | ||
return true; | ||
} | ||
|
||
|
@@ -638,8 +639,9 @@ class MuteLayer : public BaseCmd | |
saveSelection(); | ||
stage->MuteLayer(layer->GetIdentifier()); | ||
} | ||
|
||
// we can release the pointer | ||
_mutedLayer = nullptr; | ||
removeMutedLayer(layer); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. You're right, I will look into it. |
||
return true; | ||
} | ||
|
||
|
@@ -683,8 +685,7 @@ class MuteLayer : public BaseCmd | |
globalSn->replaceWith(UsdUfe::recreateDescendants(_savedSn, path)); | ||
} | ||
|
||
Ufe::Selection _savedSn; | ||
PXR_NS::SdfLayerRefPtr _mutedLayer; | ||
Ufe::Selection _savedSn; | ||
}; | ||
|
||
// We assume the indexes given to the command are the original indexes | ||
|
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.