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-128503 - Improve roundtripping of GeomSubsets #3135

Merged
merged 6 commits into from
Jun 6, 2023

Conversation

JGamache-autodesk
Copy link
Collaborator

We have two sources of GeomSubsets in Maya:

  • Shaded faces
  • Explicitly create component tags

In USD land GeomSubsets can be modified in ways that have no Maya equivalent:

  • We can change the family name
  • We can assign a material

So when importing/exporting USD data, we need to add just enough info that all Maya and USD sepcificities are accounted for and correctly handled.

The unit test will be quite informative.

We have two sources of GeomSubsets in Maya:
 - Shaded faces
 - Explicitly create component tags

In USD land GeomSubsets can be modified in ways that have no Maya
equivalent:
 - We can change the family name
 - We can assign a material

So when importing/exporting USD data, we need to add just enough info
that all Maya and USD sepcificities are accounted for and correctly
handled.

The unit test will be quite informative.
@pierrebai-adsk
Copy link
Collaborator

I'll wait for the code update and answers about the small details, otherwise LGTM.

def testGeomSubsetRoundtripCollectionBased(self):
"""Test that GeomSubsets numbers stay under control when rountripping
with collection based material assignemnt"""
self.CommonGeomSubsetRoundtrip(True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The way the material checks are done with ComputeBoundMaterial work with both assignment methods. The contents of the USDA files will be slightly different since one will use collections based assignment.

@@ -449,6 +449,12 @@ bool UsdMayaTranslatorMaterial::AssignMaterial(
// identifier is the UUID.
subsetRoundtrippingInfo[UsdMayaGeomSubsetTokens->MaterialUuidKey]
= JsValue(depNodeFn.uuid().asString().asChar());
} else {
TF_RUNTIME_ERROR(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be necessary to also have an error for the iterator check above? IDK what are the semantics for the find to fail.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I will revisit the error handling today as this seem a bit fragile.

pierrebai-adsk
pierrebai-adsk previously approved these changes Jun 5, 2023
pierrebai-adsk
pierrebai-adsk previously approved these changes Jun 5, 2023
@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 5, 2023
@JGamache-autodesk
Copy link
Collaborator Author

@seando-adsk , ready for merge as the 3 preflight failures for Maya 2024 are known.

@seando-adsk seando-adsk merged commit 21f7b02 into dev Jun 6, 2023
@seando-adsk seando-adsk deleted the gamaj/MAYA-128503/improve_subset_roundtripping branch June 6, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export materials ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants