Godot's resource caching can cause a lot of issues when working on tools for your games.
Editor, when running, assumes it has an authority on resources and ignores changes done to your custom resources externally. "Externally" here doesn't even mean "outside of Godot editor". It just means "outside of Godot editor's own resource saving logic".
On top of that, ResourceLoader.load
is untrustworthy when it comes to ignoring cache. While the main loaded resource will respect the nocache
argument and will be returned fresh, its subresources are not so lucky.
To fight that I have a truly fresh resource loader util method, that copies the file before loading to a randomly named path, loads it from there and then takes over the old path. That ensures for your plugins and running scenes that the resource is truly loaded from the disk.
However, editor is not so impressed with these efforts normally. To fight that, I had to create a tiny plugin. It can be adapted to other use cases, but for my current project I needed it to force rescan resources after I run a custom scene. So that's what it does. And then, when the resource is reloaded, it resaves it for good measure using the previously described utility method.