Godot: md5 of imported source is in a wrong place

Created on 20 Dec 2017  Â·  15Comments  Â·  Source: godotengine/godot

Godot version:
Godot 3.0 b08735f20987a6188fd54c5e2dcd072dc316b413

OS/device including version:
any OS

Issue description:
Currently source_md5 is located within the .import file near the source file. So when you change the source, reimport and commit the files, it doesn't get reimported for other people who pull the changes. Shouldn't it be located within the .import folder, associated with the imported file?

bug editor

Most helpful comment

BTW, while you could commit the .import folder, I don't think you should. Git isn't helpful for binary files, so adding copies of it in the same repository is just a waste of space. It's more practical to let each contributor reimport stuff they need.

All 15 comments

Yeah, I think the MD5 shouldn't be commited, then it doesn't belong to the *.import files.

Ah, I see. Technically you can commit the .import folder now and it should
work fine. That said, probably should add the MD5 of the imported files to
the check..

On Wed, Dec 20, 2017 at 11:56 AM, George Marques notifications@github.com
wrote:

Yeah, I think the MD5 shouldn't be commited, then it doesn't belong to the
*.import files.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/14858#issuecomment-353084389,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z20LlbE3d-v3ndfQVwSmEzUwE1bo_ks5tCSAPgaJpZM4RH-Fz
.

I agree, the md5 should be somewhere in the .import folder, not the *.import file :)

BTW, while you could commit the .import folder, I don't think you should. Git isn't helpful for binary files, so adding copies of it in the same repository is just a waste of space. It's more practical to let each contributor reimport stuff they need.

It could probably just be another path added to the [remap] block?

For instance, I have an image with an import file with:

path.s3tc="res://.import/grid_default.png-d70f242c379990a079b4f22ba9d11a2e.s3tc.stex"
path.etc2="res://.import/grid_default.png-d70f242c379990a079b4f22ba9d11a2e.etc2.stex"

Just add another:

path.md5="res://.import/grid_default.png-d70f242c379990a079b4f22ba9d11a2e.md5"

or

path.hash="res://.import/grid_default.png-d70f242c379990a079b4f22ba9d11a2e.hash"

It would work the same as the current md5 in the [deps] block, but it wouldn't be committed to version control. Therefore, anyone who's computer needs to update the file will.

@NathanWarden It's simply easier to keep an md5 of the exported file. The editor filesystem keeps a cache of all modification dates anyway, so this check will only be performed if the date of the source file changes.

sorry, i meant of the imported file

The problem right now is that Godot _is_ detecting that source file changes and goes and checks MD5 as it should, but it does not check the MD5 of the imported files, which it should.

I committed the .import folder too, and now everytime I open the editor it wants to reimport some of the files (namely the .obj resources). The only thing that changes is the md5 in the .import file, though.

@reduz I see what you're saying. That would certainly fix the problem :)

@reduz if you check stored md5 against imported file, the check will always yield that it is up to date (since *.import file would keep md5 of the last imported file), even if the source actually changed. So checking against imported file seems useless, unless I'm missing something.

@endragor Current check is against the source file, what I want to do is check against source AND imported file.

We should not forget to fix this for 3.0 RC1.

This is already fixed by 988d29bdd8f1d6fc74280cceb76a8b4edb54138d, although the implementation caused #15316 to be a problem. But closing this one anyway.

Are you sure it's fixed? Maybe I misunderstood what this issue was about, but I still get such diffs in the demos:

diff --git a/3d/kinematic_character/white_wood.png.import b/3d/kinematic_character/white_wood.png.import
index e893dd2..8103b42 100644
--- a/3d/kinematic_character/white_wood.png.import
+++ b/3d/kinematic_character/white_wood.png.import
@@ -5,6 +5,14 @@ type="StreamTexture"
 path.s3tc="res://.import/white_wood.png-6895acd60ce97b4315494d2be377c357.s3tc.stex"
 path.etc2="res://.import/white_wood.png-6895acd60ce97b4315494d2be377c357.etc2.stex"

+[deps]
+
+source_file="res://white_wood.png"
+source_md5="4565f03f9b3e5ea8bbd492559e733a35"
+
+dest_files=[ "res://.import/white_wood.png-6895acd60ce97b4315494d2be377c357.s3tc.stex", "res://.import/white_wood.png-6895acd60ce97b4315494d2be377c357.etc2.stex" ]
+dest_md5="6e02a3d6e2e6c5c82a8a85db38bbb708"
+
 [params]

 compress/mode=2
Was this page helpful?
0 / 5 - 0 ratings