Skip to content

Add MaterialX validation script and CI workflow - #301

Draft
jamportz wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
jamportz:add-mtlx-ci
Draft

jamportz wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
jamportz:add-mtlx-ci

Conversation

@jamportz

Copy link
Copy Markdown
Contributor

Summary

  • Adds validation/validate_mtlx.py, a script that validates .mtlx files against the MaterialX standard libraries
  • Adds .github/workflows/validate-mtlx.yml, which runs the validator on reference/open_pbr_surface.mtlx and all examples/*.mtlx on every PR or push that touches .mtlx files

How it works

The validator uses pip install materialx (no build-from-source required), loads the standard libraries, and runs doc.validate(). It also performs an explicit nodename reference check on the standalone document — this catches dangling connections that the with-libraries validation misses when a file shares a name with a standard library file (as open_pbr_surface.mtlx does with libraries/bxdf/open_pbr_surface.mtlx).

Test plan

  • Workflow triggers on PRs that modify .mtlx files
  • reference/open_pbr_surface.mtlx passes
  • All examples/*.mtlx pass
  • A PR that introduces a broken nodename reference fails CI

🤖 Generated with Claude Code

Adds validation/validate_mtlx.py and a GitHub Actions workflow that
validates reference/open_pbr_surface.mtlx and all examples/*.mtlx on
every PR or push that touches .mtlx files.

The validator uses pip-installed MaterialX (materialx on PyPI) for zero
dependency setup. It also performs an explicit nodename reference check
on the standalone document to catch dangling connections that
with-libraries validation misses when a file shares a name with a
standard library file.

@najibna najibna left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The explicit nodename check plus check_library_shadowing() is the part that actually matters — reference/open_pbr_surface.mtlx shares a basename with the MaterialX stdlib copy, so doc.validate() alone can miss dangling connections.

validation/validate_mtlx.py is a large general linter, and pip install materialx is unpinned. --version is also a store_true next to a required positional file, so python validation/validate_mtlx.py --version fails. A thin wrapper around doc.validate() plus the shadowing check would be easier to maintain.

@AdrienHerubel
AdrienHerubel marked this pull request as draft September 22, 2026 18:17

This branch has not been deployed

No deployments
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.

2 participants