-
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
MAYA-111902 Fix MaterialX import errors found by testing #1553
Conversation
And add rountrip unit test.
lib/mayaUsd/CMakeLists.txt
Outdated
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) |
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.
Some recent build breaks have cast doubt on these combinations of versions. FindMaya.cmake now makes sure the API is correctly detected.
cmake/modules/FindMaya.cmake
Outdated
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") |
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.
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.
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.
I added a bit more output at the two key detection moments.
cmake/modules/FindMaya.cmake
Outdated
NO_CMAKE_SYSTEM_PATH | ||
) | ||
if (MAYA_OPENMAYARENDER_LIBRARY) | ||
file(STRINGS ${MAYA_OPENMAYARENDER_LIBRARY} HAS_DEFAULT_MATERIAL_API REGEX "setDefaultMaterialHandling") |
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.
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?
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.
It was quite fast, but it will be even faster (and more precise) to look directly in the header file. Fixed that.
Fixes roughness not exporting correctly for UsdPreviewSurface node in MaterialX
Fixes UsdPreviewSurface not importing from MaterialX
Adds MaterialX mode to UsdPreviewSurface rountrip unit test.