CINF (File Format): Difference between revisions

>Aruki
No edit summary
>Aruki
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''CINF format''' is for skeletons. Skeletons are associated with models and skins through [[ANCS (File Format)|ANCS]] files.
The '''CINF format''' is for character layouts (i.e. skeletons/armatures).
Character layouts are associated with models and skins through [[ANCS (File Format)|ANCS]] files.


{{researchminor|reason=What is the point of the bone ID section?}}
{{todo|MP3/DKCR differences}}
{{todo|MP2/3/DKCR differences}}


== Format ==
== Format ==


The file starts with a list of all the bones in the skeleton. The first value is a 32-bit count, then the following structure loops.
{| class="wikitable"
! Type
! Count
! Name
! Notes
|-
| u32
| 1
| '''Bone Count'''
|
|-
| [[#Bone|Bone]]
| ''Bone Count''
| '''Bone Table'''
|
|-
| u32
| 1
| '''Build Order ID Count'''
|
|-
| u32
| ''Build Order ID Count''
| '''Build Order ID Table'''
| The first element of the ID table is the root bone, followed by the rest of the bone IDs in reverse numerical order. This table is enumerated in-order to construct a singly-linked hierarchy of bones using [[wikipedia:Left-child right-sibling binary tree|child/sibling convention]].
|-
| u32
| 1
| '''Bone Name Count'''
|
|-
| [[#Bone Name|Bone Name]]
| ''Bone Name Count''
| '''Bone Name Table'''
|
|-
| colspan=4 {{unknown|End of file}}
|}
 
=== Bone ===


{| class="wikitable"
{| class="wikitable"
! Offset
! Offset
! Type
! Type
! Size
! Count
! Description
! Name
! Notes
! MP1
! MP2
|-
|-
| 0x0
| 0x0
| u32
| u32
| 4
| 1
| '''Bone ID'''
| '''Bone ID'''
|
| {{check}}
| {{check}}
|-
|-
| 0x4
| 0x4
| u32
| u32
| 4
| 1
| '''Parent Bone ID'''
| '''Parent Bone ID'''
|
| {{check}}
| {{check}}
|-
|-
| 0x8
| 0x8
| float[3]
| {{Vector3f}}
| 0xC
| 1
| '''Position'''
| '''Position'''
| The position is in the skeleton's local space, not in the parent's bone space.
| {{check}}
| {{check}}
|-
|-
| 0x14
| 0x14
| u32
| {{Quaternion}}
| 4
| 1
| '''Linked bone count''' (LC); includes parent + children
| '''Rotation'''
| Initial rotation of the bone, also in the skeleton's local space.
| {{nocheck}}
| {{check}}
|-
|-
| 0x18
| 0x24
| u32[]
| {{Quaternion}}
| 4 × LC
| 1
| '''Linked bone ID array'''
| '''Local Rotation'''
|}
| Initial local rotation of the bone in this bone's local space (parent-relative).
 
| {{nocheck}}
After this is an array listing every bone ID in the skeleton. The first bone is the root bone, then the rest are listed in reverse numerical order.
| {{check}}
 
{| class="wikitable"
! Type
! Count
! Description
|-
|-
| 0x34
| u32
| u32
| 1
| 1
| '''Bone ID count''' (BC)
| '''Linked Bone Count'''
|
| {{check}}
| {{check}}
|-
|-
| 0x38
| u32
| u32
| BC
| ''Linked Bone Count''
| '''Bone ID array'''
| '''Linked Bone ID Array'''
| This array includes both the parent bone ID as well as all children.
| {{check}}
| {{check}}
|-
| colspan=7 {{unknown|End of bone}}
|}
|}


Finally, the end of the file sets bone names. After the traditional count value, this short structure loops:
=== Bone Name ===


{| class="wikitable"
{| class="wikitable"
! Type
! Type
! Count
! Count
! Description
! Name
! Notes
|-
|-
| string
| string
| 1
| 1
| '''Bone name'''
| '''Bone Name'''
|
|-
|-
| u32
| u32
| 1
| 1
| '''Bone ID'''
| '''Bone ID'''
|
|-
| colspan=4 {{unknown|End of bone name}}
|}
|}


Anonymous user