-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't store the .import file when using the default settings #1060
Comments
Not storing the .import files at all could be a problem if you change the default import configuration down the road. |
In that case, you can reimport all assets with previous defaults (although that basically reintroduces the problem...) But tbh, is there any way for the new defaults to change and break anything? I doubt it will be decided that we should change something that will impact many projects and won't be necessary. |
Major version numbers allow for breaking compatibility, so this could be done in 4.0, complete with automatic migration so you don't have to manually reimport anything (it would basically just come down to checking if an asset has an import file in the current location, and if it does, moving it to the dedicated import folder). |
Import files could also be hidden: |
Maybe having a
|
|
Why ? The |
Well, I have an aversion for having too many directories in the project, because they create more clutter than files. Bun on a second though, if it was hidden in the editor (which is rather obvious it would), there wouldn't be a difference if it was a file or directory 🤔 |
Yeah it would be hidden. |
For people sorting their file managers by alphabetical, there could be a prefix for the import files. Kill two birds with one stone by putting a While the input files would still be in the same directory, they would be grouped next to each other and separate from the actual assets. |
100% agree, this solves all problems, there's no point in having |
I was about to make an Issue concerning the *.import-files clutter, because of other reasons. Also because it's a mess and it's ugly. I support the idea to place the .import files in a dedicated folder under project-root. At least as option in project-settings |
We discussed this today with core contributors. The consensus was that we don't think it's a good idea for the following reasons:
Some of the reactions here also show a confusion between the files generated in the As for renaming them for visual grepping, I don't think that this is more useful than having them share the same prefix as the file that they qualify. IMO it's fine as is. |
@akien-mga thanks for your response and explanations, there was one thing I did not understood yet, what are the problems involved with moving everything related to I think that this is different from what you commented above, correct me if I'm mistaken. |
@akien-mga Please note that this md5 sum is not the contents of the file, but only its path. For example, I have a file res://etc/icon.png.import
Yes, this file contains the line For example:
As we can see, these are completely different MD5s. And all other import parameters can be saved to the Fragment of the project.godot file
Thus, the algorithm for determining the parameters is as follows: if there is a corresponding |
I think .import files should be stored inside a directory like .import_info or .godot. Example res://.import_info/etc/icon.png.import or res://.godot/etc/icon.png.import |
Note that the |
I just created a project for a quick test to report a bug, and in my rush I created the project in my home folder. I didn't realize what I had done until it was too late. Godot proceeded to mess up my entire home folder with import files without mercy, and there was no way to stop it. I know it's my fault, but the approach used by git of creating any files inside a .git folder seems much better, and if Godot did the same messing up like I did would basically be impossible. |
@turtl8 Unlike the git folder, you are supposed to include these files in your version control system, so they must be a part of your project structure, and not hidden away. |
That's a different topic I think? What I was saying is that the generated files could be in one place, and not created all over the place and polluting the user file system. That doesn't require that they are in a hidden folder or anything, I just used git as a popular example of having them in one place. |
The correct fix is to prevent Godot from creating a project directly within |
There are two "generated" files associated with each asset. One is its import config, which is stored in the You gave an example of Git having a So as mentioned above, to solve your problem we should instead consider some paths protected and never allow to create a project in them. Your proposed solution, while also addressing your problem, has a negative impact for the normal use of the engine. |
I would think creating a single folder in one place might create less noise than creating files all over the place. It's not just git, I can't think of any software that creates a bunch of files in a user directory and doesn't put them all in one place, vscode, dropbox, node_modules... all put things in one place, and git tracks dot folders by default: plenty of people keep the .vscode or .idea directories in their source control. But the worst case scenario is probably just careless people like me messing up the home folder, preventing that might be good enough so I'll stop arguing and leave you to more productive things. |
Unity and its .meta files. It's even worse than Godot, because every single file has a meta, not just imported files. |
Describe the project you are working on:
A very big metroidvania game with lots of assets.
Describe the problem or limitation you are having in your project:
I have hundreds of assets in my project (and not counting text assets like
.tres
or.tscn
). About 90% are PNGs and the rest is WAVs and OGGs. And because each of them have a corresponding.import
file, this number is doubled.Now, the amount of assets is not a problem in itself. The problem is that I spend lots of time in the system file explorer, because I can't do everything from the editor (e.g. I can't edit an image and duplicating files is more difficult). And the
.import
files make it really difficult to efficiently manipulate files. I organize everything in sub-folders and for almost each folder I have to change sorting to sort by type, because the.import
files are intertwined with the relevant files and I often get lost because of this. It's horrible.Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Most of the times, the
.import
files are completely useless. In my project, I only ever change texture filtering/repeat options (which will no longer be a thing in 4.0) and loop points in some OGGs. Every other.import
file (so like 70% of them, or ~95% in 4.0 with the new filtering settings) has a default value.My proposal is: remove these files. If an
.import
file has default settings it means it can be auto-generated and you don't need it in your project. They should just go away. Disappear. Vanish. Only modified.import
files should be kept. This would reduce file clutter immensely.Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
When importing asset, don't store
.import
file for this asset if it's imported with default import settings. This should be checked also on reimport and the file should be created/removed automatically whenever necessary. AFAIK.import
files store some necessary information related to the file itself (remap or something). This is however auto-generated, so it can be stored inside.import
directory.Before:


After:
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Nope, there's no way to avoid it with scripts.
Is there a reason why this should be core and not an add-on in the asset library?:
Because it's tightly related to import system.
btw, this was formerly discussed here: godotengine/godot#24177
The text was updated successfully, but these errors were encountered: