Skip to content
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

MAYA-126179 merge-to-USD into variants #2764

Merged
merged 3 commits into from
Dec 13, 2022

Conversation

pierrebai-adsk
Copy link
Collaborator

Code refactor:

  • Add a get method on the orphaned node manager to access the saved variant sets.
  • Expose more helping functions to convert to text the orphaned node manager data, to help debugging.

Fix mid-merge orphaning:

  • Move where the orphaned node manager data for a pulled prim is removed when merging to USD.
  • This is necessary because while merging, USD sends out notifications which would trigger the orphaned node manage mid-merge and cause havok.

Support merging into variants:

  • Add support to merge into variants in mergePrims().
  • This involves augmenting the target path with variant selections for intermediary prims and to create a edit target for any final variant selection.
  • We need two different ways to handle variant selections because SdfCopySpec() has a bug that prevents it from copying into a target path that ends with a variant selection.
  • Fix how we determine if merge to USD should be enabled.
  • Fix prim retrieval during merge when calling GetPrimAtPath.

The function GetPrimAtPath in USD does not support variant selection. (Surprisingly, IMO.) So we need to explicitly strip variant selection when retrieving a prim. This API limitation is both non-intuitive and error-prone: given that the function does not support variant selection, why does it not ignore them? This fix makes merging into sub-variants (variant within variant) work.

Code refactor:
- Add a get method on the orphaned node manager to access the saved variant
  sets.
- Expose more helping functions to convert to text the orphaned node manager
  data, to help debugging.

Fix mid-merge orphaning:
- Move where the orphaned node manager data for a pulled prim is removed when
  merging to USD.
- This is necessary because while merging, USD sends out notifications which
  would trigger the orphaned node manage mid-merge and cause havok.

Support merging into variants:
- Add support to merge into variants in mergePrims().
- This involves augmenting the target path with variant selections for
  intermediary prims and to create a edit target for any final variant
  selection.
- We need two different ways to handle variant selections because SdfCopySpec()
  has a bug that prevents it from copying into a target path that ends with a
  variant selection.
- Fix how we determine if merge to USD should be enabled.
- Fix prim retrieval during merge when calling GetPrimAtPath.

The function GetPrimAtPath in USD does not support variant selection.
(Surprisingly, IMO.) So we need to explicitly strip variant selection when
retrieving a prim.  This API limitation is both unintuitive and error-prone:
given that the function does not support variant selection, why does it not
ignore them? This fix makes merging into sub-variants (variant within variant)
work.
- Add an option to ignore variants to the MergePrims function.
- This allows not modifying the edit target and destination  path when the caller has already set everything up.
- This happens when vopying the transform to the Maya Ref.
- Fix typos in comments.
Test that editing a vairant in a variant gets the correct results.
@pierrebai-adsk pierrebai-adsk added the adsk Related to Autodesk plugin label Dec 5, 2022
Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Dec 8, 2022
@seando-adsk seando-adsk added the workflows Related to in-context workflows label Dec 13, 2022
@seando-adsk seando-adsk merged commit 6d31923 into dev Dec 13, 2022
@seando-adsk seando-adsk deleted the bailp/MAYA-126179/merge-into-variants branch December 13, 2022 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants