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

MaterialX search paths seem to expect different locations for finding nodes and loading implementations #1488

Closed
laserallan opened this issue Apr 10, 2021 · 1 comment

Comments

@laserallan
Copy link

Description of Issue

When I build the MaterialX plugin and set PXR_MATERIALX_STDLIB_DIR in my build I get errors.
If I point it to the install_dir the nodes are loaded properly but the code generation fails since it can't find the implementations.
If I point it to install_dir/libraries, the nodes are not found

Note install_dir refers to your install_dir passed to build_usd.py

Steps to Reproduce

  1. Build with PXR_MATERIALX_STDLIB_DIR to the build directory
  2. Make sure any other environment variable helping MaterialX finding nodes and implementations are unset (I never managed to get any of them to work either)
  3. Reference a simple MaterialX material into a scene and apply it to an object

Now you will get errors like this:
ERROR: Usdview encountered an error while rendering.Failed to get source code from file 'lights\genglsl\mx_point_light.glsl' used by implementation 'IM_point_light_genglsl'

My workaround which may or may not be great is setting PXR_MATERIALX_STDLIB_DIR to install_dir and adding searchPath.append(mx::FilePath(PXR_MATERIALX_STDLIB_DIR)/"libraries"); to the function HdSt_ApplyMaterialXFilter where the search paths are created.

I've attached a file reproducing the issue. Make sure you update the path to standard_surface_marble_solid.mtlx in the MaterialX package.
materialx_issue.zip

System Information (OS, Hardware)

Windows 10, NVIDIA GPU, Visual Studio 2017, AMD 64

Package Versions

21.05 RC 1

Build Flags

MaterialX enabled, PXR_MATERIALX_STDLIB_DIR set to the install_dir

@jilliene
Copy link

Filed as internal issue #USD-6653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants