Skip to content

Instantly share code, notes, and snippets.

@iscle
Last active April 26, 2022 18:05
Show Gist options
  • Save iscle/0dbcee58be8582978d15ea3629ce3e8b to your computer and use it in GitHub Desktop.
Save iscle/0dbcee58be8582978d15ea3629ce3e8b to your computer and use it in GitHub Desktop.
Autodesk FBX Binary Specification

Autodesk FBX Binary Specification (unofficial)

Finding updated documentation on the binary format for FBX can be quite hard. After looking through various parsers from various open-source projects, I decided to write this short specification with the new and updated information I found.

NOTE: This is still a work in progress, although all values being shown should be correct.

Binary header

Size: 27 bytes

Offset (bytes) Description Value
0 - 20 File magic (string + 2 spaces + NULL terminator) Kaydara FBX Binary \0
21 Unknown 0x1A (observed, might vary)
22 Endianness 0x00 = Little Endian, 0x01 = Big Endian
23 - 26 FBX Version (uint32) Example: 7500

Property

Size: 25 + sizeof(name) + sizeof(Property[]) + sizeof(Node[])

Size (bytes) Data type Name
1 char type_code
? ? data

Type codes

Primitive types

Type code Size (bytes) Data type
Y 2 short
C 1 boolean (0 = false, 1 = true)
I 4 int
F 4 float
D 8 double
L 8 long

Array types

Type code Size (bytes) Data type
f 4 * array_length float[]
d 8 * array_length double[]
l 8 * array_length long[]
i 4 * array_length int[]
b 1 * array_length boolean[] (0 = false, 1 = true)
Size (bytes) Data type Name
4 unsigned int array_length
4 unsigned int encoding
4 unsigned int compressed_length
? ? data

If encoding == 0, the data length is array_length * data type size. If encoding == 1, the data is a deflate/zip-compressed buffer of length compressed_length

Special types

Type code Size (bytes) Data type
S 1 * data_length char[]
R 1 * data_length unsigned byte[]
Size (bytes) Data type Name
4 unsigned int data_length
? char / unsigned byte data

Node

FBX Version < 7500

Size: 25 + sizeof(name) + sizeof(Property[]) + sizeof(Node[])

Size (bytes) Data type Name
4 unsigned int end_offset
4 unsigned int property_count
4 unsigned int property_len
1 unsigned byte name_len
name_len char[] name
? Property[] properties
? Node[] children

FBX Version >= 7500

Size: 25 + sizeof(name) + sizeof(Property[]) + sizeof(Node[])

Size (bytes) Data type Name
8 unsigned long end_offset
8 unsigned long property_count
8 unsigned long property_len
1 unsigned byte name_len
name_len char[] name
? Property[] properties
? Node[] children

Credits

https://code.blender.org/2013/08/fbx-binary-file-format-specification/ https://github.com/FyroxEngine/Fyrox/blob/master/src/resource/fbx/document/binary.rs https://github.com/bqqbarbhg/ufbx/blob/master/ufbx.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment