Skip to content

Load extraLibraryPaths before standard libraries in test suite#2875

Closed
ppenenko wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
ppenenko:ppenenko/override-first-extra-libs
Closed

Load extraLibraryPaths before standard libraries in test suite#2875
ppenenko wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
ppenenko:ppenenko/override-first-extra-libs

Conversation

@ppenenko
Copy link
Copy Markdown
Contributor

Summary

Change the library loading order in MaterialXTest to load extra libraries before standard libraries, matching the behavior of MaterialXView and MaterialXGraphEditor where --library paths take precedence.

This allows extraLibraryPaths to provide override implementations for standard MaterialX nodes. NodeDef::getImplementation() returns the first matching target based on document insertion order, so loading overrides first ensures they are selected.

Changes

  • Override-first loading: Load extraLibraryPaths before mx::loadLibraries({ "libraries" }, ...) in loadDependentLibraries()
  • Source code search paths: Register extraLibraryPaths and libraries/pbrlib/genglsl as source code search paths so that override implementations can #include standard library source files

Motivation

MaterialXView already loads user-specified libraries first:

// Append the standard library folder, giving it a lower precedence than user-supplied libraries.
libraryFolders.push_back("libraries");

The test suite should have the same behavior to enable testing of custom node implementations that override standard nodes.

Test plan

  • Existing MaterialXTest render tests pass
  • CI passes

Change the library loading order in MaterialXTest to load extra
libraries before standard libraries, matching the behavior of
MaterialXView and MaterialXGraphEditor where --library paths take
precedence.

This allows extraLibraryPaths to provide override implementations
for standard MaterialX nodes. NodeDef::getImplementation() returns
the first matching target based on document insertion order, so
loading overrides first ensures they are selected.

Also registers extraLibraryPaths and libraries/pbrlib/genglsl as
source code search paths so that override implementations can
#include standard library source files.
@ppenenko ppenenko closed this Apr 28, 2026
@ppenenko ppenenko deleted the ppenenko/override-first-extra-libs branch April 28, 2026 21:43
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

Successfully merging this pull request may close these issues.

1 participant