In Godot, when you import images and other assets into the editor, there's an additional <filename>.import
file created.
What are those .import file used for? Should you commit them to your git repo?
In Godot, when you import images and other assets into the editor, there's an additional <filename>.import
file created.
What are those .import file used for? Should you commit them to your git repo?
Here's what the 3.0 docs say:
Importing will add an extra .import file, containing the import configuration. Make sure to commit these to your version control system!
And similarly the 4.0 docs say something very similar (emphasis theirs):
Importing will add an extra .import file next to the source file, containing the import configuration.
Make sure to commit these files to your version control system, as these files contain important metadata.
Search "godot import files" on Google should lead to these docs.
Previous answer cites the Godot docs as important to commit to git but at these docs, if you read on, it is quickly dismissed as optional:
If any of the files present in this folder [.import] is erased (or the whole folder), the asset or assets will be reimported automatically. As such, committing this folder to the version control system is optional. It can save time on reimporting time when checking out in another computer, but it takes considerably more space and transfer time. Pick your poison!
When various assets are imported into the game they can have special options for ways to import that type of asset, such as filtering of a texture. These assets will have processing applied when imported into the game editor, the .import director, as an optimization for resource loading.
With Godot 4, the base folder has changed to ".godot"
If you have more then one import preset for a single type of asset, commit the import directory. If you don't care about how the asset is imported don't commit import directory.
https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/import_process.html
I'm running a CI on a RaspberryPi4 and need to regenerate the import from a fresh clone of the repo. Trying to run scripts from the command line runs into issues because it cannot find various resources/assets for the game. This can be fixed by regenerating the .import
directory. Many warnings from the command line before an the import say, "please run the project in the editor at least once". Simply opening the project will import all assets of the game.
Relax, just ignore. All the projects that I worked on godot never generated conflict without importing them. Also because each ".import" is unique from PC to PC.