godotengine / godotengine/godot
EditorExportPlugin: _customize_resource and _customize_scene do not respect convert_text_resources_to_binary setting
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Confirmed in: v4.3.dev5.official [89f70e98d], v4.2.1.stable.official [b09f793f5], v4.1.1.stable.official [bd6af8e0e], v4.0.3.stable.official [5222a99f5]
### System information
Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.4633) - AMD Ryzen 9 7900X 12-Core Processor (24 Threads)
### Issue description
When `_begin_customize_resources` returns true in an `EditorExportPlugin`, some scenes and resource files are converted to binary on export regardless of the `editor/export/convert_text_resources_to_binary` setting.
The MRP contains a single plugin, consisting of an `EditorImportPlugin`, a custom `Resource` type created by the import plugin, and an `EditorExportPlugin`, which does nothing but return true for `_begin_customize_resources`. It also contains a text file, named `test.xyz`, containing three lines of text which are imported into a custom `XyzFile` resource by the import plugin.
In my observation, native Godot resources do not _seem_ to be affected by this problem, but `Resource`-derived types saved in `.tres` files in `.godot/imported` do. I don't know if it's a problem with how I'm setting up and using the custom resource importer, but perfectly vanilla `.tscn` files are also affected, so I assume that's not the issue.
In practice, I haven't noticed any problems loading the binary-converted files, but the documentation does warn that **"[@GDScript.load](https://docs.godotengine.org/en/stable/classes/class_%40gdscript.html#class-gdscript-method-load) will not be able to return the converted files in an exported project"**, which makes the behavior slightly concerning as someone who has to dynamically load a wide array of custom resources created by import plugins.
If nothing else, it feels inconsistent enough to be noteworthy.
### Steps to reproduce
1. Export the provided project (as PCK/ZIP, to see what's being exported)
2. `main.tscn` and `test.xyz` (a custom resource) are exported to `.godot/exported` as binary data, even though `editor/export/convert_text_resources_to_binary` is set to false
3. Open `addons/xyz/xyz_exporter.gd` and modify `_begin_customize_resources` to return false
4. Export the project again
5. `main.tscn` and `test.xyz` are now both exported as text resources, as expected
6. Set `editor/export/convert_text_resources_to_binary` to true in the editor settings
7. Export the project again
8. `main.tscn` is exported as binary (as expected), and `test.xyz` is exported as text (unexpected)
### Minimal reproduction project (MRP)
[customize_resources_bug.zip](https://github.com/godotengine/godot/files/15074919/customize_resources_bug.zip)
Contributor guide
Assessment
This issue has not been assessed yet.