godotengine / godot

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

Collada scene from SketchUp can not be imported properly #51148

Open Frontrider opened 3 years ago

Frontrider commented 3 years ago

Godot version

3.3.2.stable

System information

windows10/manjaro, GLS3

Issue description

When importing dae from Sketchup, the import gets several different errors. Importing the same dae file into blender then exporting it as dae always fixes it, but is not a working solution. Sketchup does not have GLTF support so this is the only format that can work.

Link to sketchup: https://www.sketchup.com

Steps to reproduce

This dae file produces this error: https://cdn.discordapp.com/attachments/275788728168087556/871370866452226058/terrain.dae https://cdn.discordapp.com/attachments/275788728168087556/871370304478392330/2021-08-01_14-34-20.png

editor/collada/collada.cpp:1060 - Primitive type "polygons" is not well supported (concave shapes may fail). To ensure that the geometry is properly imported, please re-export using "triangles" or "polylist".

This was fixable by changing that "polylist" setting to "triangles".

With tringles enabled, we get this: https://cdn.discordapp.com/attachments/275788728168087556/871376248692154408/terrain.dae image with this error:

 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.
 editor/collada/collada.cpp:1691 - Multiple instance_* not supported.

Minimal reproduction project

Drop the linked dae files into a blank godot project and import.

akien-mga commented 3 years ago

For the reference, there seems to be a glTF export addon for SketchUp, that might be worth trying: https://extensions.sketchup.com/extension/052071e5-6c19-4f02-a7e8-fcfcc28a2fd8/gltf-exporter

But fixing the DAE support is still worth looking into of course.

Frontrider commented 3 years ago

We checked that addon, and that is not an option.

KenneyNL commented 2 years ago

Since this is the only option to natively export models from SketchUp (the plug-in isn't great) I'd love to see this fixed, just ran into this issue myself. OBJ is too limiting.

akien-mga commented 2 years ago

Does COLLADA2GLTF help convert those scenes to something Godot supports best?

KenneyNL commented 2 years ago

I'd really not like to change my pipeline when importing models honestly. Unity supported SKP (SketchUp's native file format) so having to use a different file format is already a hassle, converting that (even when automated) just adds yet another step.

akien-mga commented 2 years ago

Well the point is that if it works, this can be automated in a way where you wouldn't even know that a conversion takes place.

Like Unity does when it "imports" .blend files by actually calling Blender on the command line to export to fbx.

Would also be worth testing https://extensions.sketchup.com/extension/052071e5-6c19-4f02-a7e8-fcfcc28a2fd8/gltf-exporter or any other glTF export plugin available. I know you don't want to change your workflow but it would still be useful to know what works and what doesn't. glTF 2.0 is the most comprehensive and best supported format in Godot, so anything that can go through this well tested import pipeline will be much more feature complete.

KenneyNL commented 2 years ago

@akien-mga Ah sorry, I misunderstood before and thought you meant I had to use that converter - not that it'd be integrated. I'm all for that, obviously!

I will be testing the glTF exporter plug-in and report back.

akien-mga commented 2 years ago

BTW if you have example DAE exports that you can share for testing, it could be useful to validate that #63072 actually solves your problems.

I tested with @Frontrider's https://cdn.discordapp.com/attachments/275788728168087556/871370866452226058/terrain.dae and it does solve the errors. The actual imported scene looks kind of the same to me, I'm not sure if the bug was just the error spam and that the scene actually is broken.

image

akien-mga commented 2 years ago

BTW if you have example DAE exports that you can share for testing, it could be useful to validate that #63072 actually solves your problems.

My findings so far are that COLLADA2GLTF doesn't do such a good job, at least on a few random DAE files I found in bug reports here.

So it would still be interesting to explore other avenues to improve the SketchUp workflow, given that our COLLADA exporter is difficult to maintain and overall COLLADA I/O in 3D software is notoriously problematic:

taustin73 commented 2 years ago

I'm the Engineering Director for the SketchUp team and I will bring this up as an issue on the Collada exporter. We are actively working on a glTF exporter as well so stay tuned. (FYI: I came across this issue on Kenney's twitter feed.)

aaronfranke commented 2 months ago

@taustin73 What is the status of this? Does SketchUp have glTF support? I could not find a blog post about this from a Google search. The website seems to mention only exporting SKP, PNG, STL, not Collada or glTF.