Importing character models: Difference between revisions

m
some initial copy-editing
m (fix links to moved images)
m (some initial copy-editing)
Line 1: Line 1:
This article covers the importing of new character models into Oni, but also how to export models from Oni. Generally speaking, you are going to want to use [[wikipedia:COLLADA|COLLADA]] as the "passthrough" format between your 3D program and Oni, as this is exactly what COLLADA was designed for. In this article, COLLADA is referred to as "Collada" (because who enjoys being shouted at?), or by ".dae file" (because that is the file suffix for COLLADA).
This article covers the importing of new character models into Oni, but also how to export models from Oni. Generally speaking, you are going to want to use [[wp:COLLADA|COLLADA]] as the "passthrough" format between your 3D program and Oni. In this article, COLLADA is referred to as "Collada" (because who enjoys being shouted at?), or as a ".dae file" (the file suffix for COLLADA).


==Modding tools==
==Modding tools==
===OniSplit===
===OniSplit===
This is the program that we use to get models into and out of Oni. It is a command line tool. There are GUI wrappers for OniSplit that cover most of its functions (see [[Vago (tool)]], but modders sometimes have to call it from the command line (or use the direct command line input feature in a GUI) to take full advantage of OniSplit's abilities.
This is the program that we use to get models into and out of Oni. It is a command line tool. There is a GUI wrapper for OniSplit that covers most of its functions called [[Vago (tool)|Vago]], but modders sometimes have to call OniSplit from the command line or use Vago's command-line input feature to take full advantage of its abilities.


===3D programs===
===3D programs===
====Blender====
====Blender====
[[Blender]] is the community's current 3D software of choice, allowing for 3D modeling, animating, and more.
[[Blender]] is the community's current software of choice for 3D modeling, animating, and more.


Blender rocks when it comes to [[Lightmapping levels|lightmapping levels]]. XSI is closed source and can only lightmap one mesh at a time with one lightmap texture per mesh. Blender is more flexible because of its free-for-all scripting API, and a nice touch is that it supports radiosity, i.e., emissive materials -- and that's exactly how Oni's lighting was done initially (see [[OBLS]]).
Blender rocks when it comes to [[Lightmapping levels|lightmapping levels]]. XSI is closed-source and can only lightmap one mesh at a time with one lightmap texture per mesh. Blender is more flexible because of its scripting API, and it supports radiosity, i.e., emissive materials – which is exactly how Oni's lighting was done initially (see [[OBLS]]).


====XSI====
====XSI====
Softimage XSI is a Windows-only 3D software that went discontinued in 2014, and [https://www.moddb.com/downloads/autodesk-softimage-mod-tool-75 a free version of it from 2008] used to to be the community's modding tool of choice before moving on to Blender. A number of Oni-related addons, tools and tutorials were developed for it can be still found and used. It has detailed documentation and is versatile, whether working with characters or levels, though highly obsolete.
Softimage XSI is Windows-only 3D software that was discontinued in 2014; [https://www.moddb.com/downloads/autodesk-softimage-mod-tool-75 a free version of it from 2008] used to to be the community's modding tool of choice before moving to Blender. A number of Oni-related add-ons, tools and tutorials were developed for it can be still found and used. It has detailed documentation and is versatile, whether working with characters or levels, though highly obsolete.
 


===File converters===
===File converters===
Line 23: Line 22:
OniSplit allows you to export .dae files from both [[TRBS]] and [[ONCC]]. Though all the 3D data is in the TRBS, the textures are listed in the [[TRMA]] file, which is only visible from the ONCC, not the TRBS. Thus, if you want to use the textures while editing the model, convert the ONCC, not the TRBS, into Collada. The instructions below assume that you want the textured model, and thus illustrate how to export the ONCC.
OniSplit allows you to export .dae files from both [[TRBS]] and [[ONCC]]. Though all the 3D data is in the TRBS, the textures are listed in the [[TRMA]] file, which is only visible from the ONCC, not the TRBS. Thus, if you want to use the textures while editing the model, convert the ONCC, not the TRBS, into Collada. The instructions below assume that you want the textured model, and thus illustrate how to export the ONCC.


First, you need to find the class name for the character you want to export. You can accomplish this by going into Oni, loading the level in which the desired character appears, and then enabling the shapeshifter cheat -- but you have to do this by turning on [[Developer Mode]], not by entering the "shapeshifter" cheat code, because the regular cheat code does not display the console output that you need. Once Dev Mode is on, press F8 until you reach the desired character. You should see the message "character class ''number'' '''''string'''''". The number is unimportant, but write down the string, because that is the class name which provides the basis for the names of the ONCC and TRBS.
First, you need to find the class name for the character you want to export. You can accomplish this by going into Oni, loading the level in which the desired character appears, and then enabling the shapeshifter cheat but you have to do this by turning on [[Developer Mode]], not by entering the "shapeshifter" cheat code, because the regular cheat code does not display the console output that you need. Once Dev Mode is on, press F8 until you reach the desired character. You should see the message "character class ''number'' '''''string'''''". The number is unimportant, but write down the string, because that is the class name which provides the basis for the names of the ONCC and TRBS.


In this example, we'll export one of Konoko's models. For Konoko, we don't even need to open Oni to find the name of an ONCC because we have [[Konoko#In-game_outfits|this handy table]]. Let's use Konoko in her police uniform; you can see from the table that this is ONCCk3 and that it's found in level2_Final.
In this example, we'll export one of Konoko's models. For Konoko, we don't even need to open Oni to find the name of an ONCC because we have [[Konoko#In-game outfits|this handy table]]. Let's use Konoko in her police uniform; you can see from the table that this is ONCCk3 and that it's found in level2_Final.


Next, you need to decide on the pose in which your character will be exported. See the "Poses" section below for guidance. Without making this example more complicated, we only have two choices for pose: default (folded) and -noanim (standing at attention); we are going to use the second option, for a more visually pleasing result. Here are the steps for getting your desired character in .dae format. Substitute backward slashes for forward ones if you are in Windows.
Next, you need to decide on the pose in which your character will be exported. See the "Poses" section below for guidance. Without making this example more complicated, we only have two choices for pose: default (folded) and -noanim (standing at attention); we are going to use the second option, for a more visually pleasing result. Here are the steps for getting your desired character in .dae format. Substitute backward slashes for forward ones if you are in Windows.
Line 59: Line 58:
:# TRBSnewchar_high.dae
:# TRBSnewchar_high.dae


An ONCC contains much more information than just links to TRBS and TRMA, and thus can not be generated automatically. See [[XML:ONCC]] on how to create such a file, and then import the character with this class data into Oni. The easiest way to try out an imported character in Oni is to name your imported TRBS so that it replaces an existing one and no ONCC editing is needed. The next step up is to clone an existing ONCC (in XML) and modify it to link to your new TRBS file(s).
An ONCC contains much more information than just links to TRBS and TRMA, and thus cannot be generated automatically. See [[XML:ONCC]] on how to create such a file, and then import the character with this class data into Oni. The easiest way to try out an imported character in Oni is to name your imported TRBS so that it replaces an existing one and no ONCC editing is needed. The next step up is to clone an existing ONCC (in XML) and modify it to link to your new TRBS file(s).


==Blender-specific OniSplit information==
==Blender-specific OniSplit information==
This section contains OniSplit commands specific to Blender, and related settings in Blender necessary for assets to work.
===Blender settings for importing and exporting COLLADA files===
===Blender settings for importing and exporting COLLADA files===
====Importing====
====Importing====
Line 77: Line 74:
|-
|-
|}
|}
====Exporting====
====Exporting====
When exporting TRBS, be sure to delete the default light and camera from the scene, or you can select all 19 body parts, then in the Export Main Tab, select Selection Only.
When exporting TRBS, be sure to delete the default light and camera from the scene, or you can select all 19 body parts, then in the Export Main Tab, select Selection Only.
Line 89: Line 87:
|-
|-
|}
|}


===Blender-specific OniSplit commands===
===Blender-specific OniSplit commands===
Line 106: Line 103:
  -extract:'''xml''' To_blender -anim-body:Original\TRBSkonoko_body_high.oni -blender Original\TRAMKONCOMkick_heavy.oni  
  -extract:'''xml''' To_blender -anim-body:Original\TRBSkonoko_body_high.oni -blender Original\TRAMKONCOMkick_heavy.oni  


This will create a TRAM.dae along with an .xml file, which is needed for importing back to Oni. You will be also able to tell that everything went okay when you see
This will create a TRAM.dae along with an .xml file, which is needed for importing back to Oni. You will be also able to tell that everything went okay when you see <mark><tt>AnimationDaeWriter: custom axis conversion</tt></mark> in the output. If you don’t, you’re most likely doing something wrong.
<mark><tt>AnimationDaeWriter: custom axis conversion</tt></mark>
on output. If you don’t, you’re most likely doing something wrong.




Line 120: Line 115:


===Troubleshooting===
===Troubleshooting===
Known Issues between Blender 2.83 and OniSplit 0.9.99.2:
Known Issues between Blender 2.83 and OniSplit 0.9.99.2:


Line 137: Line 131:
                   |          |  x  ^
                   |          |  x  ^
  18-o-17-o-16-o-15-o 6-o-5-o-4-o      ^
  18-o-17-o-16-o-15-o 6-o-5-o-4-o      ^
This is a conventional reference used in all of Oni. For any animation of any character in Oni, the rotations of the body parts are calculated with respect to a default pose such as this one. This allows the characters to share animations, even if their "skeletons" ([[TRTA]]) have slightly different proportions.
This is a convention used in all of Oni. For any animation of any character in Oni, the rotations of the body parts are calculated with respect to a default pose such as this one. This allows the characters to share animations, even if their "skeletons" ([[TRTA]]) have slightly different proportions.


In the default pose, the XYZ axes of all the bones are oriented the same way. Thus, in the default pose, you can see the "true" translations (offsets) of every body part with respect to its parent, as stored in the "translation array" (TRTA). For example, in Konoko's case, the "mid" section (part 7), is translated by 1.67 WU along X (i.e., 16.7 cm towards the top of the spine), and by 0.25 along Y (i.e., 2.5 cm towards the front of the spine). Remember that this translation is ''in the "local" frame of reference of the pelvis'', i.e., with respect to the ''origin'' of the pelvis ''and'' to its local XYZ axes (which are generally different from the world axes). Basically, the local X of the pelvis always points up the spine, the local Y points forward, the local Z points left, and the same goes for "mid", "chest", "neck", and "head".
In the default pose, the XYZ axes of all the bones are oriented the same way. Thus, in the default pose, you can see the "true" translations (offsets) of every body part with respect to its parent, as stored in the "translation array" (TRTA). For example, in Konoko's case, the "mid" section (part 7), is translated by 1.67 WU along X (i.e., 16.7 cm towards the top of the spine), and by 0.25 along Y (i.e., 2.5 cm towards the front of the spine). Remember that this translation is ''in the "local" frame of reference of the pelvis'', i.e., with respect to the ''origin'' of the pelvis ''and'' to its local XYZ axes (which are generally different from the world axes). Basically, the local X of the pelvis always points up the spine, the local Y points forward, the local Z points left, and the same goes for "mid", "chest", "neck", and "head".