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:

  • matInst table
    Material instance (supports <code>setColor</code>, <code>setAlpha</code>, <code>setEmission</code>)
    
  • noteColor {number,number,number} RGB triplet {r, g, b}
  • state string or boolean Surface state: "active", "semiactive", "inactive", or legacy true for active
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 .notes array of note tables
  • categoryMap table

    Optional map from category name to material key.

                             Defaults to:
                             <code>{ joints=&quot;onyx&quot;, labels=&quot;onyx&quot;, edges=&quot;metal&quot;, curves=&quot;metal&quot; }</code>
    
    (optional)
generated by LDoc 1.5.0 Last updated 2025-12-06 11:03:56