An ASCII FBX file is a tree of nodes written as text. Autodesk does not define the grammar; its help pages show sample files, and readers such as Assimp, ufbx and three.js parse what the FBX SDK writes. This page describes that common ground. The nodes themselves and what they mean are on Scene nodes.
Nodes
A node is its name, a colon, then its values separated by commas. If it has children, an opening brace follows the values and a closing brace ends the children. A node with children and no values is written as the name, a colon and the brace.
Name: value, value, value
Name: value {
Child: value
}
Name: {
Child: value
}
Line breaks, spaces and tabs separate tokens and otherwise mean nothing; the
indentation is only for reading. The characters {, },
, and : are punctuation outside strings. Assimp’s reader also
accepts spaces before the colon.
Values
| Kind | Written as | Examples |
|---|---|---|
| integer | digits with an optional minus sign | 1003, -1, 46186158000 |
| real number | decimal, with an optional exponent | 0.5, -1.2e-05 |
| string | in double quotes, from one quote to the next | "Model::Cube", "" |
| bare word | any other run of characters, such as a single letter used as a flag | Y, T |
Strings have no escape character, so a reader takes the next double quote as the end.
The text carries no type codes: unlike the binary
form, a reader must decide from the text, or from the node’s name, whether a number
is a 32-bit or 64-bit integer, a float or a double. Ids, KeyTime values
and other KTime values need 64 bits.
Arrays
In FBX 7 files a large array is written as an asterisk and its element count, then a
block holding one node a whose values are the elements:
Vertices: *12 {
a: 0,0,0,1,0,0,1,1,0,0,1,0
}
The a: values may run over many lines. FBX 6 files have no count: the
elements follow the colon directly, separated by commas and wrapped over lines, as in
Vertices: 0,0,0,1,0,0,….
Raw data
Where the binary form has raw bytes, such as an embedded texture in a
Video node’s Content, ASCII files carry them as base64 text
in strings. Long data can be split into several strings separated by commas, each a
piece of one base64 stream, so a reader must join them before decoding. Some
exporters do not embed textures in ASCII files at all.
Object names
An object’s name is written with its class in front and two colons between, as in
"Model::Cube" or "Geometry::Cube". The binary form stores the
same string the other way round, separated by the bytes 00 01.
Example
; FBX 7.4.0 project file
; ----------------------------------------------------
FBXHeaderExtension: {
FBXHeaderVersion: 1003
FBXVersion: 7400
}
Objects: {
Model: 2000, "Model::Triangle", "Mesh" {
Version: 232
Properties70: {
P: "Lcl Translation", "Lcl Translation", "", "A",0,1.5,0
}
}
Geometry: 1000, "Geometry::Triangle", "Mesh" {
Vertices: *9 {
a: 0,0,0,1,0,0,0,1,0
}
PolygonVertexIndex: *3 {
a: 0,1,-3
}
}
}
Connections: {
C: "OO",2000,0
C: "OO",1000,2000
}
Comments and the first line
A semicolon starts a comment, which runs to the end of the line; inside a quoted string it is an ordinary character. Files written by the FBX SDK start with comment lines naming the version, such as
; FBX 7.4.0 project file, then a copyright line and a line of dashes. Readers tell an ASCII file from a binary one by the binary magicKaydara FBX Binary, which ASCII files lack; the comment line is not required.