godot: AnimatedTexture: ext_resource, invalid UID
Godot version
v4.0.beta16.official [518b9e580]
System information
Windows 10
Issue description
I am using an AnimatedTexture to create a spinner icon, it loads 8 spinner textures and combines them into one animation. When I close the project and delete the *.import files, then open them again, the *import files are created but the UID is invalid and I get the following warnings.
W 0:00:00:0803 Test.gd:5 @ _ready(): res://assets/spinner.tres:3 - ext_resource, invalid UID: uid://crhotvwkqevtn - using text path instead: res://assets/spinner/Progress7.svg
<C++ Source> scene/resources/resource_format_text.cpp:448 @ load()
<Stacktrace> Test.gd:5 @ _ready()
I used this texture in my plugin and typically the images are imported when the project is opened or a plugin is installed. But it does not work for AnimatedTexture.
Steps to reproduce
Open the attached project and run the test scene. You will receive 8 warnings.
Minimal reproduction project
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (7 by maintainers)
Commits related to this issue
- Add Import files Per Issue godotengine/godot#72273 in comment from akien-mga, import files should be committed to Github repo, as it contains import settings for textures, and other files, as well as... — committed to eumario/godot-manager by eumario a year ago
- moving splash assets to fox to share the .import | + .import files should be commited, see https://github.com/godotengine/godot/issues/72273 — committed to uralys/fox by chrisdugne 5 months ago
In Godot 4 the external dependencies are tracked by UID and path, and UID is checked first. Thanks to this you can have a file anywhere in the project and copy it to anywhere in another project and all dependencies will just work if you copy all necessary files. UIDs are stored inside resources. In case of TRES/RES files they are directly inside, in case of PNGs and other imported files, they obviously can’t be inside the file, so they are stored inside
.import
. If you delete the.import
file, the UID is re-assigned, so all dependencies using this UID will complain and try to use path.While deleting these files “worked” in 3.x, it doesn’t mean it was correct to do so. If you used any import settings like repeat of filter, they’d be lost.
Closing as it’s not a bug nor a regression of any kind.
@KoBeWi The main problem “was” that a plugin spams this kind of errors when no *.import files are included. This was not necessary in Godot3 is only mandatory with Godot4. At the time of bug creation I could see a different behavior of AnimatedTexture and standard textures when loading (no *.import files included). The error was only spam for AnimatedTexture. Since I deliver the *.import files with the plugin there are no more error messages.
Be that as it may, I find it a pity that you are now forced to deliver the *.import files with the plugin, although they are newly created during the first import. Thus, in the end, the resources are found and re-imported, the displayed error is just very misleading.
That this new behavior confuses users can be well seen by the number of related bug issues created pointing to loading issues with UUID resources.
For me, this is done so far, the ticket can therefore be closed gladly.
Yes,
*.import
files (likecharacter.png.import
) should be pushed to your Git repository. Those files contain information on how to import the file. If you delete them, it will use default values, which may no be what you want.Godot 4.0 RC1
scene/resources/resource_format_text.cpp:448
Also spams when using version controls systems. If a colleague does some changes to scenes hisuid
s are put into scene files. Also, we have an in-game level editor that creates PackedScenes, which we can open & edit with Godot editor, and that is multiplying the spam.So what exactly is the problem here? Texture UUID is stored inside the
*.import
files, which don’t exist in your MRP. Once you import the project and re-save the texture, the warnings will be gone and will not re-appear when you delete.godot
folder. Everything functions as intended. Also not sure what you mean by “AnimatedTexture being special”. It’s not even related to the animated texture. You will get the same warning when you add a sprite to your scene withicon.svg
and then deleteicon.svg.import
.This was the same on Godot 3. You’re confusing the
*.import
files and theres://.import/
folder (nowres://.godot/
in Godot 4). The folder, you shouldn’t commit, but the*.import
files, you should. It’s been like this since Godot 3.0.