godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.53k stars 21.08k forks source link

Failure to import .blend on some Blender Versions #67275

Closed CutestNekoAqua closed 1 year ago

CutestNekoAqua commented 2 years ago

Godot version

4.0.dev (0c23a2cfe)

System information

Linux, but reproducible on windows too

Issue description

On some blender versions, godot fails to import the blend files. It shows them as X's and refuses to import new files of other file types too. It tries to import the .blend files constantly when you refocus the window Example errors:

modules/gltf/gltf_document.cpp:6899 - Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN
  editor/editor_file_system.cpp:1914 - Error importing 'res://src/world/entities/player/Kart.blend'.
ERROR: Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN
   at: append_from_file (modules/gltf/gltf_document.cpp:7030)

Discord sources of the issues: https://discord.com/channels/212250894228652034/908062856459743262/1029482280235831357 https://discord.com/channels/212250894228652034/908062856459743262/1020554639009140736 https://discord.com/channels/212250894228652034/908062856459743262/1020410725753163867

Steps to reproduce

Use one of the blender version confirmed to fail (3.0.1 and 3.3.0 as example) and try to import a blend file.

Minimal reproduction project

No response

CutestNekoAqua commented 2 years ago

PS: if you want a version to test which works, Blender 3.3.1 LTS is able to import it into godot. PPS: The blender versions who are failing to import into godot, can load the blend file(s) and render it perfectly.

I used the CC0 Classroom Blend file for testing.

fire commented 2 years ago

Do you think this is a documentation bug or something we can fix?

CutestNekoAqua commented 2 years ago

Do you think this is a documentation bug or something we can fix?

The issue with these versions needs to be tracked down, then it can be deemed if fixable XOR if a error informing the user can be added, I think

meko3 commented 2 years ago

Sorry if it's not the same issue.

My Blender Version is 3.3.1. Godot Version v4.0.beta.custom_build [d5ae80c8b] OS is macOS Monterey (Apple M1)

And I use Blender addon Cats Blender Plugin.

When I saved Rigged Object as .blend -> This can be imported in Godot.

When I saved No Rig Object as .blend -> This failed to be imported in Godot. But, when I uninstalled Blender addons(cats), No rigged Object can be imported in Godot. (Auto Rig is No Problem.)

So, Can you change No Rigged and Rigged object export type from Godot?

CutestNekoAqua commented 2 years ago

Sorry if it's not the same issue.

My Blender Version is 3.3.1. Godot Version v4.0.beta.custom_build [d5ae80c] OS is macOS Monterey (Apple M1)

And I use Blender addon Cats Blender Plugin.

When I saved Rigged Object as .blend -> This can be imported in Godot.

When I saved No Rig Object as .blend -> This failed to be imported in Godot. But, when I uninstalled Blender addons(cats), No rigged Object can be imported in Godot. (Auto Rig is No Problem.)

So, Can you change No Rigged and Rigged object export type from Godot?

yours is a different issue, because its not dependant on the blender version. also see

PS: if you want a version to test which works, Blender 3.3.1 LTS is able to import it into godot.

meko3 commented 2 years ago

As a supplement, Rigged Object also failed to import in Blender 3.1 with add-ons It can be imported in Blender 3.3.1.

barrrettt commented 1 year ago

Same on beta 9. win11. blender 3.3.1 My last version work fine but now: image I have tried several times to delete the .godot folder and the .import file but it doesn't work. I have also restarted the editor several times, nothing. 2 errors:

modules/gltf/gltf_document.cpp:7078 - Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN

editor/editor_file_system.cpp:1939 - Error importing 'res://exclude/blender/character_base.blend'.

islandfortress commented 1 year ago

Generating a default scene with a light, cube, and camera, I get the same two errors with Beta 9 and Blender 3.4.0 or 3.3.1. Generating the scene with Blender 3.2.0 works fine. I also tested taking a file from 3.4.0 and resaving it in 3.2.0 and this fixes the file. Conclusion, blender file format changed somehow between 3.2 and 3.3 and Godot can't parse it. I hope this helps!

mournguard commented 1 year ago

On my end changing blender versions didn't help, but trying to import with 4.0alpha17 did. Might be more complex than you guys thought or maybe there's multiple issues.

valkyrienyanko commented 1 year ago

I tested this on v4.0.beta17.mono.official [c40020513] with Blender ver. 3.3.1 with a Y-Bot humanoid rig from Mixamo site. I got the exact same issue as OP describes.

fire commented 1 year ago

@lyuma told me some gltf imports were improved with blender 3.4 but I was surprised. Looking for models to test.

Game-Smith commented 1 year ago

I've run into the same issue with the released version of Godot 4.0 and Blender 3.4.1.

Error Screenshot

It tries to rerun the import every time focus changes in the Editor, even getting the Windows Snip Tool up caused it to run again. I have attached a copy of the model that it is failing to load on my project. Maybe it will help debug the issue.

Model That Won't Import.zip

snoopdouglas commented 1 year ago

On Fedora 37, this is also an issue with Blender 3.5.0.

3.3.1 works fine.

So, to get this fixed, I did:

sudo dnf downgrade blender
sudo dnf install 'dnf-command(versionlock)'
sudo dnf versionlock add 'blender-1:3.3.1-1.fc37.*'
fire commented 1 year ago

which fedora? I can try to put this on my bucket list

lyuma commented 1 year ago

@snoopdouglas can you please test Blender 3.4 ? I'm curious why an especially old version like 3.3.1 was used. I have tested Blender 3.4 with Godot extensively and had no issues. It also solves some gltf export bugs that may have been present with 3.3

Blender 3.5 is admittedly quite new and I can't say we've tested it as much. I'd really appreciate more details about what went wrong. If you can confirm that the issue is not present on 3.4, I'd actually like if you can file a new issue about Blender 3.5 specifically. Please also include a simple Godot reproduction project with a .blend file.

If you don't want to share your blender art in public, you could make a duplicate of the blend file and go to edit mode and delete all but one triangle or something and see if it still happens, and then you'll have a minimal testcase.

snoopdouglas commented 1 year ago

@lyuma Sure thing. I'm guessing there's no way of easily switching on tracing for the Blender importer so I can take a look at what might be going on with 3.5? If not (and idk whether this is in scope for this issue) but it'd be useful to get Godot to dump failed Blender import logs to .godot/ somewhere perhaps.

I've confirmed this isn't an issue with 3.4.1, so have opened another issue.

MartinHaeusler commented 1 year ago

I'm also seeing this problem on Windows 10, Blender 3.5 and Godot 4.0.3 (mono).

Some *.blend files work fine out of the box, others just refuse to import at all.

The console window says this:

ERROR: Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN at: append_from_file (modules/gltf/gltf_document.cpp:7431) ERROR: Error importing 'res://grandLibrary_01.blend'. at: (editor/editor_file_system.cpp:2031) ERROR: Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN at: append_from_file (modules/gltf/gltf_document.cpp:7431) ERROR: Error importing 'res://grandLibrary_01.blend'. at: (editor/editor_file_system.cpp:2031) ERROR: Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN at: append_from_file (modules/gltf/gltf_document.cpp:7431) ERROR: Error importing 'res://grandLibrary_01.blend'. at: (editor/editor_file_system.cpp:2031) ERROR: Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN at: append_from_file (modules/gltf/gltf_document.cpp:7431) ERROR: Error importing 'res://grandLibrary_01.blend'. at: (editor/editor_file_system.cpp:2031) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: No loader found for resource: res://grandLibrary_01.blend. at: (core/io/resource_loader.cpp:230) ERROR: Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN at: append_from_file (modules/gltf/gltf_document.cpp:7431) ERROR: Error importing 'res://grandLibrary_01.blend'. at: (editor/editor_file_system.cpp:2031) Also, on a related note, the .blend files seem to get reimported into Godot every time I de-focus and re-focus the godot window. This is extremely annoying because it takes a few seconds every time (and I only have two .blend files in my project at the moment; I can imagine how it would feel with 100s of them...). Is this a known issue?

Also: in the Godot settings, the blender importer was enabled by default, but I had to manually disable it, re-enable it and restart godot in order to see any *.blend files at all being registered by the asset importer.

snoopdouglas commented 1 year ago

@MartinHaeusler if you're on Blender 3.5, see #76338

lyuma commented 1 year ago

Should we close this issue as duplicate of #76338 ?

It seems like a rather operating system-dependent and blender version-dependent problem. Plus, a lot of the comments here occurred during Godot 4.0 beta.

I'd certainly appreciate if each person hitting this problem opened a bug report after reproducing it on the latest version of Blender (currently 3.5.1), and specify which Operating system, and include a Godot reproduction project with a failing blend file.

The only blend file attached so far to this issue was the "Mermaid's Grotto" one, and that failed due to the single quote in the filename so probably some python script issue.

lyuma commented 1 year ago

I just filed a separate issue #78447 about the quote marks in the filename reported by @Game-Smith

If you are on Linux and using Blender 3.5, the issue #76338 is already opened about this, so feel free to respond there if this affects you.

Since there are no other MRP or other file attachments here, and the issue title is vague, I'm going to close this issue for now.

If another .blend-related problem affects you, please file an issue with a reproduction project and specific blender and OS version information, or reply here with a zip file or more info and we can consider reopening it.

xcarulla commented 3 months ago

Happens the exact same to me, console log:

modules/gltf/gltf_document.cpp:7673 - Condition "err != OK" is true. Returning: ERR_FILE_CANT_OPEN Error importing 'res://Resources/Blender/cube.blend'.

Godot version 4.2.2 Blender version 4.2.0 Windows 10

MartinHaeusler commented 2 months ago

I know, closed ticket and all, but here's my observation:

OS: Linux Mint 21.3 Cinnamon Godot: 4.2.2.stable

With Blender 4.2 LTS, some of my *.blend files did not import correctly. However, switching to Blender 3.6.14 helped and the files imported correctly.

It seems like the Godot editor has trouble communicating with Blender 4.2 specifically?

akien-mga commented 2 months ago

Please don't comment on closed bugs that predate the Blender version you're having an issue with.

Blender 4.2 broke compat, and we fixed support for it in Godot 4.3, but there hasn't been a 4.2.x release of Godot since then, so the fix isn't available in Godot 4.2 yet.