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, state) | Update a surface’s material instance to be ghost/X-ray, solid-emissive, or semiactive. |
| init (dream) | Initialize the materials system. |
| assignAll (scene, matLib, noteSystem[, categoryMap]) | Recolor all scene objects according to their note states. |
Functions
- updateSurfaceMaterial (matInst, noteColor, state)
-
Update a surface’s material instance to be ghost/X-ray, solid-emissive, or semiactive.
Applies color, alpha, and emission based on the surface state.
Parameters:
- 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.
Highlights bass and topVoice notes with override colors if configured.
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
.notesarray 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