Creates a MaterialsPalette.
Optionalcatalog?: PainterCatalogEntry[]Override the default catalog. When omitted, the palette ships with every applicable model!procgen.paintMaterials | paintMaterials painter pre-registered.
OptionaltextureSize?: numberPainter texture size in pixels. Default
256.
OptionaluvScale?: numberMetres of geometry per texture repeat,
forwarded to each created SceneMaterial as triplanarScale.
Default 1.0.
ReadonlycatalogPainter catalog. Each entry carries an id, a human-readable label, a category, the painter callable, and any non-texture material parameters (opacity / colour tint / alpha mode).
Painter texture size in pixels (square). Default 256.
Larger values produce sharper close-up texturing at the cost of
a one-off paint cost on first use.
Approximate metres of geometry per texture repeat. Forwarded
to each created SceneMaterial as triplanarScale, which
the renderer's triplanar texture-sampling fallback consults
when painting UV-less geometry (typical of BIM, sweeps and
lofted curves). Smaller values tile the painted texture more
times across each surface. Default 1.0.
Look up a painter entry by id, or undefined when no entry
matches.
List painter ids registered in the catalog, in declaration order. Convenient for building UI menus.
Replaces sceneMesh on its parent SceneObject with a
fresh SceneMesh whose materialId references the palette's
SceneMaterial for painterId. The new mesh keeps the same id,
geometry, local matrix, opacity, and parent transform — only the
material binding changes.
Mesh replacement uses the supported detach + destroy + recreate
The SceneMesh to repaint. Must be attached to a SceneObject in a SceneModel.
Catalog entry id (e.g. "brick",
"polSteel").
SDKResult — ok: true with the new SceneMesh on
success; ok: false when the mesh is detached / destroyed /
the painter is unknown / texture or material creation fails.
Catalog of model!procgen.paintMaterials | paintMaterials painters plus a method to swap a SceneMesh's material to one of them at runtime.
Per-(SceneModel, painter) materials are created on first use and cached, so applying the same painter to many meshes — or to many objects — produces a single shared SceneMaterial backing all of them rather than a fresh material per mesh.
The mesh-replacement path mirrors the supported mutation pattern the SDK documents: snapshot the mesh's params (id, geometryId, matrix, opacity, parentTransform), detach it from its SceneObject, destroy it, then create a new SceneMesh with the same id but bound to the palette's SceneMaterial and re-attach to the same SceneObject. The object keeps its identity; only the mesh-material binding changes.