editor icon indicating copy to clipboard operation
editor copied to clipboard

fix(editor): guard scene export against objects without geometry

Open anton-pascal opened this issue 6 months ago • 1 comments

Problem

Three.js exporters (OBJ/STL/GLTF) crash when traversing scene objects without valid geometry — Groups, Lights, Cameras, or meshes with disposed geometry cause Cannot read properties of undefined (reading 'count') and similar errors.

Sentry: EDITOR-6H (283 events), EDITOR-6G, EDITOR-79 — 428+ combined.

Fix

Add a prepareSceneForExport helper that:

  1. Deep-clones the scene group
  2. Traverses and removes objects without valid geometry/material
  3. Returns a clean export-safe scene

Also wraps each export format in try-catch for additional resilience.

Testing

  • Export a scene with mixed objects (meshes + lights + groups) → no crash
  • Exported file contains only valid geometry

anton-pascal avatar May 17 '26 04:05 anton-pascal

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed – May 17, 2026, 4:09 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

mintlify[bot] avatar May 17 '26 04:05 mintlify[bot]