Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Blender -> GLTF2 -> Godot pipeline #15802

Closed
brainsick opened this issue Jan 17, 2018 · 20 comments
Closed

Broken Blender -> GLTF2 -> Godot pipeline #15802

brainsick opened this issue Jan 17, 2018 · 20 comments

Comments

@brainsick
Copy link
Contributor

Godot version:
Godot 3.0 RC1

OS/device including version:
Ubuntu 17.10 x64, AMD Radeon R9 Fury

Issue description:
I'm trying to import phoenix bird into Godot.

I first import the FBX file into Blender. I fix up the textures and edit the animation to end on the last keyframe. I play the animation to test it; Blender success! .blend file included (you may need to add a lamp back in).

screenshot from 2018-01-17 00-25-50

I delete the default lamp and camera and export it via the Khronos GLTF 2 Exporter.

- Embed buffers
- Embed images
- Strip delimiters
- Export selected only
+ Export all layers
- Export extras
+ Convert Z to Y up
- Apply modifiers
- Force maximum indices
+ Export texture coordinates
+ Export normals
+ Export tangents
+ Export colors
+ Export materials
- Export cameras
+ Export animations
+ Export within playback range
+ Keyframes start with 0
- Force sample animations
+ Export skinning
- Bake skinning constraints
+ Export morphing
+ Export morphing normals
+ Export morphing tangents
- Experimental (none)

Godot imports the GLTF 2 file. I double click the fly.gltf file and Open Anyway the scene for a preview.

screenshot from 2018-01-17 00-46-03

The scale appears to be way off. I had this same issue with the GLTF files generated by SketchFab.

Selecting the AnimationPlayer and pressing "Play selected animation from start. (Shift+D)" causes what is visible to inexplicably rotate.

No mesh is rendered. Nothing I do with the materials makes any difference until I play the animation and then I end up with this:

screenshot from 2018-01-17 01-01-57

Steps to reproduce:

Minimal reproduction project:

PhoenixAltGLTFImport.zip

@akien-mga akien-mga added this to the 3.1 milestone Jan 17, 2018
@fire
Copy link
Member

fire commented Jan 17, 2018

Issue is very similiar to my issue. #15181

@capnm
Copy link
Contributor

capnm commented Jan 17, 2018

Yep, the gltf2 importer is currently in a sorry state:
#14725
#14636
#15715
#15798

peek 2018-01-17 12-28

@reduz
Copy link
Member

reduz commented Jan 17, 2018

Importing geometry generally works fine, skeletal animation is broken at the moment.
regarding scale, both Godot and GLTF use the same coordinate system and unit scale, so if scale does not look right it's a problem of the model.

@capnm
Copy link
Contributor

capnm commented Jan 17, 2018

I didn't figured why, but sometimes some spatial nodes get a completely wrong transformation …
If you correct this manually in the editor (the last man), even the animation will be correct.

@reduz
Copy link
Member

reduz commented Jan 17, 2018

didn't figured why, but sometimes some spatial nodes get a completely wrong transformation …

I have seen this in a few scenes I got from sketchfab but, as I mentioned, I'm not sure why it might happen as Godot does no unit or axis conversion at all, given it uses the same exact as gltf

@brainsick
Copy link
Contributor Author

There is similarity with #15181 in that it mentions scale. The other issues appear to be different situations though.

I thought GLTF was the "approved" 3d asset pipeline, so I was surprised to find these issues and thought I should report them.

@capnm
Copy link
Contributor

capnm commented Jan 17, 2018

blender -> gltf -> godot / gltf-viewer

bildschirmfoto vom 2018-01-17 14-00-37

bildschirmfoto vom 2018-01-17 14-12-15

bildschirmfoto vom 2018-01-17 14-12-57

bildschirmfoto vom 2018-01-17 14-23-40

blender-exp2.zip

@reduz
Copy link
Member

reduz commented Jan 17, 2018 via email

@reduz
Copy link
Member

reduz commented Jan 17, 2018 via email

@brainsick
Copy link
Contributor Author

Okay, I have issues noted for the Better Collada exporter too. I haven't submitted them because I wasn't sure if it was still supported.

@brainsick
Copy link
Contributor Author

brainsick commented Jan 17, 2018

I can do simpler. This is so simple that I no longer recognize it as the original reported issue though.

https://youtu.be/Sh7nih_8a1g
BlenderGLTFGodotCube.zip

If it matters, I built a spin cube from the ground up and it worked as expected. I discarded that and tore the spin cube down from my crush cube example; meaning that I deleted the Armature/poses/bones (all data blocks that I could find) and then added the spin animation. Then an unexpected scaling issue manifests. Blender and glTF Viewer seem fine though. blend file included.

The actual size of the cube is fine, I'm not surprised that it's bigger than the others. I'm surprised that the scale is being animated. Hovering over the keyframes in Godot confirms that scale is being animated for some reason.

As a convenience, I keyframe'd LocRotScale in Blender. But scale was never initialized and doesn't change so I'm expecting a noop or at least an unchanging value.

screenshot from 2018-01-17 14-34-45

Indeed, when I change to keyframe just Rotation in Blender, Godot behaves as expected.

screenshot from 2018-01-17 15-09-08

@brainsick
Copy link
Contributor Author

brainsick commented Jan 18, 2018

Another animation quirk in Godot. This time using 03 all animations. The parent sphere does not move fluidly and the tetrahedron has scale issues in its animation.

image

Just an amusing observation, but Blender rotates counter to Godot and glTF Viewer. This could be an export bug or I did something goofy in the export settings.

https://youtu.be/quzdp0nYlDI

@capnm
Copy link
Contributor

capnm commented Jan 19, 2018

Just an amusing observation, but Blender rotates counter to Godot and glTF Viewer. This could be an export bug or I did something goofy in the export settings.

That's an inherent problem of the Euler rotation from 0° to 0°. If you change the endpoint to 360°, it works as expected.

@brainsick
Copy link
Contributor Author

That's an inherent problem of the Euler rotation from 0° to 0°. If you change the second endpoint to 360°, it works as expected.

I naively used 0° to 360° in my own attempt which didn't manifest this behavior. So, today I learned! Thanks. 👍

@brainsick
Copy link
Contributor Author

brainsick commented Jan 21, 2018

Another animation quirk in Godot. Using 01 morphed cube. The cube does not animate at all in Godot. This one uses something called shape keys.

Note that this does not animate in glTF Viewer either. So, this might this be an issue with the exporter.

@fire
Copy link
Member

fire commented Jan 26, 2018

https://github.com/googlevr/poly-toolkit-unreal/blob/master/PolyToolkit/Source/PolyToolkit/Private/Gltf2Importer.cpp Has an Apache 2 licensed gltf2 importer. Perhaps it is good to check if Google did things differently.

@fire
Copy link
Member

fire commented Feb 19, 2018

Ping! anyone still working on this?

@RandomShaper
Copy link
Member

I'm investigating skeleton issues. At this point I have a solid clue to follow.

@fire
Copy link
Member

fire commented Aug 7, 2018

Fixes from 5b70ad9

First scene is the same as #15798

godot windows opt tools 64_2018-08-06_23-18-15

Second scene is Cesium man.

godot windows opt tools 64_2018-08-06_23-27-58

#15802 (comment)

01_morphed_cube is still not supported.

@akien-mga
Copy link
Member

Closing as fixed by 5b70ad9, if there are some cases which still don't work, please open specific issues for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants