-
Notifications
You must be signed in to change notification settings - Fork 102
[FIX] Allow scene to load even with warnings #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the model viewer's error handling by allowing glTF models to load even when some external resources (textures) are missing, replacing them with magenta placeholder textures. It also provides more contextual error messages for missing buffer files and adds a dismissible warning UI to inform users about non-critical issues during model loading.
- Implemented graceful texture loading with placeholder fallbacks for missing or failed texture loads
- Added warning collection and display mechanism with a new WarningsBox UI component
- Improved error messages for missing buffer files with context-aware guidance (single file vs folder drag)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/viewer.ts | Added placeholder texture creation for missing/failed textures, enhanced error messages for buffer files, and integrated warning collection throughout the glTF loading pipeline |
| src/types.ts | Added optional warnings array to UI state for non-critical loading issues |
| src/ui/errors.tsx | Made ErrorBox dismissible and added new WarningsBox component with similar styling and dismiss functionality |
| src/ui/index.tsx | Integrated both ErrorBox and WarningsBox components with proper prop passing |
| src/style.scss | Added consistent container-based styling for both error and warning boxes, improved CSS selector specificity for title styling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
slimbuck
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweeeeeeet! <3
|
Many thanks!! |
Fixes #324
viewer-errors.mp4
Overview
This PR improves the model-viewer's handling of missing external resources (textures and buffer files) when loading glTF models. Previously, the viewer would show an ambiguous error and fail to display the model. Now it provides meaningful error messages and, where possible, continues to display the model with placeholder textures.
Changes
Graceful Texture Loading
Warning UI
Improved Error Messages
.binbuffer files now show helpful context-aware error messages:.gltffile: suggests dragging the parent folder instead.binfile is missingUI Improvements
Files Changed
src/viewer.ts- Added texture/buffer error handling with placeholder textures and meaningful error messagessrc/types.ts- Addedwarningsproperty to UI statesrc/ui/errors.tsx- Added WarningsBox component, made ErrorBox dismissiblesrc/ui/index.tsx- Integrated WarningsBox componentsrc/style.scss- Added styling for warning/error containersTesting
.gltffile with missing textures → Model displays with magenta placeholders, warning shown.gltffile without its.binfile → Helpful error message about dragging the folder.gltfbut missing.bin→ Error message about missing buffer fileI confirm I have signed the Contributor License Agreement.