OMA Binary File Format Specification 0.1.11
Basic Information
- Endian Order: Big.
- Types
- Float: IEEE standard 4-byte floating point value.
- Integer: 32-bit/4-byte integers (signed unless specified as unsigned).
- Character: Single unsigned byte (often in a string with UTF-8 formatting).
File Header
- Data (Type)
- File Version (Unsigned Integer)
- Flag Mask (Unsigned Integer)
- Data Offset (Unsigned Integer)
- Chunk Count (Unsigned Integer)
- Data Information
- File Version:
This should be 0x00000002. If it is not, the file being read follows an alternate OMA standard.
- Flag Mask:
Allows options to be enabled/disabled for this file with each bit.
- Current options are:
- 0x00000001: Ignore Count.
The Chunk Count header entry is to be ignored. This is useful when the file is being streamed somehow, and the total number of chunks isn't known at the time the header is being sent.
- 0x00000001: Ignore Count.
- Current options are:
- Data Offset:
This is the number of bytes after the beginning of this header that the chunk data will start being listed. This should normally be 16, but it might change in the future.
- Chunk Count:
This is the total number of chunks that the file will contain. Disregard this if the "Ignore Count" bit is set in the mask.
- File Version:
- Data (Type)
Chunks
- Data
- Header
- Data (Type)
- ID (Unsigned Integer)
- Type (Unsigned Integer)
- Element Size (Unsigned Integer)
- Element Count (Unsigned Integer)
- Data Information
- ID:
This is the method in which other chunks can refer to this chunk. If this value is 0, no other chunk can reference this chunk. Except in the case of an ID being 0, no ID should be duplicated.
- Type:
This must be equal to one of the registered types below if it is less than 1,000,000. If it is greater than 1,000,000, it may be an extension type.
- Element Size:
This is the size in bytes of each element of the chunk following this header.
- Element Count:
This is the number of elements of the chunk following this header.
- ID:
- Data (Type)
- Data
The data size can be computed by multiplying Element Size and Element Count.
- Header
- Data
Registered Chunk Type Names (Number)
- Set of characters, a.k.a. text (1):
UTF-8 formatted text (ASCII-compatible Unicode). Containing no 0 (null) characters, except one at the end.
- Set of integers (200):
The data will be all integers.
- Set of short integers (201):
The data will be all integers.
- Set of byte integers (202):
The data will be all integers.
- Set of floats (300):
The data will be all floats.
- Set (800):
The data will be made up of unsigned integers, each being the ID of another chunk.
- Set of quaternions (900):
The data will be made up of groups of 4 floats, each being a quaternion in W,X,Y,Z order.
- Set of matrices (901):
The data will be made up of groups of 16 floats, each being a 4 by 4 matrix in column-major order.
- Set of meshes (2000):
- Index Data (Type)
- Type (Unsigned Integer)
- Indices (Unsigned Integer)
- Vertices (Unsigned Integer)
- Attributes (Unsigned Integer)
- Texture Coordinates (Unsigned Integer)
- Normals (Unsigned Integer)
- Colors (Unsigned Integer)
- Weights (Unsigned Integer)
- Weight Indices (Unsigned Integer)
- Index Data Information:
- Type (Value)
- Undefined (0)
- Triangles (1)
- Triangle strip (2)
- Triangle fan (3)
- Quads (4)
- Quad strip (5)
- Lines (6)
- Line loop (7)
- Line strip (8)
- Polygon (9)
- Points (10)
- Indices:
The ID of another chunk to use for index data (or 0 to indicate none). Expected chunk types are currently: set of integers.
- Vertices:
The ID of another chunk to use for vertex data (or 0 to indicate none). Expected chunk types are currently: set of 2-4 floats.
- Attributes:
The ID of another chunk to use for vertex attribute data (or 0 to indicate none).
- Texture Coordinates:
The ID of another chunk to use for texture coordinate data (or 0 to indicate none). Expected chunk types are currently: set of 1-4 floats.
- Normals:
The ID of another chunk to use for normal data (or 0 to indicate none). Expected chunk types are currently: anything that Vertices can reference, this ID must be the same type (or 0).
- Colors:
The ID of another chunk to use for normal data (or 0 to indicate none). Expected chunk types are currently: set of groups of 3 or 4 bytes (for 0-255 RGB or RGBA data), set of groups of 3 or 4 floats (for 0.0-1.0 RGB or RGBA data).
- Weights:
The ID of another chunk to use for weight data (or 0 to indicate none).
- Weight Indices:
The ID of another chunk to use for weight index data (or 0 to indicate none).
- Type (Value)
- Index Data (Type)
- Set of objects (3000):
- Index Data (Type)
- Mesh (Unsigned Integer)
- Bone (Unsigned Integer)
- Material (Unsigned Integer)
- Data Information
- Mesh:
The ID of a set of meshes to get the object data out of.
- Bone:
The ID of a bone chunk to use for this object.
- Material:
The ID of a material chunk to use for this object.
- Mesh:
- Index Data (Type)
- Set of bones (4000):
- Index Data (Type)
- Orientations (9 Floats)
- Position (3 Floats)
- Children (Unsigned Integer)
- Index Data Information:
- Orientation:
Nine floating point numbers forming a 3x3 column-major matrix to use as the orientation of the bone.
- Position:
Three floating point numbers to use as the origin of the bone.
- Children:
The number of bones following this one to qualify as children of this bone (each possibly with their own children).
- Orientation:
- Notes: The orientation and position form a 4x3 matrix. Each position and orientation is stored relative to the same space regardless of the position and orientation of any parent bones. To get a relative transformation from a parent, multiply the inverse of a parent bone's matrix by the child bone's matrix.
- Index Data (Type)
- Set of animation (5000):
- Index Data (Type)
- Value Type (Unsigned Integer)
- Object Type (Unsigned Integer)
- Object Index (Unsigned Integer)
- Transformation (Unsigned Integer)
- Time (Unsigned Integer)
- Value (Unsigned Integer)
- Index Data Information:
- Value Type:
- Undefined (0)
- Translate (100)
- Translate X (101)
- Translate Y (102)
- Translate Z (104)
- Rotate (200)
- Rotate X (201)
- Rotate Y (202)
- Rotate Z (204)
- Scale (300)
- Scale X (301)
- Scale Y (302)
- Scale Z (304)
- Index (400)
- Object Type:
- Undefined (0)
- Bone (1)
- Object (2)
- Mesh (3)
- Object Index:
The index of an object in a set of objects to which this animation property applies.
- Transformation:
- Undefined (0)
- Round Down (1)
- Round Up (2)
- Round Nearest (3)
- Linear (4)
- Cubic (5)
- Time:
The ID of a chunk to use for time values for this animation property.
- Value:
The ID of a chunk to use for values for this animation property.
- Value Type:
- Index Data (Type)
- Set of tags (10000):
- Index Data (Type)
- ID (Unsigned Integer)
- Label (UTF-8 formatted text, ASCII-compatible Unicode, containing no 0/null characters except at least one at the end)
- Index Data Description
- ID:
The ID of the chunk this tag is labeling.
- Name:
The label of the chunk.
- ID:
- Index Data (Type)
- Set of extensions (100000):
- Index Data (Type)
- Fallback (Unsigned Integer)
- Type (Unsigned Integer)
- Version (Unsigned Integer)
- Name (24 Characters, UTF-8 formatted text, ASCII-compatible Unicode, containing no 0/null characters except at least one at the end)
- Index Data Description
- Fallback:
Another chunk type that this extension's chunks can be interpreted as. Use 0 to specify no fallback chunk type.
- Type:
The chunk type this extension is taking responsibility for.
- Version:
The earliest version of support for this extension that's acceptable.
- Name:
The name of the extension.
- Fallback:
- Index Data (Type)
- Set of characters, a.k.a. text (1):
Misc.
- Vertex order: Counter-clockwise (anti-clockwise).
- Any alpha color data is stored with 0% as transparent and 100% for opaque. For floats that would be 0.0f and 1.0f.
- Texture Coordinates
- X: 0.0f is the left, 1.0f is the right.
- Y: 0.0f is the bottom, 1.0f is the top.
- Z: 0.0f is the front, 1.0f is the back.
- Filename Extension: On filesystems where filename extensions are used to specify file type, an OMA file will be appended with ".oma".