Art asset viewer PBR debug replaces multi-material meshes with a single swap #1040

Closed
opened 2026-08-13 05:07:17 +00:00 by spikerj · 1 comment
Owner

In ArtAssetViewerComponent.setChannel, a mesh whose material is an array (multi-material GLB) stores the whole array in originalMaterials, then assigns mesh.material = swap using only original[0] as the source map.

During a non-lit PBR debug channel the second (and later) materials disappear; lit restores the array so the bug is easy to miss after toggling back. A characterization test in art-asset-viewer.component.spec.ts pins the restore path; the swap still collapses the array.

Expected: each material slot gets its own channel swap (or the debug view keeps the array length).

Source: libraries/features/art-studio/src/lib/art-asset-viewer/art-asset-viewer.component.ts (setChannel / channelMaterial).

In `ArtAssetViewerComponent.setChannel`, a mesh whose `material` is an array (multi-material GLB) stores the whole array in `originalMaterials`, then assigns `mesh.material = swap` using only `original[0]` as the source map. During a non-lit PBR debug channel the second (and later) materials disappear; `lit` restores the array so the bug is easy to miss after toggling back. A characterization test in `art-asset-viewer.component.spec.ts` pins the restore path; the swap still collapses the array. Expected: each material slot gets its own channel swap (or the debug view keeps the array length). Source: `libraries/features/art-studio/src/lib/art-asset-viewer/art-asset-viewer.component.ts` (`setChannel` / `channelMaterial`).
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.