Module src.materials
Materials module for recoloring scene geometry based on active notes.
Applies ghost/X-ray or solid-emissive materials to surfaces, and recolors joints, edges, curves, and labels accordingly.
Functions
updateSurfaceMaterial (matInst, noteColor, isActive) | Update a surface’s material instance to be ghost/X-ray or solid-emissive. |
init (dream) | Initialize the materials system. |
assignAll (scene, matLib, noteSystem[, categoryMap]) | Recolor all scene objects according to their note states. |
Functions
- updateSurfaceMaterial (matInst, noteColor, isActive)
-
Update a surface’s material instance to be ghost/X-ray or solid-emissive.
Parameters:
- matInst
table
Material instance (supports <code>setColor</code>, <code>setAlpha</code>, <code>setEmission</code>)
- noteColor
{number,number,number}
RGB triplet
{r, g, b}
- isActive boolean Whether the surface (note) is active
- matInst
table
- init (dream)
-
Initialize the materials system.
Delegates to the Colors module for any setup.
Parameters:
- dream table Dream framework instance
- assignAll (scene, matLib, noteSystem[, categoryMap])
-
Recolor all scene objects according to their note states.
Applies materials for joints, edges, curves, labels, and surfaces.
Parameters:
- scene
table
Scene containing categories: <code>joints</code>, <code>labels</code>, <code>edges</code>, <code>curves</code>, <code>surfaces</code>, etc.
- matLib
table
Material library (currently unused)
- noteSystem
table
Note system with a
.notes
array of note tables - categoryMap
table
Optional map from category name to material key.
(optional)Defaults to: <code>{ joints="onyx", labels="onyx", edges="metal", curves="metal" }</code>
- scene
table