-
Notifications
You must be signed in to change notification settings - Fork 0
JSON format structure
Since version 2.2.0
, apart from .format files
you can specify output file format with JSON files
This article only outlines the structure of JSON files and does not explain how do they translate to compilation format. It is advised that you read format file syntax page first. JSON members are named exactly as key-words
in .format file
.
Whole file must be an object with only one array member named "units"
.
{
"units": [
]
}
"units"
must be an array of JSON objects
of two allowed types:
file units
helper units
Each unit
can have a "preamble"
and "buffers"
members, which must be arrays.
{
"preamble": [
],
"buffers": [
]
}
Preamble is an array of fields
and buffer is an array of buffers
What separates helper units
from file units
is that:
-
helper units
must have a"name"
string
member - that can be referred to later -
file units
must have an"output_file"
string
member that defines output file name, uses same pattern file naming as in.format file
Additionally file untis
may specify "print_mode"
member, which may take on of following values:
-
plainText
,plain-text
,plain_text
- specifies that output file will be in plain text -
binary
- specifies that output file will be binary (default)
field can be either a string
or JSON object
structure like one below:
{
"value":
"type":
}
fields
written as strings are parsed exactly the same way as in .format file
.
In case of JSON objects
"type"
refers to part before :
and "value"
to part after.
one buffer JSON object
can contain to array members: "preamble"
and "fields"
, both of which are arrays of fields
.
{
"preamble": [
"uint4:buffs",
{"type": "uint", "value": "fieldb"}
],
"fields": [
"float:vertex",
{"type": "float4", "value": 2.56}
]
}
{
"units": [
{
"name": "mesh",
"preamble": [
"int4:-50",
"uint4:buffu",
"uint4:buffs",
"uint4:entryu",
"entryb",
"entrys",
"fieldu",
"fieldb",
"fielde",
"fields"
],
"buffers": [
{
"preamble": [
"int4:-30",
"buffs",
"entryb",
"entrys",
"fieldb",
"fielde",
"uint4:fields"
],
"fields": [
"float:vertex.x",
"vertex.y",
"vertex.z",
"int4:-20"
]
},
{
"preamble": [
"int4:-30",
"buffs",
"entryb",
"entrys",
"fieldb",
"fielde",
"uint4:fields"
],
"fields": [
"float:vertex.x",
"vertex.y",
"vertex.z",
"int4:-20"
]
}
]
},
{
"output_file": "tests/acceptance/res/{mesh}_json_su.txt",
"print_mode": "plainText",
"preamble": [
"mesh"
]
}
]
}
JSON format structure since v2.2.0
-
bone_id
since v2.1.0 -
bone_weight
since v2.1.0 -
off_matr
,off_matrix
,offset_matr
,offset_matrix
since v2.0.0 -
bone_parent
since v2.3.0 -
bone_child
since v2.3.0 -
m_off_matr
,m_off_matrix
,m_offset_matr
,m_offset_matrix
since v2.2.0 -
m_bone_parent
since v2.3.0 -
m_bone_child
since v2.3.0 -
position_key
since v2.0.0 -
rotation_key
since v2.0.0 -
scale_key
since v2.0.0 -
position_time
,position_timestamp
,position_key_time
,position_key_timestamp
since v2.0.0 -
rotation_time
,rotation_timestamp
,rotation_key_time
,rotation_key_timestamp
since v2.0.0 -
scale_time
,scale_timestamp
,scale_key_time
,scale_key_timestamp
since v2.0.0 -
duration
since v2.0.0 -
ticks_per_second
since v2.0.0
key-words
: