Fix missing animations when converting some FBX from json to binary #104911

Merged

3 Commits

Author SHA1 Message Date
c88a33fa1d Increase FBX IO Version 2023-10-05 23:01:27 +01:00
3c0f47e285 Merge branch 'blender-v4.0-release' into fbx_fix_always_sentinel_when_last 2023-10-05 22:56:00 +01:00
9b6ea1eca4 Fix missing animations when converting some FBX from json to binary
Animations would be missing in external software when importing FBX that
have their AnimationLayer or AnimationStack element as the last element
in a block. Importing such files through Blender, however, would import
the animations without issue.

AnimationLayer and AnimationStack elements are an exception to normal
FBX behaviour in that they always need to write a block sentinel after
them. However, this was not happening when the AnimationLayer was the
last element in a block.

With this patch, the block sentinel is now always written for
AnimationLayer and AnimationStack elements.

This patch should only affect FBX files converted from json to binary
with the json2fbx.py script because FBX exported from Blender always
writes the AnimationStack, AnimationLayer and then AnimationCurveNodes
and AnimationCurves of that AnimationLayer, so the only time the
AnimationLayer could be the last element in the block is when there are
no animations in the AnimationLayer to begin with.
2023-10-01 13:59:21 +01:00