KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.48k stars 316 forks source link

Exported animation looks different than in Blender (Rigify Rig) #2141

Open CentiGames opened 7 months ago

CentiGames commented 7 months ago

First of all, excuse the mesh, it's supposed to be part of a horror game, and secondly, excuse my Blender skills, I am still somewhat in the learning process of 3D modelling and using Blender. I am especially still not 100% sure how the NLA animations work in Blender, though I watched some tutorials and I think/hope it should be fine? Anyways, thanks for taking the time to look through this issue :)

Describe the bug I modelled a 3D goat body using the Rigify Basic Quadruped rig. I made a walk animation for it, in Blender it looks nice, but when I export the mesh and use it in the Godot game engine it looks contorted. I am also not sure if it's a bug with Godot or with the .gltf exporter, but I checked with this Online GLTF Viewer and it still looks contorted.

To Reproduce I am not 100% sure what exactly is the cause of the issue or how to reproduce it in a minimalistic way. I attached a .blend file though. The basic steps I did were:

  1. Add Rigify Basic Quadruped rig and create actual rig from the meta rig.
  2. Model a goat body.
  3. Parent the goat body to the rig with automatic weights.
  4. Do basic weight painting.
  5. Add a walk animation along with some other animations (that make use of IK features)
  6. Export as .gltf file, check "Bake All Object Animations"
  7. Import the .gltf file somewhere and look at the walk animation

Expected behavior I expect the exported animation to look the same as it does in Blender.

Screenshots (Look at the weird bending of the front feet/heels) Blender .gltf in Godot GLTF Online Viewer
image image image

.blend file/ .gltf (mandatory) goat_animation_issue.zip (Texture credit: https://www.pexels.com/photo/brown-and-black-goat-with-horn-standing-near-fence-37910/ )

Version

Additional context This issue is related to this Twitter post, where you can also see the animation in a video.

julienduroure commented 6 months ago

Hello, Thanks for the report.

Two things here:

You can workaround that (if all your channels are keyed) by disable this option: Reset Bones between actions

image

This is a duplicate of #2104 Root cause is https://projects.blender.org/blender/blender/issues/118077

CentiGames commented 1 month ago

Hi! I am incredibly sorry for my late reply. At first I took a break from working on my project because of how complicated everything had gotten and other stuff happening in my life, and then I kind of forgot to reply to be honest. I am sorry!

However, I really appreciate the time you took to look into this issue! The workaround you proposed by disabling "Reset pose bones between actions" does indeed work for me! Thank you so much! Without your help, I would have never resolved this issue!

(not sure if this issue should be closed now or not?)