-
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-623 edit as Maya multiple variants #3342
Closed
Closed
Conversation
This file contains 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
pierrebai-adsk
force-pushed
the
bailp/EMSUSD-623/variants-vs-multi-maya-refs
branch
3 times, most recently
from
September 22, 2023 15:18
ce6f68d
to
41bfa0f
Compare
pierrebai-adsk
added
bug
Something isn't working
adsk
Related to Autodesk plugin
labels
Sep 22, 2023
pierrebai-adsk
force-pushed
the
bailp/EMSUSD-623/variants-vs-multi-maya-refs
branch
4 times, most recently
from
September 25, 2023 19:22
9576926
to
4608c30
Compare
This change adds support to edit-as-Maya a prim that is under a variant, with each variation having a different Maya reference. That is, a single prim can now be edited-as-Maya multiple times in parallel. This required major changes on how those edited prim are tracked. Edit-as-Maya authors data in the session layer related to the edited prim. Previously, this data was authored outside any variant, which caused problems when a prim had multiple variants. Now these data are authored inside the same variant as the prim itself. Add overloads of the helper functions to write and remove pull informations and metadata. The overloads take and explicit USD edit target. These are necessary because when the orphnaed node manager tries to remove or write the information, the stage might not be in the current state of variants might not be the same as when the prim was initially edited-as-Maya. So we must use the cache variant selection information instead to build the correct target. Additional variant-related helper functions: - Add the getEditTargetForVariants function helper function to create the USD edit target targeting all the variants that affect a given prim. - Ensure getEditTargetForVariants works in more complex scenarios spanning payloads and references. - Add the getVariantPath helper function to create a USD path containing a variant selection. Additional pull information helper functions: - Add variant-specific pull info metadata in the pull-info helper functions. - Add overloads of the pull information helper functions, taking an explicit edit target. - Refactor the existing overload to call the new functions. - Warn when we fail to remove pull information. Change to the orphan manager: - Use the variant-targeting helper function when authoring the Maya reference custom attribute that holds the name of the Maya reference node. - Support having multiple entries for a given UFE path. - To differentiate between entries, the corresponding root Maya DAG path must be given in all functions to figure out which version of the prim we are dealing with. - Fortunately, all callers always have on hand the DAG path of the root Maya node. - Change all implementation function to iterate over these variations. - Change the orphaned nodes serialization to support the extra data. - Make the serialization format backward compatible by special-casing the usual case of having a single variation at a given edited UFE path. - Add a log to tell the user when an edited prim is orphaned. - Add a has function in the orphaned node manager to check if a prim is already edited. - Use it to avoid editing a prim variant twice. - Added debug log to be removed later. - Refactor the orphaned node manager to use the helper passing an explicit edit target. - Make the orphaned node manager build an explicit USD edit target for the exact variant selections that were active when the prim was edited. - Fix how the orphaned manager handles notifications to determine orphans. - In particular, handle deactvated prims correctly: when switching variants, the order of the consequences is not deterministc, so the handling must not assume that edited prims are active. Changes to the prim updater manager: - Ignore edited prim that are orphaned when determining if a prim has edited descendants. - Adapt to changes to the orphaned manager by passing the Maya DAG path to the root of the edited nodes. - When merging to USD, when removing the pull information, use the helper function. - Remove the pull information before calling the prim updaters since they might change the active variant. Changes to Maya reference translator (importer from USD to Maya): - Use the variant-targeting helper function when authoring the pulled-prim metadata. - Make many functions be purely in the implementation instead of declared private in the class. - This allows better hiding of the implementation. - This was also necessary to make the function callable from internal implementation functions. - Renamed LoadMayaReference to CreateMayaReference to better reflect what the function does. - Split the long update function into multiple function for clarity. - When trying to reuse Maya reference nodes, verify that the referenced file is the one that was expected. - This allows two prim with the same USD path but different references to work alongside each other. - This happens when one prim with two variants each contain a Maya reference. - Add more comments in the code to explain what is going on. - Add a log to tell the user when a reference does not have the expected file path. Fix unit tests: - Some tests were re-using prims that had become invalid and needed to be refetched. - Some tests were checking if prims were accessible when they should not, since merging a Maya reference with variants change to those variants. - It used to work because there were some left-overs in the session layer.
pierrebai-adsk
force-pushed
the
bailp/EMSUSD-623/variants-vs-multi-maya-refs
branch
from
September 25, 2023 20:01
4608c30
to
559b96a
Compare
pierrebai-adsk
deleted the
bailp/EMSUSD-623/variants-vs-multi-maya-refs
branch
September 25, 2023 20:02
pierrebai-adsk
restored the
bailp/EMSUSD-623/variants-vs-multi-maya-refs
branch
September 25, 2023 20:03
pierrebai-adsk
deleted the
bailp/EMSUSD-623/variants-vs-multi-maya-refs
branch
September 25, 2023 20:03
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.
This change adds support to edit-as-Maya a prim that is under a variant, with
each variation having a different Maya reference. That is, a single prim can
now be edited-as-Maya multiple times in parallel. This required major changes
on how those edited prim are tracked.
Edit-as-Maya authors data in the session layer related to the edited prim.
Previously, this data was authored outside any variant, which caused problems
when a prim had multiple variants. Now these data are authored inside the same
variant as the prim itself.
Additional helper functions:
Change to the orphan manager:
Changes to the prim updater manager:
Changes to Maya reference translator (importer from USD to Maya):