godotengine / godotengine/godot
Unable to clear custom scene import settings once applied
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Godot 4.2.1
### System information
Windows 11, gl_compatibility, NVidia RTX 3070 TI
### Issue description
If a GLB file is imported and the import settings are customized (E.G. turning on physics collider generation for some meshes), then these custom settings are written to the "_subresources" section of the .import file. For example:
```
_subresources={
"nodes": {
"PATH:RootNode/Armature/Skeleton3D/Body": {
"generate/physics": true
}
}
}
```
If the import dialog is reopened for the GLB file and the settings cleared back to defaults (E.G. turning physics back off); then the settings cannot be cleared from the import file and colliders continue to be erroneously generated.
The problem can be traced to the `EditorFileSystem::_reimport_file` method which is correctly called with import settings (p_custom_options argument) containing no "_subresources"; however it contains logic to merge missing properties from the existing .import file.
As such any change which resets "_subresources" to empty (no custom settings) simply results in the previous custom settings being reapplied - there is no mechanism for clearing the "_subresources" from an import file once they get written.
### Steps to reproduce
Reproduction steps captured in description
### Minimal reproduction project (MRP)
N/A
Contributor guide
Assessment
This issue has not been assessed yet.