Edit Router operations #2376
Replies: 3 comments 2 replies
-
Hi @gracekumagai, the currently-supported operations for edit routing are here: maya-usd/lib/mayaUsd/utils/editRouter.cpp Line 183 in 9f3800b and here: maya-usd/lib/mayaUsd/utils/editRouter.cpp Line 188 in 9f3800b So mayaReferencePush, parent and duplicate for now. Once an edit router is registered, the edit routing registry must be accessed to retrieve the edit router and call it. This requires changing the code that writes to the USD data model. Here is the implementation for parent: For duplicate: And for mayaReferencePush (more complicated example): I believe that to implement edit routing for visibility, you would need to change the UsdUndoVisibleCommand, somewhere here: You would save the current edit target, set it to what your edit router returns, then set it back to its previous value. If the edit target layer is not prim-dependent, you can call upon the edit router in the UsdUndoVisibleCommand() constructor, and further if it's a constant (e.g. the session layer) ask the edit router once and save the result. Hope this helps, cheers. |
Beta Was this translation helpful? Give feedback.
-
Just to followup - it sounds like adding routing operations is something we could implement and contribute, which would allow the mayaUsd team to focus on new features and fixes that might not be plugin-only, so we are happy to schedule this work on our end. Thanks @ppt-adsk and others! |
Beta Was this translation helpful? Give feedback.
-
Rad! Thanks for trying it out and sharing your example! |
Beta Was this translation helpful? Give feedback.
-
I have been testing the Edit Router as we are hoping to use it to route edits to the session layer that we don't want to pass downstream (visibility, pickability, etc).
Are there other operations that are supported (in addition to parenting and duplicating)? If so, I was wondering where I can find the list? I tried to pass "visibility" as the operation (
mayaUsd.lib.registerEditRouter("visibility", ...)
) and after making the prim invisible, the edit was not authored on the session layer.Thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions