godot_voxel icon indicating copy to clipboard operation
godot_voxel copied to clipboard

Godot crashes when importing .vox file

Open beicause opened this issue 1 year ago • 8 comments

Describe the bug When project contains .vox file, godot automatically imports it and crashes.

To Reproduce Open a project that contains .vox file.

Expected behavior It shouldn't crash

Screenshots The console log:

ERROR: Unimplemented _get_import_order in add-on.
   at: get_import_order (editor/import/editor_import_plugin.cpp:112)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.2.rc.custom_build (474589eb838623f4a59628c0316d0d27f83ed3d1)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7fb9e45a9520] (??:0)
[2] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0xfbf879] (??:0)
[3] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x15b529f] (??:0)
[4] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x15ba2bd] (??:0)
[5] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x15c3d9f] (??:0)
[6] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x15c51ff] (??:0)
[7] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x3f73268] (??:0)
[8] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x24eaeb4] (??:0)
[9] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x253d59b] (??:0)
[10] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x253de41] (??:0)
[11] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x482d69] (??:0)
[12] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x4200e8] (??:0)
[13] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7fb9e4590d90] (??:0)
[14] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7fb9e4590e40] (??:0)
[15] /home/luo/Dowload/godot.linuxbsd.editor.x86_64() [0x431dca] (??:0)
-- END OF BACKTRACE --
================================================================

Environment Godot v4.2.2.rc (474589eb8) - Linux Mint 21.3 (Virginia) - X11 - Vulkan (Mobile) - integrated AMD Unknown (RADV RENOIR) () - AMD Ryzen 7 4800U with Radeon Graphics (16 Threads)

beicause avatar Feb 17 '24 09:02 beicause

Eww given the error printed I wonder if that's actually a Godot bug, which nobody noticed because so few people make custom importers... That backtrace is useless unfortunately, it has no information about where the crash happened. Also it may be useful to provide the .vox file you used, because it could also be related to what this one specifically contains.

Zylann avatar Feb 17 '24 16:02 Zylann

https://github.com/Zylann/godot_voxel/blob/30b8d6307e3159d5118c7dc7db2fa4f2bd21e6f9/util/godot/classes/editor_import_plugin.h#L94 I guess the reason is get_import_order isn't implemented.

The error is from: https://github.com/godotengine/godot/blob/4ce5e261b31566f06b457f402488b6a26baa7fd1/editor/import/editor_import_plugin.cpp#L112

beicause avatar Feb 17 '24 18:02 beicause

I know, but if that error is actually what causes Godot to crash, then that's also a Godot bug. Godot must never crash if possible even if there is an error like this (someone could write a GDScript importer and crash the engine which is pretty bad). But having the .vox file would help to figure out if the crash really happens in Godot or in the importer.

Zylann avatar Feb 17 '24 21:02 Zylann

I just tried importing monu1.vox, a file provided by default in MagicaVoxel. The error printed, but it didn't crash, and the model shows up properly: image

So you will have to provide the vox file or project you used, because it probably contains something the importer didn't handle.

Zylann avatar Mar 03 '24 02:03 Zylann

Are you using a C++ voxel importer? because in the current state of godot, Vox files will crash the game 9/10 times. Don't ask why they just do. this isn't a problem with the godot voxel engine

MountainLabsYT avatar Jun 04 '24 21:06 MountainLabsYT

having the .vox file would help to figure out if the crash really happens in Godot or in the importer.

you will have to provide the vox file or project you used, because it probably contains something the importer didn't handle.

Please provide a minimal project and instructions to reproduce, because as I already said, I tried importing a vox file on my computer and it worked fine. This module is entirely in C++, but the import pipeline is from Godot. Until figured out, that crash could come from either side.

Zylann avatar Jun 04 '24 22:06 Zylann

The .vox file was exported with https://github.com/vengi-voxel/vengi. Maybe its .vox format isn't compatible with the importer of this module.

beicause avatar Jun 05 '24 07:06 beicause

Well either way, if someone has an issue importing some files, I need to be able to test them to see what's going on, and if any, I'd like to know what kind of special things happen with those files. It could be an unhandled format difference, could be the model is too big, could be Godot bug, could be module bug... it's still all speculation because nobody sent me a test case. I just opened the Vengi web version, added some cubes, exported to vox, dropped into Godot and it loaded fine. The module only implements what's described in this specification: https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt

Zylann avatar Jun 05 '24 17:06 Zylann