How to avoid assets folder clutter with auto-generated *.import files?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Iskander (Alex) Shar

Question: Is there any way to avoid working directory clutter with “*.import” files?

Context

When a PNG file is moved into the project, *.import file is generated.

There is also a “.import” folder inside the project root, but since it’s hidden and it’s separate from my files, I’m OK with it. What bothers me though is having auto-generated files near the files that I’ve added manually.

There is not much info on these files available. So far I only found this:

I also found this issue, but I’m not sure if it’s about *.import files outside of the .import folder or about a “.import” folder itself:

Update: Don't store the .import file when using the default settings · Issue #24177 · godotengine/godot · GitHub
It seems like some *.import files are stored inside “.import” folder now?

I also wonder why it’s necessary to store these files outside of the hidden engine-related folders?

:bust_in_silhouette: Reply From: Zylann

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 Image or 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.

The .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:

project/assets/foo.png
=>
project/D/assets/foo.import

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