TypeScript monorepo for reading, validating, and writing MaterialX XML, with node definitions generated from upstream MaterialX nodedef documents.
packages/mtlx-core- typed MaterialX document model, XML parser/serializer, filesystem IO helpers, validation API, generated node registrypackages/mtlx- command-line tool built withyargs-file-commandspackages/materialx-three- MaterialX to Three.js TSL compiler/runtime for Standard Surface and OpenPBR workflowsapps/viewer- TanStack Start preview app for interactive MaterialX -> Three TSL diagnostics, rendering, and upstream sample browsing
pnpmworkspaces monorepo- TypeScript native preview (
tsgo) with composite projects oxlint+oxfmtvitestfor package testsvitest-command-linefor CLI subprocess tests
pnpm installpnpm lint
pnpm format
pnpm tsc
pnpm test
pnpm build
pnpm cli -- --helpRelease scripts stage each package into publish/, rewrite workspace:* dependencies to real versions, and then publish.
Prerequisites:
- Root
LICENSEfile must exist (release fails if missing) - npm auth must be configured for publish
Commands:
# Publish one package
pnpm release:package packages/mtlx-core
# Publish all packages in order
pnpm release:all
# Dry-run staging only (no npm publish)
pnpm release:package packages/mtlx-core --dry-run
pnpm release:all --dry-runNode definitions are generated from:
../MaterialX/libraries/**/*.mtlx
Run:
pnpm generate:nodesThis regenerates:
packages/mtlx-core/src/generated/node-registry.generated.ts
pnpm cli -- info <input.mtlx>
pnpm cli -- check <input.mtlx|input.mtlz>
pnpm cli -- pack <input.mtlx>
pnpm cli -- unpack <input.mtlz>Current test fixtures are loaded from the local upstream checkout in ../MaterialX, including:
resources/Materials/Examples/StandardSurface/standard_surface_brick_procedural.mtlxresources/Materials/Examples/OpenPbr/open_pbr_default.mtlxresources/Materials/TestSuite/stdlib/texture/image.mtlxresources/Materials/TestSuite/stdlib/texture/tiledimage.mtlxresources/Materials/TestSuite/stdlib/math/math_operators.mtlxresources/Materials/TestSuite/stdlib/compositing/compositing.mtlx