From 26ae88dea890e8e73ec588c69b3e2375315d05c7 Mon Sep 17 00:00:00 2001 From: m3ultra Date: Mon, 3 Aug 2026 16:47:20 +1000 Subject: [PATCH] Record the real PBR attribute layout (6 channels) base_color 0:3, metallic 3:4, roughness 4:5, alpha 5:6 - the pipeline's own pbr_attr_layout. o_voxel's baker indexes this dict BY NAME and raises KeyError deep inside to_glb on any missing slot rather than at the call, so a partial layout looks like a baker bug. Needed by the texture stage; recorded now while it is in hand. Co-Authored-By: Claude Fable 5 --- pixal3d_mlx/mesh.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pixal3d_mlx/mesh.py b/pixal3d_mlx/mesh.py index 52d653a..fc51200 100644 --- a/pixal3d_mlx/mesh.py +++ b/pixal3d_mlx/mesh.py @@ -28,6 +28,16 @@ import numpy as np # Upstream fixes both: the model always works in a unit cube centred on the origin. AABB = [[-0.5, -0.5, -0.5], [0.5, 0.5, 0.5]] +# How the texture decoder's 6 channels map to PBR slots (pipeline's pbr_attr_layout). +# o_voxel indexes this dict by name and raises KeyError on any missing slot, so a +# partial layout fails deep inside the baker rather than at the call. +PBR_ATTR_LAYOUT = { + "base_color": slice(0, 3), + "metallic": slice(3, 4), + "roughness": slice(4, 5), + "alpha": slice(5, 6), +} + def _torch(a): import torch