fix(render,sim): preserve MechPaint albedo/COLOR_0, monotonic tracer VFX IDs, dither fade, and GLB COLOR_0 check

This commit is contained in:
Meta Vens 2026-12-05 00:26:13 +01:00
commit d81865091d
8 changed files with 201 additions and 56 deletions

View file

@ -383,6 +383,22 @@ def validate_vehicle(vid: str) -> dict[str, Any]:
if plane not in ("Dorsal", "Coronal"):
raise AssertionError(f"{vid}: invalid plane {plane!r}")
# 3b. Check every mesh primitive carries baked COLOR_0 attributes (AO, Edge, Island, RestHeight)
meshes = gltf.get("meshes", [])
if not meshes:
raise AssertionError(f"{vid}: GLB contains no meshes")
prim_count = 0
for m_idx, mesh in enumerate(meshes):
for p_idx, prim in enumerate(mesh.get("primitives", [])):
attrs = prim.get("attributes") or {}
if "COLOR_0" not in attrs:
raise AssertionError(
f"{vid}: mesh[{m_idx}] ({mesh.get('name', '?')}) primitive[{p_idx}] missing COLOR_0 attribute"
)
prim_count += 1
if prim_count == 0:
raise AssertionError(f"{vid}: GLB contains zero mesh primitives")
# 4. Check GLB triangle count & grounded +Y-up / +Z-forward bounds
tri_total, g_min, g_max = compute_glb_stats(gltf, bin_blob)
max_tris = 50000 if vid in RETROFIT_MECHS else 35000