godotengine / godot

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

Armature Import Issue, Wont work with Blend files or GLTF #69174

Closed fase45 closed 1 year ago

fase45 commented 1 year ago

Godot version

4.0 beta1

System information

Windows 10 Pro, GLES3 Intel HD Graphics, Blender 3.3

Issue description

Every time I Import from Blender to Godot no matter what format GLTF/.Blend/FBX the Skeleton3D is messed up. I tried importing animation without armature from Blender and it works fine. When I add armature I have a track for animation in Godot and all the nodes are there, but I can't play the Animation and the Skeleton is incorrect scale or I can't even see it for some reason.

I don't know if there's settings I need to change or if it's my system, but all file formats are producing the same result and I can't even get any rigged/animated models working because of it.

Steps to reproduce

  1. Create a Blender3D Rig and Animation then export GLTF or just save to .blend file in the Godot project folder.
  2. Open Godot and import Blender3D Rig and Animation.
  3. Try to play it.

Minimal reproduction project

Import Test.zip

fire commented 1 year ago

Pain points.

  1. your blend file has a skeleton at the root. Godot has some trouble with this.
  2. your skeleton has three roots
  3. make the two roots be parented with the first bone
  4. then, make sure the godot engine imports influences set to be 4 influences

image

Import Test.zip Here's an example.

fire commented 1 year ago

Here is a video of the project I uploaded.

https://user-images.githubusercontent.com/32321/204073281-b6ab54c9-3f11-419d-9376-f3f714897278.mp4

fase45 commented 1 year ago

Thanks for your help @fire . Unfortunately, I tried with another very simple Model and still get the same thing. I used a simple cube and used Armeture. Mad an Empty the scene root, but still no animation and the bones are overlapping each other.

fase45 commented 1 year ago

Capture Capture2

fase45 commented 1 year ago

@fire It seemed to have worked on your system can you try to post your project again( I think you have to change your zip file name) and I'll try to open it in my system. I don't know if it's OpenGL or something else. But I made one root bone and then also set to 4 influences, changed the scene root to something besides a skeleton.

fire commented 1 year ago

Import Test Renamed.zip

Try this one

barrrettt commented 1 year ago

I think my case is related. 4.0beta6 blender 3.3.1 blender image godot image

surprisingly everything works well, animations, deformations and positions...

but the skeleton and the meshes are rotated 90º

Zireael07 commented 1 year ago

@barrrettt What is your up and forward axis set to in Blender?

barrrettt commented 1 year ago

blender image godot image import settings image

barrrettt commented 1 year ago

everything works fine. look the bone attackment: image

it may be an error when the gizmos cube is render: image

barrrettt commented 1 year ago

Thinking maybe this is not the right place for my issue. if you need more information, please ask. i can't think of anything else that would be helpful. Maybe just skeletons and meshes have different functions for the change of base?

Zireael07 commented 1 year ago

@barrrettt Yes, likely open a new issue, though it's almost certainly user error on your end (as evidenced by the screenshots, Blender uses Z as up and Godot uses Y as up, thus explaining the 90 deg rotation).

You should have an axis setting when exporting in Blender, try fixing it to conform to the Godot convention

barrrettt commented 1 year ago

I'm not sure if it's me or a conversion bug. I say this because I have the blender defaults (I don't think I remember to change any axis change option). Mainly I think it's a bug for several reasons:

  1. mesh and skeleton with different transformation?!
  2. i don't export to glTF2 i use the blender file in the godot project directly.
  3. i have tried different options in godot in the advanced importer (i haven't seen or managed to change this).

It's really not a serious problem. i can continue working the same (boneAttachment test). but seeing the gizmot rotated makes me scared. xd

Can we open a new issue to see if someone else has this problem or is it just me? This afternoon I will try clean blender file to see if I can reproduce. If someone else can confirm that it's not an issue it would be nice. *sorry my bad english.

Zireael07 commented 1 year ago

I say this because I have the blender defaults

This is literally the core of your problem. Blender defaults differ from Godot convention

barrrettt commented 1 year ago

In that case I would suggest to put some kind of warning or option in the blender file importer. Now that I think about it, that wouldn't explain why the mesh and skeleton are imported at different angles, would it, and why the boneattackment is well placed, even though the skeleton is not.

barrrettt commented 1 year ago

I cannot reproduce this behavior. it must be a local problem. good my armature is rotated 90 degrees. everything works fine because the animations reposition the skeleton correctly. exes hell 🤯

fase45 commented 1 year ago

@fire Send me a video of you fixing the problem because as it stands for me i can see the skeleton but it still wont animate or pose. I used all the settings you mentioned and something is still wrong. The FPSARMS.tscn you sent says it has corrupted and won't work. Is anyone else running into this issue. I don't get why it's so hard for me to implement one of the key aspects of game animation. Please someone fix this. I can't even use Godot 4 at this point(just been playing with the animation settings since downloaded it). I've been in 3.5 because I am stuck. I don't know if it's OpenGL or what.

GODOT 4 ISSUE

fire commented 1 year ago

https://drive.google.com/file/d/1ScgU8Zbs4I1hjoNBeEuUEDhVqS3CiCwc/view?usp=sharing

https://drive.google.com/file/d/1cvBcT-hkn0Xhk4SrK3-kbmvJOUXJTUNz/view?usp=sharing

Please download if the resolution is low.

Tested with Blender 3.4 and Godot Beta 7

I can't reproduce your bug.

fase45 commented 1 year ago

Thank you Hopefully someone can tell me whats going on

fase45 commented 1 year ago

For anyone wondering here's a simple animation and armature same problem optimize is even off

https://user-images.githubusercontent.com/14103171/206635703-9aa9ffd8-98a7-4196-b3b0-8a4828a43f99.mp4

fase45 commented 1 year ago

I just got Godot 4 beta 8 and it works!!! Thank you Everyone

Calinou commented 1 year ago

Closing per the above comment. (In the future, please close resolved issues by clicking the Close button next to the comment button.)