ME3Explorer Wiki
Register
No edit summary
(formatting)
Tag: rte-source
Line 1: Line 1:
 
{{ImportantName|PSA}} and [[PSK File Format|PSK]] binary files contain the raw animation and mesh information used to import skeletal animation art into the Unreal Engine. The PSA file contains the bone names, one or more sequence names, and for each sequence, its frame number N, and tracks of N rotations and N translations for each bone. In ''Mass Effect 3'', PSA data is included inside [[PCC File Format|PCC files]] and can be exported using the [[PCC Editor]] tool integrated in [[ME3Explorer Wiki|ME3Explorer]]. To learn how to export and edit PSA data from in-game files read the [[PSA Editing Tutorial]]. This page will be concerned with the specifics of the PSA binary format.
==Overview==
 
 
[[PSA File Format|PSA]] and [[PSK File Format|PSK]] binary files contain the raw animation and mesh information used to import skeletal animation art into the Unreal engine. The PSA file contains the bone names, one or more sequence names, and for each sequence, its frame number N, and tracks of N rotations and N translations for each bone. In [http://masseffect.wikia.com/wiki/Mass_Effect_3 Mass Effect 3], PSA data is included inside [[PCC File Format|PCC files]] and can be exported using the [[PCC Editor]] tool integrated in [[ME3Explorer Wiki|ME3Explorer]]. To learn how to export and edit PSA data from ingame files read the [[PSA Editing Tutorial]]. This page will be concerned with the specifcs of the PSA binary format.
 
<br/><br/>
 
   
 
==File Structure==
 
==File Structure==
 
PSA files are structured as a collection if header-data pairs, of which there are four known types: '''Head''', '''Bones''', '''Info''', and '''Keys'''.
   
 
<div class="toccolours mw-collapsible" style="width:720px; padding:1.0em; background-color:#303030; border:3px solid black;">
The PSA file is structured as a collection if header-data pairs, of which there are four known types: '''Head''', '''Bones''', '''Info''', '''Keys'''.
 
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:725px; padding:1.0em; background-color:#303030; border:3px solid black;">
 
 
Schematic representation of the PSA file structure.
 
Schematic representation of the PSA file structure.
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
[[File:Psa_file.png|720px]]
+
[[File:Psa_file.png|710px]]
</div></div><br/><br/>
+
</div>
  +
</div>
   
{{Template:SubheaderH3|Chunk Header}}
+
{{Subsection|Chunk Header}}
 
The {{ImportantName|Chunk Header}} contains information about its companion data chunk: '''ID''', '''type''', '''size''' and '''count'''. There are four possible IDs, corresponding to each of the eight mesh objects:
   
  +
*'''ANIMHEAD''': Does not contain a data pair.
The chunk header contains information about its companion data chunk: '''ID''', '''type''', '''size''' and '''count'''. There are four possible IDs, corresponding to each of the eight mesh objects:
 
  +
*'''BONENAMES''': Array with the bone names.
 
:* '''ANIMHEAD''': Does not contain a data pair.
+
*'''ANIMINFO''': Array of animation sequence info chunks.
:* '''BONENAMES''': Array with the bone names.
+
*'''ANIMKEYS''': Array of raw keys.
:* '''ANIMINFO''': Array of animation sequence info chunks.
 
:* '''ANIMKEYS''': Array of raw keys.
 
   
 
Each header defined as a 32 byte struct:
 
Each header defined as a 32 byte struct:
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible" style="width: 320px;"
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible mw-collapsed" style="width: 320px;"
 
 
|-
 
|-
 
! scope="col"|Bytes
 
! scope="col"|Bytes
Line 31: Line 26:
 
! scope="col"|Description
 
! scope="col"|Description
 
|-
 
|-
| 20
+
| 20
 
| Char
 
| Char
 
| Chunk ID
 
| Chunk ID
Line 46: Line 41:
 
| Int32
 
| Int32
 
| Data Count
 
| Data Count
|}<br/>
+
|}
   
{{Template:SubheaderH3|Head}}
+
{{Subsection|Head}}
 
The {{ImportantName|Head}} data chunk is defined by its header as having zero size and zero elements (count). Since it contains no information, it derives that only the header chunk has useful meaning. The header chunk may act as a file header, but does not necessarily have to be the first chunk in the file.
   
  +
{{Subsection|Bones}}
The head data chunk is defined by its header as having zero size and zero elements (count). Since it contains no information, it derives that only the header chunk has useful meaning. The header chunk may act as a file-header, but does not necessarily have to be the first chunk in the file.<br/><br/>
 
 
The {{ImportantName|Bones}} data chunk contains an array of bone names. Each bone is defined as a 100 bytes struct.
 
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible" style="width: 330px;"
{{Template:SubheaderH3|Bones}}
 
 
The bones data chunk contains an array of bone names. Each bone is defined as a 100 bytes struct.
 
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible mw-collapsed" style="width: 330px;"
 
 
|-
 
|-
 
! scope="col"|Bytes
 
! scope="col"|Bytes
Line 62: Line 54:
 
! scope="col"|Description
 
! scope="col"|Description
 
|-
 
|-
| 64
+
| 64
 
| Char
 
| Char
 
| Bone name
 
| Bone name
Line 109: Line 101:
 
| 4 * Int32
 
| 4 * Int32
 
| Padding
 
| Padding
|}<br/>
+
|}
   
{{Template:SubheaderH3|Info}}
+
{{Subsection|Info}}
 
The {{ImportantName|Info}} data chunk contains an array of animation sequence info chunks. Each sequence is defined as a 228 bytes struct:
 
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible" style="width: 330px;"
The info data chunk contains an array of animation sequence info chunks. Each sequence is defined as a 228 bytes struct.
 
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible mw-collapsed" style="width: 330px;"
 
 
|-
 
|-
 
! scope="col"|Bytes
 
! scope="col"|Bytes
Line 121: Line 111:
 
! scope="col"|Description
 
! scope="col"|Description
 
|-
 
|-
| 64
+
| 64
 
| String
 
| String
 
| Sequence name
 
| Sequence name
Line 168: Line 158:
 
| Int32
 
| Int32
 
| Raw frame count
 
| Raw frame count
|}<br/>
+
|}
   
{{Template:SubheaderH3|Keys}}
+
{{Subsection|Keys}}
 
The raw {{ImportantName|Key Array}} holds all the keys for all the bones in all the specified sequences. For each info sequence in the {{ImportantName|Info}} array, there are <code>[bones count] </code> * <code>[frames keys count]</code>. These are in turn laid out as tracks of <code>[frame count]</code> keys for each bone in the order of the bones, as defined in the {{ImportantName|Bones}} data array.
   
 
Each key is defined as a 32 byte struct:
The raw key array holds all the keys for all the bones in all the specified sequences. For each info sequence in the '''Info''' array, there are <code>[bones count] </code> * <code>[frames keys count]</code>. These are in turn laid out as tracks of <code>[frame count]</code> keys for each bone in the order of the bones, as defined in the '''Bones''' data array.
 
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible" style="width: 330px;"
 
Each key is defined as a 32 byte struct.
 
 
{| border="0" cellpadding="0" cellspacing="1" class="article-table mw-collapsible mw-collapsed" style="width: 330px;"
 
 
|-
 
|-
 
! scope="col"|Bytes
 
! scope="col"|Bytes
Line 182: Line 170:
 
! scope="col"|Description
 
! scope="col"|Description
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Location X
 
| Location X
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Location Y
 
| Location Y
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Location Z
 
| Location Z
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Rotation X
 
| Rotation X
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Rotation Y
 
| Rotation Y
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Rotation Z
 
| Rotation Z
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Rotation W
 
| Rotation W
 
|-
 
|-
| 4
+
| 4
 
| Float
 
| Float
 
| Time
 
| Time
|}<br/>
+
|}
 
==ME3Explorer Classes==
 
 
{{Template:ToolSetClass|ME3Explorer > PSAViewer > PSAViewer.cs}}<br/>
 
{{Template:ToolSetClass|ME3Explorer > Unreal > PSAFile.cs}}<br/>
 
   
 
==References==
 
==References==
* [http://udn.epicgames.com/Two/BinaryFormatSpecifications.html EpicGames page on binary format specifications for skeletal and vertex animation source files]
+
*[http://udn.epicgames.com/Two/BinaryFormatSpecifications.html EpicGames page on binary format specifications for skeletal and vertex animation source files]
* [http://www.gildor.org/projects/unactorx Gildor's ActorX Importer]
+
*{http://www.gildor.org/projects/unactorx Gildor's ActorX Importer]
* [http://me3explorer.freeforums.org/post13904.html ME3Explorer Forum Discussion: PSK File Format]
+
*[http://me3explorer.freeforums.org/post13904.html ME3Explorer Forum Discussion: PSK File Format]
<br/><br/>
 
 
[[Category:Developer Resources|PSA File Format]]
 
[[Category:Developer Resources|PSA File Format]]
 
[[Category:File Formats|PSA File Format]]
 
[[Category:File Formats|PSA File Format]]

Revision as of 04:46, 17 July 2015

PSA and PSK binary files contain the raw animation and mesh information used to import skeletal animation art into the Unreal Engine. The PSA file contains the bone names, one or more sequence names, and for each sequence, its frame number N, and tracks of N rotations and N translations for each bone. In Mass Effect 3, PSA data is included inside PCC files and can be exported using the PCC Editor tool integrated in ME3Explorer. To learn how to export and edit PSA data from in-game files read the PSA Editing Tutorial. This page will be concerned with the specifics of the PSA binary format.

File Structure

PSA files are structured as a collection if header-data pairs, of which there are four known types: Head, Bones, Info, and Keys.

Schematic representation of the PSA file structure.

Psa file

Chunk Header

The Chunk Header contains information about its companion data chunk: ID, type, size and count. There are four possible IDs, corresponding to each of the eight mesh objects:

  • ANIMHEAD: Does not contain a data pair.
  • BONENAMES: Array with the bone names.
  • ANIMINFO: Array of animation sequence info chunks.
  • ANIMKEYS: Array of raw keys.

Each header defined as a 32 byte struct:

Bytes Type Description
20 Char Chunk ID
4 Int32 Type Flag
4 Int32 Data Size
4 Int32 Data Count

Head

The Head data chunk is defined by its header as having zero size and zero elements (count). Since it contains no information, it derives that only the header chunk has useful meaning. The header chunk may act as a file header, but does not necessarily have to be the first chunk in the file.

Bones

The Bones data chunk contains an array of bone names. Each bone is defined as a 100 bytes struct.

Bytes Type Description
64 Char Bone name
4 Int32 Flags
4 Int32 Children
4 Int32 Parent index
4 Float Rotation X
4 Float Rotation Y
4 Float Rotation Z
4 Float Rotation W
4 Float Position X
4 Float Position Y
4 Float Position Z
16 4 * Int32 Padding

Info

The Info data chunk contains an array of animation sequence info chunks. Each sequence is defined as a 228 bytes struct:

Bytes Type Description
64 String Sequence name
64 String Sequence group
4 Int32 Bone count
4 Int32 Root include
4 Int32 Compression style
4 Int32 Key quotum
4 Float Key reduction
4 Float Track time
4 Float Animation rate
4 Int32 Start bone
4 Int32 First raw frame
4 Int32 Raw frame count

Keys

The raw Key Array holds all the keys for all the bones in all the specified sequences. For each info sequence in the Info array, there are [bones count] * [frames keys count]. These are in turn laid out as tracks of [frame count] keys for each bone in the order of the bones, as defined in the Bones data array.

Each key is defined as a 32 byte struct:

Bytes Type Description
4 Float Location X
4 Float Location Y
4 Float Location Z
4 Float Rotation X
4 Float Rotation Y
4 Float Rotation Z
4 Float Rotation W
4 Float Time

References