godotengine / FBX2glTF

A command-line tool for the conversion of 3D model assets on the FBX file format to the glTF file format.
Other
311 stars 73 forks source link

Animation FBX should reset to the keyframe of the first animation #43

Open lyuma opened 1 year ago

lyuma commented 1 year ago

Godot version

4.1.dev 2c895169

System information

Windows 10

Issue description

These animation FBX work fine in other engines, but look incorrect in Godot and Blender because the baked Node "Lcl Rotation" values are incorrect / based on the animation rather than the T-pose.

FBX seems to have a convention in which the poses included in the file should be ignored, and the first frame of the first AnimStack object is used instead.

Expected behavior in other engines is for the initial rest pose to be the first frame of the first animation stack object. This can be observed for example in Unity by swapping the order of the AnimStack objects in the ASCII FBX and observing that the humanoid configuration screen no longer puts the model into T-pose by default, when Pose -> Reset is selected.

FBX2glTF uses EvaluateLocalTransform passing the default time of infinite, which ignores animation curves.

Given the possibility that this could break or change existing content, it may make sense to be an optional setting (use first animation keyframe). It may help to do more testing/research on more FBX compatible software.

Steps to reproduce

  1. Open the project
  2. Open the idle / jump / run animation FBX
  3. These converted FBX should be in T-pose so the retargeting system can run, but instead they are in the first frame

Minimal reproduction project

fbx files and project are available in: kenney_fbx_animations.zip