Binary file containers (.mesh, .cmesh, .animation)
Files .mesh, .cmesh, and .animation are containers designed to store multiple files of the same type within a single binary file. The primary purpose of these containers is to reduce the number of individual files in the file system and improve resource loading performance.
Data inside a container is organized as a sequence of chunks. Each chunk begins with a four-character identifier (FourCC, Chunk ID), which defines the type of data stored in the chunk.
The container includes a file table, where each file is represented by its name and data_offset.
The size of each file inside the container, except the last one, is determined by the following formula:
data_size = entries[N + 1].data_offset - entries[N].data_offsetFor the last file in the container, its end coincides with the end of the container.
When reading a file, the parser processes chunks sequentially and determines their type by the FourCC value.
Encountering an unknown FourCC value is considered a fatal error. The parser must not skip unknown chunks.
Data structure
PMSH | ANIM | CMHR
MTBL
entry_count
entries[entry_count]
entry_name
data_offset
resources[entry_count]
MESH | EANM | EVLM
resource_dataContainer identifiers
PMSH
uint8[4]
Mesh container.
Contains .ply resources.
ANIM
uint8[4]
Animation container.
Contains .anm resources.
CMHR
uint8[4]
Physics and collision volume container.
Contains .vol resources.
Chunk MTBL
Contains a list of all files stored inside the container, as well as offsets to the corresponding data.
Data structure
FourCC
uint8[4]
4
MTBL
entry_count
uint32
4
Number of entries in the table
entries
struct[entry_count]
Array of container entries
Container entry array (struct)
entry_name
string8
1+
Entry name
data_offset
uint32
4
Offset of the resource data. It’s relative, the end of the MTBL chunk is considered as 0.
Chunk MESH
Contains data in the .ply format.
FourCC
uint8[4]
MESH
ply_data
.ply
Mesh data in the .ply format.
Chunk EANM
Contains data in the .anm format.
FourCC
uint8[4]
EANM
anm_data
.anm
Animation data in the .anm format.
Chunk EVLM
Contains data in the .vol format.
FourCC
uint8[4]
EVLM
vol_data
.vol
Volume data in the .vol format.
Last updated