mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-21 06:50:43 +01:00
file.exportTextures takes `materialX: true` and, next to the textures, writes one `<mesh>_<set>.mtlx` per texture set: an open_pbr_surface whose inputs read tiledimage nodes, inside a surfacematerial. It follows the "OpenPBR (separate maps)" preset's inputs (base, metalness, roughness, anisotropy, coat, fuzz, transmission, subsurface, emission, opacity, normal through a normalmap node, height as a displacement shader). Colour maps are tagged srgb_texture; data maps are linear. UDIM sets use the <UDIM> filename token. A set with no OpenPBR map, or DirectX normals (the normalmap node reads OpenGL), is reported in `warnings`. Written from the ASWF MaterialX 1.39 and OpenPBR Surface specifications, in pure Rust with no MaterialX library. Engine tests cover a two-set export, UDIM and the off/warn paths. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>