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-111902 Fix MaterialX import errors found by testing #1553

Merged
merged 5 commits into from
Jul 7, 2021

Conversation

JGamache-autodesk
Copy link
Collaborator

@JGamache-autodesk JGamache-autodesk commented Jul 6, 2021

Fixes roughness not exporting correctly for UsdPreviewSurface node in MaterialX
Fixes UsdPreviewSurface not importing from MaterialX
Adds MaterialX mode to UsdPreviewSurface rountrip unit test.

And add rountrip unit test.
@JGamache-autodesk JGamache-autodesk changed the title MAYA-111902 Fix errors found by testing MAYA-111902 Fix MaterialX import errors found by testing Jul 6, 2021
@JGamache-autodesk JGamache-autodesk added import-export Related to Import and/or Export materials labels Jul 6, 2021
endif()

if (MAYA_API_VERSION VERSION_GREATER_EQUAL 20230000 AND UFE_VERSION VERSION_GREATER_EQUAL 2.0.3)
if (MAYA_DEFAULT_MATERIAL_API EQUAL 1)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some recent build breaks have cast doubt on these combinations of versions. FindMaya.cmake now makes sure the API is correctly detected.

file(STRINGS ${MAYA_OPENMAYARENDER_LIBRARY} HAS_DEFAULT_MATERIAL_API REGEX "setDefaultMaterialHandling")
if (HAS_DEFAULT_MATERIAL_API)
set(MAYA_DEFAULT_MATERIAL_API 1)
message(STATUS "This version of Maya has the default material API")
Copy link
Contributor

Choose a reason for hiding this comment

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

I always like the log to print the name of the env var as well, so I can ctrl+f in the log to check the value that was used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a bit more output at the two key detection moments.

NO_CMAKE_SYSTEM_PATH
)
if (MAYA_OPENMAYARENDER_LIBRARY)
file(STRINGS ${MAYA_OPENMAYARENDER_LIBRARY} HAS_DEFAULT_MATERIAL_API REGEX "setDefaultMaterialHandling")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good idea and I'm wondering if we should use it more generally. Does it take much time to run the search?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was quite fast, but it will be even faster (and more precise) to look directly in the header file. Fixed that.

@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Jul 7, 2021
@kxl-adsk kxl-adsk merged commit ffae30b into dev Jul 7, 2021
@kxl-adsk kxl-adsk deleted the t_gamaj/MAYA-111902/fix_preview_surface branch July 7, 2021 16:43
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