Because those files actually store information that are useful to your project. For example if you want a particular PNG to be imported with mipmaps, smooth filter, or pixel-art filter, sRGB etc, or even not import it as
Texture but as
TextureArray instead, this is where the info goes. These files must then be in your project, and you should version them if you use VCS.
They get “auto-generated” to contain the default settings, but you may want to change them as well, per file. That data has to go somewhere, and should not be forgotten about.
The idea behind Don't store the .import file when using the default settings · Issue #24177 · godotengine/godot · GitHub is NOT to get rid of these files, only to not put them next to project files if you did not change any default values. However it creates new issues and you will still have some
.import files next to customized resources so it’s not yet decided if that’s a good idea or not.
.import folder, on the other hand, is auto generated but only contains calculated data. It acts like a resource cache so the editor doesn’t have to re-import everything each time you open it. It’s fine to delete it and not version it, because the editor can regenerate it with no more info than what can be found in the project.
This doesn’t answer my question though.
I understand that these files are needed by the engine.
There is no technical reason to store them right next to my files. I’m new to the Godot, but suppose all of them are stored in some directory D (the exact name doesn’t matter much). That directory D can either store a mapping file + have a flat structure or it can mimic the root folder structure and place import files there:
So, it’s still possible to find/edit that file either by hand or through the Godot Editor (which is probably the correct way to do it).
Iskander (Alex) Shar | 2020-05-25 18:20
There is no technical reason to store them right next to my files
To not forget them, and avoid bookeeping complexity (both for the editor, or for you if you move those files from elsewhere). But I see your point, they could somehow be placed somewhere else, if the editor keeps a mapping of how to find them I guess? You could make a proposal to have that sort of option maybe.
Zylann | 2020-05-25 20:07
I agree, having separate folder in a project would be optimal. Having twice as much files everywhere is not convenient.
Ingeniou5 | 2022-01-12 11:41