Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Fix "Changing .import file externally doesn't trigger asset reimport" #85067

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

turbohz
Copy link

@turbohz turbohz commented Nov 18, 2023

This is an attempt to fix #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).

@turbohz
Copy link
Author

turbohz commented Nov 18, 2023

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

@turbohz turbohz marked this pull request as ready for review November 18, 2023 19:29
@AThousandShips AThousandShips added this to the 3.x milestone Nov 18, 2023
@AThousandShips AThousandShips requested a review from a team November 18, 2023 19:58
@fire
Copy link
Member

fire commented Nov 19, 2023

To be clear is this sufficient to test?

Steps to reproduce

  1. Open icon.png.import
  2. Change e.g. repeat to true
  3. Switch to editor
  4. No reimport
  5. Your texture doesn't repeat
  6. Your texture doesn't repeat in exported project

@turbohz
Copy link
Author

turbohz commented Nov 20, 2023

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.

@turbohz
Copy link
Author

turbohz commented Nov 20, 2023

It's worth noting that there's a different proposed fix open for review.

#84974

@akien-mga akien-mga changed the title Fix "Changing .import file externally doesn't trigger asset reimport" [3.x] Fix "Changing .import file externally doesn't trigger asset reimport" Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants