Difference between revisions of "SRT0 (File Format)"
m |
m |
||
(11 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{under-construction}} |
+ | == Overview == | ||
+ | This page describes the [[Mario Kart Wii]] '''SRT0''' file format, as found within [[BRRES (File Format)|BRRES]] files. They are '''S'''cale, '''R'''otate and '''T'''ranslate texture animation files. | ||
− | |||
− | |||
− | |||
== File Format == | == File Format == | ||
=== File Header === | === File Header === | ||
− | |||
− | |||
{{BRRES sub file header|SRT0}} | {{BRRES sub file header|SRT0}} | ||
=== SRT0 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: | |
− | The SRT0 header follows directly after the file header. For SRT0 version 5 it starts at offset 0x1c and has the following layout: | ||
{| class="wikitable" | {| class="wikitable" | ||
! offset !! size !! description | ! offset !! size !! description | ||
|- | |- | ||
− | | 0x00 || 4 || '''Unknown''' | + | | 0x00 || 4 || {{unknown-left|'''Unknown'''.}} |
|- | |- | ||
− | | 0x04 || 2 || Frame count | + | | 0x04 || 2 || Frame count. |
|- | |- | ||
− | | 0x06 || 2 || Animation data count | + | | 0x06 || 2 || Animation data count. |
|- | |- | ||
− | | 0x08 || 4 || '''Unsure''' Matrix Mode: 0x0000 = Maya, 0x0001 = XSI, 0x0002 = | + | | 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. |
|- | |- | ||
− | | 0x10 || colspan=2 {{unknown|End of header / Start of a filler}} | + | | 0x10 || colspan=2 {{unknown|End of header/Start of a filler}} |
|} | |} | ||
=== Animation Data (Section 0) === | === Animation Data (Section 0) === | ||
− | + | The start of section 0 is defined in the file header. It contains the animation data for the file. It starts with a [[BRRES Index Group (File Format)|BRRES Index Group]]. Each of the entries in the index group points to the animation information for one texture. | |
− | The start of section 0 is | ||
==== Texture Animation Data ==== | ==== Texture Animation Data ==== | ||
− | |||
The structure of the texture animation data which the index group points to has the following layout: | The structure of the texture animation data which the index group points to has the following layout: | ||
Line 43: | Line 37: | ||
| 0x00 || 4 || String offset to the name of the material to animate. | | 0x00 || 4 || String offset to the name of the material to animate. | ||
|- | |- | ||
− | | 0x04 || 4 || Texture flags ('''M''' bits in this are set) | + | | 0x04 || 4 || Texture flags ('''M''' bits in this are set). |
|- | |- | ||
− | | 0x08 || 4 || '''Unknown''' | + | | 0x08 || 4 || {{unknown-left|'''Unknown'''.}} |
|- | |- | ||
− | | 0x0c || '''M'''*4 || Entry offsets | + | | 0x0c || '''M'''*4 || Entry offsets. |
|- | |- | ||
| 0x0c+'''M'''*4 || colspan=2 {{unknown|End of structure}} | | 0x0c+'''M'''*4 || colspan=2 {{unknown|End of structure}} | ||
|} | |} | ||
− | The animation animates a given material, with the texture flags field having bits set to indicate which of the | + | The animation animates a given material, with the texture flags field having bits set to indicate which of the eight possible textures to animate. The entries mentioned in the structure actually describe what to animate about the texture. Each one has the following layout: |
{| class="wikitable" | {| class="wikitable" | ||
! offset !! size !! description | ! offset !! size !! description | ||
|- | |- | ||
− | | 0x00 || 4 || Animation type code. Determines how | + | | 0x00 || 4 || Animation type code. Determines how many animation data is required ('''P'''). |
|- | |- | ||
| 0x04 || '''P'''*4 || Animation data. | | 0x04 || '''P'''*4 || Animation data. | ||
Line 70: | Line 64: | ||
|- | |- | ||
! Meaning | ! Meaning | ||
− | | colspan="16" | '''Unknown''' | + | | colspan="16" {{unknown|'''Unknown'''}} |
|- | |- | ||
! Bit !! f !! e !! d !! c !! b !! a !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0 | ! Bit !! f !! e !! d !! c !! b !! a !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0 | ||
|- | |- | ||
! Meaning | ! Meaning | ||
− | | colspan="6" | '''Unknown''' || Y | + | | colspan="6" {{unknown|'''Unknown'''}} || Fixed Y Translation || Fixed X Translation || Fixed Rotation || Fixed Y Scale || Fixed Scale X || Has Isotropic Scale || Has Translation || Has Rotation || Has Scale || {{unknown|'''Unknown'''}} |
|} | |} | ||
If present, the animation data is stored in the following order: | If present, the animation data is stored in the following order: | ||
− | # '''Unknown ''' | + | # '''Unknown''' |
# Scale | # Scale | ||
# Rotation | # Rotation | ||
# Translation X | # Translation X | ||
# Translation Y | # 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: | + | 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: |
{| class="wikitable" | {| class="wikitable" | ||
! offset !! size !! description | ! offset !! size !! description | ||
|- | |- | ||
− | | 0x00 || 2 || Frame count ('''Q''') | + | | 0x00 || 2 || Frame count ('''Q'''). |
|- | |- | ||
− | | 0x02 || 2 || '''Unknown''' | + | | 0x02 || 2 || {{unknown-left|'''Unknown'''.}} |
|- | |- | ||
− | | 0x04 || 4 || Frame scale (single) | + | | 0x04 || 4 || Frame scale (single). |
|- | |- | ||
− | | 0x08 || '''Q'''*12 || Frame information | + | | 0x08 || '''Q'''*12 || Frame information. |
|- | |- | ||
| 0x08+'''Q'''*12 || colspan=2 {{unknown|End of structure}} | | 0x08+'''Q'''*12 || colspan=2 {{unknown|End of structure}} | ||
Line 105: | Line 99: | ||
! offset !! size !! description | ! offset !! size !! description | ||
|- | |- | ||
− | | 0x00 || 4 || Tangent (single) | + | | 0x00 || 4 || Tangent (single). |
|- | |- | ||
− | | 0x04 || 4 || Value (single) | + | | 0x04 || 4 || Value (single). |
|- | |- | ||
− | | 0x08 || 4 || Index (single) | + | | 0x08 || 4 || Index (single). |
|- | |- | ||
| 0x0c || colspan=2 {{unknown|End of structure}} | | 0x0c || colspan=2 {{unknown|End of structure}} | ||
|} | |} | ||
− | All information about the implementation of these structures is presently | + | All information about the implementation of these structures is presently unknown. |
− | === | + | === Unknown Section (Section 1) === |
− | + | Unknown. | |
== Tools == | == Tools == | ||
− | |||
The following tools can handle SRT0 files: | The following tools can handle SRT0 files: | ||
− | * [[ | + | * [[BrawlBox]], by Kryal and BlackJax. |
− | * [[ | + | * [[BrawlCrate]], by soopercool101. |
+ | * [[CTools Pack]], by [[Chadderz]] (parsed, but not editable). | ||
== Links == | == Links == | ||
− | |||
{{BRRES links}} | {{BRRES links}} | ||
− | [[ | + | [[Category:File Format/Wii]] |
Latest revision as of 13:59, 11 January 2022
Overview
This page describes the Mario Kart Wii SRT0 file format, as found within BRRES files. They are Scale, Rotate and Translate texture 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 defined 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 eight 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 many 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 | Fixed Y Translation | Fixed X Translation | Fixed Rotation | Fixed Y Scale | Fixed Scale X | Has Isotropic Scale | Has Translation | 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:
- BrawlBox, by Kryal and BlackJax.
- BrawlCrate, by soopercool101.
- CTools Pack, by Chadderz (parsed, but not editable).