-
Notifications
You must be signed in to change notification settings - Fork 203
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
MaterialX import export #1478
MaterialX import export #1478
Conversation
Exports standard surface and file nodes to a MaterialX UsdShade network.
Combines two previously submitted PRs.
@@ -597,7 +597,11 @@ class _UVMappingManager | |||
TfStringPrintf("%s:%s", itNode->GetText(), _tokens->varname.GetText())); | |||
UsdShadeInput materialInput = material.GetInput(inputName); | |||
TF_VERIFY(itName != largestSet.cend()); | |||
materialInput.Set(*itName); |
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.
MaterialX uses std::string while UsdPreviewSurface uses TfToken.
if (iter != _shaderReaderMap.end()) { | ||
shaderReader = iter->second; | ||
if (!_context->GetCreatedObject(shaderSchema.GetPrim(), &sourceObj)) { |
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.
Ask the shader reader in case it is a converter.
Responded to otheer review comments.
over "MaterialX" | ||
( | ||
references = [@./standard_surface_jade.usda@</MaterialX>, | ||
@./standard_surface_gold.mtlx@</MaterialX>] |
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.
Will exercise the SdfFileReference auto-conversion to USD, but requires the UsdMtlx plugin which is not in the USD we currently use for tests.
|
||
|
||
class testUsdImportMaterialX(unittest.TestCase): | ||
"""Test importing an asset with MaterialX shading: |
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.
Excellent test, @JGamache-autodesk! The only thing that would be good to add (but it's not blocking for this merge) is a test that performs export and import. I know part of the import file is actually having content exported from Maya, but I would want to avoid situations where USD test file gets updated but not the actual export code.
This PR is built on top of PR #1450 and PR #1456.
So we get the previously submitted MaterialX export and the token refactoring.
In addition, we now get: