-
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
Prim metadata editRouting #3790
Prim metadata editRouting #3790
Conversation
- Designed like attribute editRouting. - getPrimMetadataEditRouterLayer: routes metadata edits to a layer based on its name and the value key path for dict-valued metadata. - PrimMetadataEditRouterContext: RAII-style class to ease scoped editRouting in C++ and python.
Hello @seando-adsk, @pierrebai-adsk, |
@jufrantz We have been discussing this PR internally. I'll collect all our notes and get back to you. Sean |
@jufrantz Sorry for the delay. We have discussed this internally and your changes do fit with ones we had upcoming, such as being able to edit route the custom data. One question that came up internally was, And just for your information, And yes new unit tests will be required to go along with these changes. Thank-you, |
Thank you @seando-adsk for the feedbacks. I'll free up some time next week to revisit this, I'll see how it may interact with non-local targets and also check other metadata routing that I may have missed. |
Thank you once again @seando-adsk, I did have a deeper look at your comments, Regarding non-local layers routing,I could not find changes related to it. However, I found #3716 that addresses non-local layer persistence in the Maya scene. 3716 and this PR should be compatible: if a non-local layer is used as editTarget before metadata editRouting (to a local layer), the non-local target will be correctly restored. From my understanding, there is currently no editRouter that can target a non-local layer, as routing callbacks respond with an SdfLayer and not a whole UsdEditTarget. Correct me if I am wrong, this might be addressed more globally in another PR. Regarding other metadata routing, I found Concerning backward compatibility, it appears possible to chain editRouters. eg if an If the current design of Best, |
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.
It would be nice to have at least one unit test to verify it all works.
Yes. As mentioned in my first message, it was an initial drop. Since the PR is quite old, I wasn't sure if there was interest in this addition. I'll make some time next week to complete it. |
Done. |
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.
Very well done
Ah, you will have to reformat the files that were rejected by the linter... |
Oops! It should be all good now. |
4a7ae36
4a7ae36
to
0c773ee
Compare
0c773ee
to
ca1ebb7
Compare
Hello, |
Following #3778, this proposal introduces support for a new registrable
primMetadata
router, designed similarly to attribute routing. A unique router will receive the USD metadata name in its context. ForcustomData
andvariantSelection
, the router will also receive a dictionary key path, such as thevariantSet
name forvariantSelection
.These commands support this routing:
UsdUndoToggleInstanceableCommand
UsdUndoToggleActiveCommand
UsdUndoSetKindCommand
UsdUndoAddReferenceCommand
UsdUndoAddPayloadCommand
UsdUndoClearPayloadsCommand
UsdUndoClearReferencesCommand
SetVariantSelectionCommand
ClearSceneItemMetadataCommand
SetSceneItemMetadataCommand
I still need to add unit tests and update EditRouting.md. But before going further, I wanted to push these initial changes to ensure they fit the project.