EMSUSD-4036 Implement refresh locked layers - #4702
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements a new MayaUsd notice for layer lock state transitions and wires it into the USD Composition Editor host so the UI can refresh when layers are locked/unlocked without requiring authored USD changes.
Changes:
- Added
UsdMayaLayerLockChangedNotice(payload: the affectedSdfLayer) and instantiated its TfType. - Emitted the new notice from
MayaUsd::lockLayer()only on actual lock-state transitions. - Registered a TfNotice listener in the Composition Editor host to emit the UI refresh signal, with explicit revocation on plugin finalize to avoid unload callbacks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/usd/ui/debugTools/CompositionEditorCmd.cpp | Adds a TfNotice listener on the Composition Editor host to refresh UI on layer lock changes, and revokes it during finalize. |
| lib/mayaUsd/utils/layerLocking.cpp | Detects real lock-state transitions and sends a layer-lock-changed notice when the registry-derived state changes. |
| lib/mayaUsd/listeners/notice.h | Declares UsdMayaLayerLockChangedNotice carrying the affected SdfLayerRefPtr. |
| lib/mayaUsd/listeners/notice.cpp | Instantiates TfType and implements the new notice’s constructor/accessor. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+108
to
+112
| // Derive the lock state of a layer from the lock registries. | ||
| LayerLockType currentLockType(const PXR_NS::SdfLayerRefPtr& layer) | ||
| { | ||
| if (isLayerSystemLocked(layer)) { | ||
| return LayerLock_SystemLocked; |
…://github.com/Autodesk/maya-usd into barbalt/dev/EMSUSD-4036-dt-refresh-lock-layer
pierrebai-adsk
approved these changes
Aug 18, 2026
| }; | ||
|
|
||
| /// Notice sent when the lock state of a layer changed during a Maya session. | ||
| class UsdMayaLayerLockChangedNotice : public TfNotice |
Collaborator
There was a problem hiding this comment.
Did you look if USD already sends a notice? I suppose it does not.
Collaborator
Author
There was a problem hiding this comment.
I searched for it, but couldn't find it
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refresh the debug tools view to show proper locked layers when they are done from the layer editor in maya usd.