Closed lyuma closed 2 years ago
Can confirm this is still happening in v4.0.dev.official
. I attempted to import some of Kenney's 3D models, and got the same lock: https://kenney.nl/assets/retro-medieval-kit
As https://github.com/godotengine/godot/issues/51315 mentions, does it work if you create an empty .mtl
file to satisfy the .obj
file's requirements? Check the .obj
file contents for the MTL file reference.
Alternatively, you could edit the OBJ file to remove the MTL reference and create materials manually.
You shouldn't need to have an extra mtl file as a requirement when importing an obj. I have never seen that requirement in any application before. Personally, I mostly tend to export obj without mtl's and only export with an mtl if I need access to multiple poly selections in Godot to apply multiple materials. In this circumstance, I don't actually use the imported materials themselves for anything other than maybe a placeholder.
I probably should move over to using gltf for everything, but obj has just been so reliable for static objects for a long time, and every application exports them flawlessly.
You shouldn't need to have an extra mtl file as a requirement when importing an obj. I have never seen that requirement in any application before.
Godot has no such requirement. Still, many applications will export MTL files by default, even if you don't need those MTL materials. The MTL material specification is very limited by today's standards (no PBR), so it's only really usable for placeholders or oldschool games unless you adopt nonstandard modifications to the file format.
Reading https://github.com/godotengine/godot/issues/51315, the issue seems to be that Godot crashes when a nonexistent MTL file is referenced. Instead, it should print a warning and continue importing.
Yes, this is exactly what the issue is. Obj import now only works if you have the mtl, but not if there is no corresponding mtl file (which for my projects is most of the time). As mentioned I only export mtl to get access to poly selections in Godot for certain meshes.
I'm not sure the problem is limited to .mtl
files. I've implemented support for disabling material import for OBJ files, and I can still reproduce deadlocks.
Here's a full backtrace for all threads when the deadlock happens:
Godot version: 4.0.dev 1c2766e
OS/device including version: Windows 10.0.19041.928
Issue description: I had a deadlock occur while reimporting my project containing a few .obj files, as well as a plethora of random content.
The last output is:
Stacktraces from the two relevant threads are as follows:
and both of the stalled importer threads had the same stacktrace as follows:
In case it's relevant, I have stacktraces from all threads saved in the following gist: https://gist.github.com/lyuma/11dc95ac44db79c9af54aacd61ee7f37 Notably, I was unable to find a RenderingServer thread.
Steps to reproduce:
Minimal reproduction project: I have a 100MB zip file but it contains copyrighted files. I was able to reproduce the issue twice with this project.
I tried simplifying things, for example only including the .obj files. But I was not able to reproduce the issue on the simpler project. It does seem like a race condition.