godotengine / godotengine/godot
`get_scene_groups` error after failing to load an invalid .glb file as scene
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in 4.3.rc1.
- Likely reproducible in earlier 4.3 builds too, since scene groups were implemented.
### System information
Fedora Linux 40 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7600M XT (RADV NAVI33) - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 Threads)
### Issue description
When first importing a project with an invalid `.glb` file (e.g. compressed with Draco, which we don't support), there's a bunch of errors originating from the gltf module (as expected, though we should streamline this further to avoid spamming), but now there's also an error from PackedScene:
```
ERROR: Condition "packed_scene.is_null()" is true. Returning: HashSet()
at: get_scene_groups (scene/resources/packed_scene.cpp:2171)
```
Full log output:
```
ERROR: GLTF: Can't import file 'compress', required extension 'KHR_draco_mesh_compression' is not supported. Are you missing a GLTFDocumentExtension plugin?
at: _parse_gltf_extensions (modules/gltf/gltf_document.cpp:7462)
ERROR: Condition "err != OK" is true. Returning: ERR_PARSE_ERROR
at: _parse_gltf_state (modules/gltf/gltf_document.cpp:7194)
ERROR: Condition "err != OK" is true. Returning: err
at: _parse (modules/gltf/gltf_document.cpp:6896)
ERROR: Condition "err != OK" is true. Returning: err
at: append_from_file (modules/gltf/gltf_document.cpp:7427)
ERROR: Error importing 'res://object/compress.glb'.
at: _reimport_file (editor/editor_file_system.cpp:2588)
ERROR: Failed loading resource: res://object/compress.glb. Make sure resources have been imported by opening the project in the editor at least once.
at: _load (core/io/resource_loader.cpp:283)
ERROR: Condition "packed_scene.is_null()" is true. Returning: HashSet()
at: get_scene_groups (scene/resources/packed_scene.cpp:2171)
```
### Steps to reproduce
- Unzip MRP
- Delete `.godot` folder
- Open and check errors
### Minimal reproduction project (MRP)
[testreimportbug.zip](https://github.com/user-attachments/files/16441762/testreimportbug.zip)
(MRP from another report, contains a few more things than just what's minimal, but it's small enough.)
Contributor guide
Research direction
Start with get_scene_groups in scene/resources/packed_scene.cpp at line 2171, then inspect the GLTF import errors in modules/gltf/gltf_document.cpp. Reproduce the issue by deleting the .godot folder from the linked project and reopening it with the invalid Draco-compressed .glb. Done means the failed import does not produce the packed_scene.is_null() error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100