Zylann / godot_heightmap_plugin

HeightMap terrain for Godot implemented in GDScript
Other
1.74k stars 159 forks source link

Cannot load single-channel, 32-bit float EXR file #464

Closed MJacred closed 2 months ago

MJacred commented 2 months ago

Describe the bug Cannot load single-channel, 32-bit float EXR file created in Blender (version 3.3). Godot seems to be the problem. Gimp can read it.
IIRC, I could load it last year in June, but I don't recall the combination of Godot version and addon version…

To Reproduce

Steps to reproduce the behavior:

  1. Created exr file using my blender-addon: https://github.com/cubiest/bmesh-map
  2. Import exr file in addon
  3. see error
New Scene Root
Create Node
Set data_directory
Import maps
  core/io/image_loader.cpp:101 - Error loading image: /home/user_name/Desktop/heightmap_32.exr
  core/variant/variant_utility.cpp:1091 - importer_dialog.gd: An error occurred loading image '/home/user_name/Desktop/heightmap_32.exr', code 16
  core/variant/variant_utility.cpp:1091 - importer_dialog.gd: Cannot open heightmap file: [16]: File Corrupt error

files: blend file + exr file + raw file heightmap_and_blend-file.zip

I included the raw file for reference (which can be imported). And the blend file, if you want to try it yourself.
Gimp has no issues with reading the EXR file (even though it clamps floats beyond 1): image

Godot itself seems to have an issue loading the exr file… I know that Godot has some issues with properly understanding an 32-bit exr file (https://github.com/godotengine/godot/issues/67818), but it should at least be able to read it...
It fails here: https://github.com/Zylann/godot_heightmap_plugin/blob/8c1b660033b41f333ebd3ea8eadfca6750cabecc/addons/zylann.hterrain/tools/importer/importer_dialog.gd#L297

Expected behavior

Environment

Zylann commented 2 months ago

Godot seems to be the problem

Then you should report this to Godot maybe? The plugin can't fix that.

MJacred commented 2 months ago

Can do. Wanted to run it by you in case I missed sth. silly

MJacred commented 2 months ago

OK, it seems like it was a Blender issue… It works with Blender 4.2