nklbdev / godot-4-importality

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

Error when importing Pixelorama PXO #3

Closed HVukman closed 1 year ago

HVukman commented 1 year ago

I try to import a PXO file and get this error:

modules/webp/webp_common.cpp:122 - Condition "size <= 0" is true. Returning: Ref() scene/resources/texture.cpp:695 - Condition "img.is_null() || img->is_empty()" is true. Returning: Ref() Failed loading resource: res://.godot/imported/folder.pxo-8983d86a9db3ffb31598b684b249353e.ctex. Make sure resources have been imported by opening the project in the editor at least once. Failed loading resource: res://folder.pxo. Make sure resources have been imported by opening the project in the editor at least once.

folderpxo.zip This is Godot 4.1 stable, both Windows on Mono and Standalone

nklbdev commented 1 year ago

Thanks for highlighting this issue!

This was due to the fact that compression was not enabled in your file when you saved it.

Pixelorama is written in Godot 3, and there is an open_compressed method in the File class that can return an error if the operation fails.

In Godot 4, this method was made static, and now it returns not an error, but an instance of the FileAccess class. As a result, instead of a FileAccess instance, this method returned null, which caused a further exception.

Now I will rewrite the logic for opening the file.

nklbdev commented 1 year ago

I fixed the opening of the file. Please check with yourself if your drawing can be imported.

HVukman commented 1 year ago

Yes, works now :)