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()

image

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

AnimatedTexture.zip

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

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 (like character.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 his uids 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 with icon.svg and then delete icon.svg.import.

sounds like a regression, this was not need on Godot3

This was the same on Godot 3. You’re confusing the *.import files and the res://.import/ folder (now res://.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.