godot
godot copied to clipboard
[3.x] Fix "Changing .import file externally doesn't trigger asset reimport"
This is an attempt to fix https://github.com/godotengine/godot/issues/60730.
I don't use Godot 4 at the moment, but seems easily portable.
The proposed approach is simple: store the md5 hash of the .import file, along with the original and imported file hashes.
When the time comes to check for the need to re-import, check that too.
If we don't find that hash, re-import (which essentially migrates the .md5 file to support the new behavior).
I found a small issue: if you change the .import file externally, on focusing the editor, the asset will be re-imported, but the Import inspector for the asset won't be updated (if open).
To be clear is this sufficient to test?
Steps to reproduce
- Open icon.png.import
- Change e.g. repeat to true
- Switch to editor
- No reimport
- Your texture doesn't repeat
- Your texture doesn't repeat in exported project
Thanks for looking at this.
To be clear is this sufficient to test?
That's how I tested it, yes (I changed the process/invert_color property instead, because it's easier to see the change).
Additionally, opening an "old" project should cause a full asset re-import, that should happen only once.
It's worth noting that there's a different proposed fix open for review.
https://github.com/godotengine/godot/pull/84974