Skip to content

Give a clear error when a glTF/GLB requires an unsupported extension - #12858

Merged
rerun-sync[bot] merged 1 commit into
rerun-io:mainfrom
wuisabel-gif:gltf-clear-error-unsupported-extension
Jul 23, 2026
Merged

rerun-sync[bot] merged 1 commit into
rerun-io:mainfrom
wuisabel-gif:gltf-clear-error-unsupported-extension

Conversation

@wuisabel-gif

Copy link
Copy Markdown
Contributor

What

Loading a Draco- or meshopt-compressed glTF/GLB currently surfaces the raw gltf crate validation error:

invalid glTF: extensionsRequired[0] = "KHR_draco_mesh_compression": Unsupported extension

which names the extension but doesn't tell the user what to do. This maps that case to an actionable error instead:

This file requires glTF extension(s) that Rerun does not support: KHR_draco_mesh_compression.
If this is Draco or meshopt compression, re-export the model uncompressed.

How

gltf::import_slice rejects unsupported extensionsRequired during validation, before any geometry is read (verified against gltf 1.4.1), so the previously-hypothesized "mesh has no triangles" path never triggers. On the import_slice error we re-parse with Gltf::from_slice_without_validation purely to recover and name the required extensions.

This is the "give a decent error message" slice of #6365 — it does not add Draco/meshopt decoding.

Confidence / disclosure

Written with the help of a coding agent (Claude), reviewed by me. Confidence is high: the change is small and localized to the import error path, the underlying gltf behavior was verified empirically, and there's a unit test covering the extension-naming. I'm less familiar with how this error ultimately renders in the viewer UI, so pointers there are welcome.

Part of #6365.

Loading a Draco- or meshopt-compressed glTF/GLB previously surfaced the raw
`gltf` validation error ("invalid glTF: extensionsRequired[0] = ...:
Unsupported extension"), which doesn't tell the user what to do about it.

`gltf::import_slice` rejects unsupported `extensionsRequired` during validation
before any geometry is read, so on that error we re-parse without validation
(`Gltf::from_slice_without_validation`) to name the offending extensions and
suggest re-exporting uncompressed.

Part of rerun-io#6365.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for opening this pull request.

Because this is your first time contributing to this repository, make sure you've read our Contributor Guide and Code of Conduct.

@Wumpf Wumpf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, thanks for improving this!

@Wumpf Wumpf added 📺 re_viewer affects re_viewer itself include in changelog labels Jul 23, 2026
@Wumpf

Wumpf commented Jul 23, 2026

Copy link
Copy Markdown
Member

@rerun-bot reality-sync

@rerun-sync

rerun-sync Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@rerun-sync
rerun-sync Bot merged commit bc20fa7 into rerun-io:main Jul 23, 2026
43 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants