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
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.

                             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-09-04 12:20:37