nklbdev / godot-4-importality

Universal raster graphics and animations importers pack
MIT License
337 stars 7 forks source link

Aseprite textures need reimport when cooperating developing #20

Closed Jamesika closed 10 months ago

Jamesika commented 10 months ago

I use the raw .aseprite format file as Texture source, and git for cooperating. After we push and fetch some modified or new files, the textures became messed up, we need to reimport them to make it work.

The ResourcePreview is wrong, either. For example, the power buff Icon texture became to the tileset texture. (the icon size is 16X16 rather than 192X192). Reimport can't resolve preview error, but I can change a pixel in Aseprite to make the resource preview refresh to correct preview. image

nklbdev commented 10 months ago

Hello!

Please send me an example of corrupted files. Or better yet, a minimal project that has this problem. These can be any images - not necessarily your secret ones.

Jamesika commented 10 months ago

Hello!

Please send me an example of corrupted files. Or better yet, a minimal project that has this problem. These can be any images - not necessarily your secret ones.

  1. I create a miniest project to show up the bug, there are two .aseprite format files, image

  2. Then I delete the .godot folder (which will be ignored by Git)

  3. Reopen the project, the square became to circle. Reimport will fix it. image

  4. But the Preview of the square resource is still wrong. image

Project: ReportBugProject.zip

nklbdev commented 10 months ago

Thank you very much for sending in a project that reproduces your problem! Looks like I've managed to figure out what's going on.

It looks very likely that these are race effects when several import processes are running simultaneously. I recently taught Importality to create a unique directory for each import process in the temporary files directory. This protects imports from influencing each other. I submitted version 0.3.0 to the Godot Asset Library for moderation.

Try to take this version directly from here, from the repository. But be careful: it moved the Importality settings from the ProjectSettings to the EditorSettings! By the way, this may make the continous integration process easier for you. And you won't have to publish your local Importality settings along with your project file to the Git repository.

I don't have a direct way to fix your thumbnails, but you can invalidate them. For this:

And I hope that you put the temporary files directory in the project directory just for me. I highly recommend not doing this. In the most ideal case, I recommend using a separate RAM-drive for short-lived temporary files, as this will protect your SSD from premature aging.

I really want to help you. Please tell me if it worked for you. ❤️

Jamesika commented 10 months ago

Thank you very much for sending in a project that reproduces your problem! Looks like I've managed to figure out what's going on.

It looks very likely that these are race effects when several import processes are running simultaneously. I recently taught Importality to create a unique directory for each import process in the temporary files directory. This protects imports from influencing each other. I submitted version 0.3.0 to the Godot Asset Library for moderation.

Try to take this version directly from here, from the repository. But be careful: it moved the Importality settings from the ProjectSettings to the EditorSettings! By the way, this may make the continous integration process easier for you. And you won't have to publish your local Importality settings along with your project file to the Git repository.

I don't have a direct way to fix your thumbnails, but you can invalidate them. For this:

  • Make changes to the problematic graphic file, and leave the graphic editor open.
  • Let the re-import happen. This should fix the thumbnail immediately.
  • Undo the change in the graphic editor, which will return you to the original version of the file.
  • Let the re-import happen.

And I hope that you put the temporary files directory in the project directory just for me. I highly recommend not doing this. In the most ideal case, I recommend using a separate RAM-drive for short-lived temporary files, as this will protect your SSD from premature aging.

I really want to help you. Please tell me if it worked for you. ❤️

Thank you very much, the 0.3.0 version works well!