godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix group reimport bug

Open AThousandShips opened this issue 3 years ago • 10 comments
trafficstars

When testing files for reimport the presence of a UID causes the file to be reimported (treated as if the file were from a version prior to UIDs I assume), this however causes problem with group files, in this case TextureAtlas, as in this case no UID is written (or kept in fact) when reimporting, causing the files in a group to be reimported each time

Also at some times (when opening the editor I believe) the resulting file (the group file) can be reimported itself causing it to be reimported twice in such cases, added a check to make sure files that are group files, but not yet in the group file cache, aren't reimported twice.

Edit: Also added editor progress update for group files in reimport

Fixes #68256 Fixes #54817

AThousandShips avatar Nov 06 '22 11:11 AThousandShips

I'd guess it also fixes #54817 which is supposed to be fixed by #60888 which... is almost identical to this PR. :smile:

kleonc avatar Nov 06 '22 17:11 kleonc

Oh damn I missed that one!

AThousandShips avatar Nov 06 '22 17:11 AThousandShips

Think there are some factors the other PR doesn't cover so I'll leave this up for now unless you want me to close it

Thank you for finding

AThousandShips avatar Nov 06 '22 18:11 AThousandShips

Think there are some factors the other PR doesn't cover so I'll leave this up for now unless you want me to close it

Let @akien-mga decide what to do about this PR and #60888. Either way I think the changes need a review from @reduz.

kleonc avatar Nov 06 '22 22:11 kleonc

Hi @akien-mga can we please get some traction on this PR?

It unblocks the basic scenarios of atlas textures which are very important for any 2D game.

LakshayaG73 avatar Nov 19 '22 05:11 LakshayaG73

Also added a fix to ensure group files are updated properly after reimport, previously they would only be imported if the group file itself was reimported

AThousandShips avatar Nov 27 '22 15:11 AThousandShips

After your latest commit, I deleted the .godot folder, and that seemed to error out one specific atlas file. I reinitialized its constituents as a new atlas file and all seems to be fine.

LakshayaG73 avatar Nov 28 '22 05:11 LakshayaG73

Any reason you deleted the .godot folder? It would error stuff if it is not initialized again probably, as some of the parameters have changed if you are using both this and #68380, not sure what you are asking about or what the issue is.

AThousandShips avatar Nov 28 '22 08:11 AThousandShips

I always delete the .godot folder after a fresh build. Is that not good practice?

I am not using #68380 with this, for issues I have mentioned in the PR.

I just thought I should mention this, in case you have any insight into the reason for this. It only messed with one specific file, so it could be simply due to the deletion of the folder.

Otherwise, everything is working well.

LakshayaG73 avatar Nov 28 '22 09:11 LakshayaG73

Got it! Suspect it's just because of the deletion if it works well after

AThousandShips avatar Nov 28 '22 09:11 AThousandShips

Thanks!

akien-mga avatar Dec 05 '22 17:12 akien-mga

Thank you again :)

LakshayaG73 avatar Dec 05 '22 17:12 LakshayaG73

@akien-mga I guess #60888 can be closed then (see https://github.com/godotengine/godot/pull/68324#issuecomment-1304852353).

kleonc avatar Dec 05 '22 17:12 kleonc

Really great work

Thank you! Sorry forgot to reply before

AThousandShips avatar Jan 12 '23 22:01 AThousandShips