XML:TRBS: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(Created page with "__TOC__ {{Template:XMLModdingHints}} {| border=0 cellspacing=20 cellpadding=0 style="margin-left:auto; margin-right:auto" <!--|The xml code on this page is compatible with o...")
 
m (using new tree list for file structure :))
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__TOC__
{{XML_File_Header | prev=TRAS | type=TRBS | next=TRGE | name=Totoro Body Set}}


==General information==
* TRBS files describe the overall structure of a character's 3D model. They are linked to from the ONCC character class file.
* In vanilla Oni, TRBS files are stored locally in level''x''_Final.dat according to which characters are needed for that level. In AE Oni, all TRBS files are stored in level0_Final.dat.
* They contain 5 different models with differing levels of detail (known as LODs). A common game development technique for improving performance is to display a reduced polygon-count version of a character when they're farther from the camera.


{{Template:XMLModdingHints}}
==File structure==
{| border=0 cellspacing=20 cellpadding=0 style="margin-left:auto; margin-right:auto"
{{Tree list}}
<!--|The xml code on this page is compatible with onisplit '''v????'''-->
* TRBS
|}
** TRCM
 
** TRCM
'''general information'''
** TRCM
* TRBS files are stored ''globally'' (in edition/GameDataFolder/level0_Final)
** TRCM
* these files are used by ONCC
** TRCM (same for all TRCM)
* they contain 5 models differing in ("LOD") level of detail (triangle number)
*** TRGA
 
**** [[XML:M3GM|M3GM]]
***** PNTA
***** VCRA
***** TXCA
***** IDXA
***** IDXA
***** (empty) texture link (because of [[XML:TRMA|TRMA]] usage)
*** TRTA
*** TRIA
{{Tree list/end}}


'''extraction'''
==Extraction (new method)==
This is more powerful method because it extracts the full range of models (all 5 LODs).
  onisplit -extract:xml ''output_folder input_folder''/TRBS''name''.oni
  onisplit -extract:xml ''output_folder input_folder''/TRBS''name''.oni


==Extraction (old method)==
This older extraction approach lets you choose between extracting only the TRBS or the ONCC file with TRBS. Note that this only extracts the model with the highest poly count.
onisplit -extract:dae ''output_folder input_folder''/TRBS''name''.oni
onisplit -extract:dae ''output_folder input_folder''/ONCC''name''.oni


'''creation'''
==Creation (new method)==
This creates a TRBS file with up to 5 different LODs:
  onisplit -create ''output_folder input_folder''/TRBS''name''.xml
  onisplit -create ''output_folder input_folder''/TRBS''name''.xml


 
'''Example from TRBSkonoko_body_high.xml''' (extracted with OniSplit v0.9.68.0):
'''example'''
 
TRBSkonoko_body_high.xml (extracted with onisplit v0.9.68.0)
  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
  <Oni>
  <Oni>
Line 37: Line 53:
  </Oni>
  </Oni>


==Creation (old method)==
This creates a TRBS file where all LODs use the same model; that's not good for memory usage or performance, but useful enough for testing a character in-game.
onisplit -create:trbs output_folder [-cel] [-normals] input_folder/TRBSname.dae


===custom TRIA===
(The arguments [[Importing_character_models#Cel-shading|"cel"]] and "normals" are optional.)
Onisplit creates the [[TRIA#Investigation|TRIA]] instance on its own.
 
When extracting a TRBS with onisplit v0.9.41.0 the TRIA instance gets exposed. Then it can be modified by hand to change the hierarchy of body parts.
 
In the [[#example|table]] you can see examples of TRIA instances: one from Konoko and one from a more or less hypothetical hex-hound.


: Onisplit v0.9.58.0 and lower needs a dae file where the body part names are strictly correct but the order doesn't matter. The result will be always a standard TRIA.
==Standard TRIA hierarchy==
: Onisplit v0.9.68.0 and higher(?) tolerates unusual body part names but it takes the order ''serious'' to build the hierarchy.
[[Image:XSI Konoko Ref.png]]
: In other words, when building a custom hierarchy with new onisplit versions you don't need any longer to edit the TRIA instance in xml.


Note that the head could be at a different location in the order. As result the head animation would be applied to a different body part.
==Custom TRIA hierarchy==
OniSplit creates the [[TRIA#Investigation|TRIA]] instance on its own. When extracting a TRBS with OniSplit v0.9.41.0, the TRIA instance is exposed. It can then be modified by hand to change the hierarchy of body parts.


Normally such overlay animation have "Head" as "<UsedBones>", if your new model's head isn't the 11th part you need to change it.
In the table below, you can see two examples of a TRIA: one from Konoko and one from a more or less hypothetical [[Oni2:Hex Hound|Hex Hound]].


A character with non-standard TRIA needs a complete set of new animations, those animations must be created based on that new TRIA.
: OniSplit v0.9.58.0 and below need a DAE file where the body part names are strictly correct but the order doesn't matter. The result will be always a standard TRIA.
: OniSplit v0.9.68.0 and higher(?) tolerate unusual body part names but take the order ''seriously'' when building the hierarchy.
: In other words, when building a custom hierarchy with new OniSplit versions you don't need any longer to edit the TRIA instance in XML.


Note that if the head was in a different location in the hierarchy, animations intended for the head would be applied to a different body part. Normally such overlay animation have "Head" as "<UsedBones>"; if your new model's head isn't the 11th part, you need to change it. A character with non-standard TRIA needs a completely set of new animations based on that new TRIA.


'''Changing the body part order'''
'''Changing the body part order'''
Line 60: Line 77:
Inside Mod Tool, the objects have an order which can be seen in the Schematics. The user can influence that order by using the Reorder Nodes Tool [I].
Inside Mod Tool, the objects have an order which can be seen in the Schematics. The user can influence that order by using the Reorder Nodes Tool [I].


Taking this into account it should be possible to let Mod Tool generate a TRMA file fitting to TRBS.
Taking this into account, it should be possible to let Mod Tool generate a TRMA file fitted to the TRBS.


 
'''Example'''
'''VBS code piece for TRMA creation'''
* The objects get listed one after another (TRMA-ready).
* The textures are listed for TRMA and TXMP creation.
* There's a texture size check to see if "-large" argument is necessary.
 
{| border=0 cellspacing=20 cellpadding=0 align=right
| hexhound hierarchy
 
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/hexhound_hierarchy_zpsf32e971c.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/hexhound_hierarchy_tn_zpsd82230ce.png]
|}
 
if selection.count > 0 then
' any part could be selected, let's find the root body part
SelectNeighborObj selection(0), 4
' get all members including the pelvis
set bodyparts = '''selection(0).FindChildren( , , siMeshFamily)'''
for each member in bodyparts
logmessage "object name: " & member.name
if not typename(member.Material.CurrentImageClip) = "Nothing" then
logmessage "texture: " & member.Material.CurrentImageClip.source.filename.value
'logmessage "material: " & member.Material.name
'logmessage "shader: " & member.Material.shaders(0).name
logmessage "X: " & member.Material.CurrentImageClip.source.Parameters("XRes").Value
logmessage "Y: " & member.Material.CurrentImageClip.source.Parameters("YRes").Value
end if
logmessage "----------------------------------------------------------"
next
logmessage "counted body parts: " & bodyparts.count
end if
' INFO  : object name: A
' INFO  : texture: C:\Users\RRM\Desktop\A.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: R
' INFO  : texture: C:\Users\RRM\Desktop\R.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: S
' INFO  : texture: C:\Users\RRM\Desktop\S.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: P
' INFO  : texture: C:\Users\RRM\Desktop\P.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: Q
' INFO  : texture: C:\Users\RRM\Desktop\Q.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: N
' INFO  : texture: C:\Users\RRM\Desktop\N.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: O
' INFO  : texture: C:\Users\RRM\Desktop\O.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: L
' INFO  : texture: C:\Users\RRM\Desktop\L.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: M
' INFO  : texture: C:\Users\RRM\Desktop\M.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: B
' INFO  : texture: C:\Users\RRM\Desktop\B.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: C
' INFO  : texture: C:\Users\RRM\Desktop\C.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: D
' INFO  : texture: C:\Users\RRM\Desktop\D.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: E
' INFO  : texture: C:\Users\RRM\Desktop\E.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: F
' INFO  : texture: C:\Users\RRM\Desktop\F.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: G
' INFO  : texture: C:\Users\RRM\Desktop\G.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: H
' INFO  : texture: C:\Users\RRM\Desktop\H.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: I
' INFO  : texture: C:\Users\RRM\Desktop\I.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: J
' INFO  : texture: C:\Users\RRM\Desktop\J.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : object name: K
' INFO  : texture: C:\Users\RRM\Desktop\K.tga
' INFO  : X: 512
' INFO  : Y: 512
' INFO  : ----------------------------------------------------------
' INFO  : counted body parts: 19
 
 
===example===
{| class="wikitable" width=100%
{| class="wikitable" width=100%
| '''standard TRIA'''
| '''Standard TRIA'''
| '''hexhound TRIA'''
| '''Hex Hound TRIA'''
|-
|-
|
|
Line 397: Line 285:
     </Instance>
     </Instance>
|}
|}
{{XML}}

Latest revision as of 15:40, 6 December 2023

TRBS : Totoro Body Set
XML modding tips
  • See HERE to start learning about XML modding.
  • See HERE if you are searching for information on how to handle object coordinates.
  • See HERE for some typical modding errors and their causes.
XML.png
XML

TRAS << Other file types >> TRGE

switch to OBD page

General information

  • TRBS files describe the overall structure of a character's 3D model. They are linked to from the ONCC character class file.
  • In vanilla Oni, TRBS files are stored locally in levelx_Final.dat according to which characters are needed for that level. In AE Oni, all TRBS files are stored in level0_Final.dat.
  • They contain 5 different models with differing levels of detail (known as LODs). A common game development technique for improving performance is to display a reduced polygon-count version of a character when they're farther from the camera.

File structure

  • TRBS
    • TRCM
    • TRCM
    • TRCM
    • TRCM
    • TRCM (same for all TRCM)
      • TRGA
        • M3GM
          • PNTA
          • VCRA
          • TXCA
          • IDXA
          • IDXA
          • (empty) texture link (because of TRMA usage)
      • TRTA
      • TRIA

Extraction (new method)

This is more powerful method because it extracts the full range of models (all 5 LODs).

onisplit -extract:xml output_folder input_folder/TRBSname.oni

Extraction (old method)

This older extraction approach lets you choose between extracting only the TRBS or the ONCC file with TRBS. Note that this only extracts the model with the highest poly count.

onisplit -extract:dae output_folder input_folder/TRBSname.oni
onisplit -extract:dae output_folder input_folder/ONCCname.oni

Creation (new method)

This creates a TRBS file with up to 5 different LODs:

onisplit -create output_folder input_folder/TRBSname.xml

Example from TRBSkonoko_body_high.xml (extracted with OniSplit v0.9.68.0):

<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <TRBS id="0">
       <Elements>
           <Link>TRBSkonoko_body_high_TRCM1.dae</Link> <!-- 300 triangles -->
           <Link>TRBSkonoko_body_high_TRCM2.dae</Link> <!-- 842 triangles -->
           <Link>TRBSkonoko_body_high_TRCM3.dae</Link> <!-- 1250 triangles -->
           <Link>TRBSkonoko_body_high_TRCM4.dae</Link> <!-- 2038 triangles -->
           <Link>TRBSkonoko_body_high_TRCM5.dae</Link> <!-- 3294 triangles -->
       </Elements>
   </TRBS>
</Oni>

Creation (old method)

This creates a TRBS file where all LODs use the same model; that's not good for memory usage or performance, but useful enough for testing a character in-game.

onisplit -create:trbs output_folder [-cel] [-normals] input_folder/TRBSname.dae

(The arguments "cel" and "normals" are optional.)

Standard TRIA hierarchy

XSI Konoko Ref.png

Custom TRIA hierarchy

OniSplit creates the TRIA instance on its own. When extracting a TRBS with OniSplit v0.9.41.0, the TRIA instance is exposed. It can then be modified by hand to change the hierarchy of body parts.

In the table below, you can see two examples of a TRIA: one from Konoko and one from a more or less hypothetical Hex Hound.

OniSplit v0.9.58.0 and below need a DAE file where the body part names are strictly correct but the order doesn't matter. The result will be always a standard TRIA.
OniSplit v0.9.68.0 and higher(?) tolerate unusual body part names but take the order seriously when building the hierarchy.
In other words, when building a custom hierarchy with new OniSplit versions you don't need any longer to edit the TRIA instance in XML.

Note that if the head was in a different location in the hierarchy, animations intended for the head would be applied to a different body part. Normally such overlay animation have "Head" as "<UsedBones>"; if your new model's head isn't the 11th part, you need to change it. A character with non-standard TRIA needs a completely set of new animations based on that new TRIA.

Changing the body part order

Inside Mod Tool, the objects have an order which can be seen in the Schematics. The user can influence that order by using the Reorder Nodes Tool [I].

Taking this into account, it should be possible to let Mod Tool generate a TRMA file fitted to the TRBS.

Example

Standard TRIA Hex Hound TRIA
   <Instance id="8" type="TRIA">
       <Elements>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>1</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>2</Child>
               <Sibling>4</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>1</Parent>
               <Child>3</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>2</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>5</Child>
               <Sibling>7</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>4</Parent>
               <Child>6</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>5</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>8</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>7</Parent>
               <Child>9</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>8</Parent>
               <Child>10</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>0</Child>
               <Sibling>11</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>12</Child>
               <Sibling>15</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>11</Parent>
               <Child>13</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>12</Parent>
               <Child>14</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>13</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>16</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>15</Parent>
               <Child>17</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>16</Parent>
               <Child>18</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>17</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
       </Elements>
   </Instance>
   <Instance id="4" type="TRIA">
       <Elements>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>1</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>2</Child>
               <Sibling>3</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>1</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>4</Child>
               <Sibling>5</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>3</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>6</Child>
               <Sibling>7</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>5</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>8</Child>
               <Sibling>9</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>7</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>0</Parent>
               <Child>10</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>9</Parent>
               <Child>11</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>10</Parent>
               <Child>12</Child>
               <Sibling>13</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>11</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>10</Parent>
               <Child>14</Child>
               <Sibling>16</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>13</Parent>
               <Child>15</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>14</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>10</Parent>
               <Child>17</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>16</Parent>
               <Child>18</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
           <TRIAElement>
               <Parent>17</Parent>
               <Child>0</Child>
               <Sibling>0</Sibling>
           </TRIAElement>
       </Elements>
   </Instance>