Difference between revisions of "SRT0 (File Format)"
MrKoeikoei (talk | contribs) m (typo) |
|||
Line 23: | Line 23: | ||
| 0x06 || 2 || Animation data count | | 0x06 || 2 || Animation data count | ||
|- | |- | ||
− | | 0x08 || 4 || ''' | + | | 0x08 || 4 || '''Unsure''' Matrix Mode: 0x0000 = Maya, 0x0001 = XSI, 0x0002 = 3DS Max |
|- | |- | ||
| 0x0c || 4 || Looping 0x00=disabled 0x01=enabled | | 0x0c || 4 || Looping 0x00=disabled 0x01=enabled |
Revision as of 14:18, 13 February 2013
This page describes the Mario Kart Wii SRT0 file format, as found within BRRES files. SRT0 files are texture movement animation files.
File Format
File Header
Offset | Type | Description |
---|---|---|
0x00 | String | The magic "SRT0" to identify the sub file. See »BRRES Sub Files« for other magics. |
0x04 | UInt32 | Length of the sub file. |
0x08 | UInt32 | Sub file version number. The number of sections (N) is dependent of this version number. See »BRRES Sub Files« for details. |
0x0C | Int32 | Offset to outer BRRES File. |
0x10 | Int32[N] | N section offsets. N is implied in the version number (offset 0x08). |
0x10+N*4 | Int32 | String offset to the name of this sub file. This name equal to the name of the entry name of the BRRES Index Group pointing to this data. |
0x14+N*4 | End of this header |
SRT0 Header
The SRT0 header follows directly after the file header. For SRT0 version 5 it starts at offset 0x1c and has the following layout:
offset | size | description |
---|---|---|
0x00 | 4 | Unknown |
0x04 | 2 | Frame count |
0x06 | 2 | Animation data count |
0x08 | 4 | Unsure Matrix Mode: 0x0000 = Maya, 0x0001 = XSI, 0x0002 = 3DS Max |
0x0c | 4 | Looping 0x00=disabled 0x01=enabled |
0x10 | End of header / Start of a filler |
Animation Data (Section 0)
The start of section 0 is defned in the file header. It contains the animation data for the file. It starts with a BRRES Index Group. Each of the entries in the index group points to the animation information for one texture.
Texture Animation Data
The structure of the texture animation data which the index group points to has the following layout:
offset | size | description |
---|---|---|
0x00 | 4 | String offset to the name of the material to animate. |
0x04 | 4 | Texture flags (M bits in this are set) |
0x08 | 4 | Unknown |
0x0c | M*4 | Entry offsets |
0x0c+M*4 | End of structure |
The animation animates a given material, with the texture flags field having bits set to indicate which of the 8 possible textures to animate. The entries mentioned in the structure actually describe what to animate about the texture. Each one has the following layout:
offset | size | description |
---|---|---|
0x00 | 4 | Animation type code. Determines how much animation data is required (P). |
0x04 | P*4 | Animation data. |
0x04+P*4 | End of structure |
The animation type code is a 32 bit structure with the following layout (msb first):
Bit | 1f | 1e | 1d | 1c | 1b | 1a | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Meaning | Unknown | |||||||||||||||
Bit | f | e | d | c | b | a | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Meaning | Unknown | Y fixed | X fixed | Rotation Fixed | Scale Fixed | Unknown Fixed | Has Unknown | Has Translaition | Has Rotation | Has Scale | Unknown |
If present, the animation data is stored in the following order:
- Unknown
- Scale
- Rotation
- Translation X
- Translation Y
If the value is 'fixed' then the animation data contains a single to set the value to. If it is not fixed, the animation data field contains a pointer to an animation frame data structure data, which has the following layout:
offset | size | description |
---|---|---|
0x00 | 2 | Frame count (Q) |
0x02 | 2 | Unknown |
0x04 | 4 | Frame scale (single) |
0x08 | Q*12 | Frame information |
0x08+Q*12 | End of structure |
The frame information data each has the following layout:
offset | size | description |
---|---|---|
0x00 | 4 | Tangent (single) |
0x04 | 4 | Value (single) |
0x08 | 4 | Index (single) |
0x0c | End of structure |
All information about the implementation of these structures is presently Unknown.
Unknown Section (Section 1)
Unknown.
Tools
The following tools can handle SRT0 files:
- CTools Pack (parsed, but not editable), by Chadderz
- BrawlBox, by BlackJax