fix(glb): remove invalid export_colors param + fix viewer stale mesh
4 root causes fixed:
1. export_colors=False was removed in Blender 4.x — caused every Blender
export to fail (exit 1) and always fall back to trimesh. Remove it.
Blender now runs the full pipeline: materials + sharp edges.
2. GlbModel cloned ref never reset on url change — key={glbBlobUrl} forces
React to remount GlbModel on each new blob URL, resetting the ref so
fresh geometry is always loaded.
3. glbBlobUrl not cleared before re-fetch — setGlbBlobUrl(null) added at
start of downloadUrl effect so spinner shows instead of stale mesh.
4. staleTime: 30_000 delayed picking up new MediaAsset after generation.
Changed to staleTime: 0 so invalidation always triggers immediate refetch.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,7 @@ def main() -> None:
|
||||
apply_asset_library_materials(args.asset_library_blend, material_map, link=False)
|
||||
|
||||
# Export GLB with full PBR material data
|
||||
# Note: export_colors was removed in Blender 4.x — do not pass it.
|
||||
try:
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=args.output_path,
|
||||
@@ -132,7 +133,6 @@ def main() -> None:
|
||||
use_selection=False,
|
||||
export_materials="EXPORT", # export all materials (Principled BSDF → glTF PBR)
|
||||
export_image_format="AUTO", # embed textures (base color, normal, roughness maps)
|
||||
export_colors=False, # skip vertex colors (we use library materials)
|
||||
)
|
||||
except Exception as exc:
|
||||
print(f"GLB export failed: {exc}", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user