When building USD with MaterialX my current understanding is the plugin looks for the standard library in the following locations:
- The locations pointed out by: PXR_MTLX_PLUGIN_SEARCH_PATHS
- The locations pointed out by the environment variable: PXR_MTLX_STDLIB_SEARCH_PATHS
- The locations fed in by the compile time defined value of PXR_MATERIALX_STDLIB_DIR
What they all have in common is that they are (as far as I understand them) absolute locations that needs to be specified either by the system or at compile time. In order to build an application using USD I’d prefer to look up these things relative to the install location in some form.
My instinct would be to store and install the MaterialX library as resources in the UsdMtlx plugin resource directory and use that as the fallback location if everything else fails to make sure any valid build of usd relocated or not has the standard library available.
What are your thoughts on this topic? I get the feeling the current setup is very one environment for everyone oriented and not very application oriented. Also, please challenge my assumptions, is there a way of loading the materialx libraries from a location relative to the installed application. I am aware it’s possible to set the environment variables inside the process to work around this but I’d rather avoid that solution unless I have to.