Fix missing animations when converting some FBX from json to binary #104911
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104911
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Mysteryem/blender-addons:fbx_fix_always_sentinel_when_last"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
I was working on #104684 using the https://archive.blender.org/developer/F13133131/test_track.fbx from #98604 and was finding that the animations would be missing in FBX Review and Unity. Comparing the original file to the file converted to .json and then back to .fbx, I found that the only relevant difference between the two was a sentinel block after the AnimationLayer in the original .fbx, but not in the converted .fbx.
In the converted .json, it can be seen that the AnimationLayer is at the end of its block:
Because this is a version 7500+ FBX, the block sentinels are 25 bytes each, so it should be clear that the converted .fbx only has a single block sentinel (from its parent element), whereas the original has both a block sentinel from its parent element and an extra sentinel for the AnimationLayer.
The selected sections aren't exactly the block sentinels because I counted the size wrong, thinking it was 24.
a109c60456
to9b6ea1eca4
Fix missing animations when converting some FBX from json to binaryto Fix missing animations when converting some FBX from json to binary