Talk:Importing character models

From OniGalore
Jump to navigation Jump to search


For TRBS files

To export an ONCC or TRBS file to Collada format:

  onisplit -extract:dae dest_dir ..\GameDataFolder\level0_Final\ONCCkonoko_generic.oni

This will produce an ONCCkonoko_generic.dae collada file in the directory dest_dir plus the tga texture files used by the specified character.

Note: Blender's Collada importer/exporter is buggy, so you will need to add the options -noanim and -zup when extracting collada files for use with Blender:

  onisplit -extract:dae dest_dir -noanim -zup ..\GameDataFolder\level0_Final\ONCCkonoko_generic.oni

-noanim prevents the export of the default idle animation. That's needed because Blender doesn't import animated objects correctly. -zup exports a collada file with a coordinate system where Z axis points up instead of the default (Y up). This is needed because Blender uses Z up but the importer gets it wrong and convert to something else.

To create a TRBS file, use the following command:

  onisplit -create:trbs ..\GameDataFolder\level0_Final ONCCkonoko_generic.dae

This will create the TRBSkonoko_generic.oni file in dest_dir.

Options include

  -normals autogenerate normals.
  -cel generate a shell to give the effect of cel shading.


  onisplit -create:trbs ..\GameDataFolder\level0_Final -normals ONCCkonoko_generic.dae

For more detailed information about importing characters, please this page: Importing character models

So, uh, you can't add a TRBS that you want to test into a folder other than level0_Final, right? I thought I could save time by not having to recompile level0_Final, so I added a TRBS for Griffin that I was testing to level12_Final ("Rooftops"), and it didn't work. The same TRBS worked in level0_Final, so I know it's not the file's fault. I guess only level0_Final loads characters, not the individual levels? This is also true for ONCCs? What about making a plugin with that TRBS.oni file and naming it "level12_griffin"? --Iritscen 19:38, 3 June 2008 (CEST)

The same TRBS worked in level0_Final, so I know it's not the file's fault. It's never the file's fault. There are only program bugs and user errors. In your case there seems to be more of the latter, even though it's hard to tell because "it didn't work" is as uninformative as reports get.
I guess only level0_Final loads characters, not the individual levels? This is also true for ONCCs? Aren't you tired of guessing wrong? There is no such limitation, never was. The example up there is Edition-oriented, that's all. Don't guess, just say what you did exactly, why doncha?
I guess only level0_Final loads characters, not the individual levels? This is also true for ONCCs? Really, dude... The original Oni has no ONCC in level 0, that's why you could shapeshift to most characters in only a few levels. And what the frack do you mean by "characters"? TRBS?
geyser 20:55, 5 June 2008 (CEST)

This may seem hard at first, but once you learn it, it will make life easier for you.

  1. Get 0xED
  2. Make a duplicate of ONCCgriffin_generic.oni and rename ONCCgriffin_generi1.oni, now open it with 0xED. Scroll to the end of the file. Look for the text TRBSgriffin_body_high, change it to TRBSgriffin_body_hig1 (Make sure that 0xED is in Overwrite mode: Edit - Write Mode - Overwrite). Save.
  3. Rename the TRBS you created to TRBSgriffin_body_hig1.oni
  4. Put both these files in the Level1_Final folder.
  5. In the Level1_Final folder look for the file BINACJBOCharacter.oni. Open it with a search for griffin. You should get the text griffin_generic, you will need to change that to griffin_generi1. Save.
  6. Rebuild Level1
  7. Now modify a script to spawn griffin in Level1

That's it, now whenever you make changes to griffin, it will be quicker to rebuild level1 than level0. Further, since I added a number of character to BINACJBOCharacter.oni, you will have access to EvilKonoko, Shinatama, Muro, etc. So if you ever want to change them, you can follow the above process.

Now I made the changes to the file names very simple. The point of just changing one character in the name using the hex editor is to prevent the file from changing its size. (In the file itself, there is a number which tell Oni, the size of the file, so if you even add or delete one character, then it will cause a crash, since it is not the correct file size) But in the future, you can make the names more appropriate, by first exporting the ONCC as an .xml file then changing the names of the links to the TRBS, TRMA (textures), TRAC (animations), because OniSplit will calculate the correct file size.

Hope this helps,

EdT 21:43, 3 June 2008 (CEST)

I think it does help, thanks Ed. Do I understand this right? Is this going to replace the existing Griffin character with the one I added to level1_Final? But only for level 1, of course. --Iritscen 22:59, 3 June 2008 (CEST)
Ed's instructions don't technically replace the "existing Griffin character" (of course this depends on what exactly you mean by that). Since the new ONCC and TRBS are not named the same as the original ones, the new stuff and the old stuff will exist alongside each other and never interfere. This is also why Ed has to go to the trouble of modifying BINACJBOCharacter - because the new ONCC does not override the old one and has to be summoned by its own, different name.
Personally I think the most straightforward thing to do when testing the visual aspect of a new character is to just import a plugin with the ONCC and TRBS, shapeshift the player and use the manual camera. If you want to see the new Griffin controlled by AI, then make sure the name of the ONCC in the plugin is the same as the original and that the plugin is loaded before the level#_Final.dat where the original Griffin is. Take THIS one for example.
Then you only need to be careful about a few things. Like, if you want your ONCC to be a level0 plugin, then make sure you have globalized all the crucial dependencies of the ONCC (TRMA, TXMP, TRAC, TRAM, TRAS, TRSC). And of course, if you run into trouble, try to file a report so we can tell you where you messed up.
geyser 20:55, 5 June 2008 (CEST)
Oh, and Ed: you're saying confused/confusing and possilby wrong things up there about not messing up file sizes. The header of an .oni file doesn't actually know or care about the total file size. The only thing you should care about for an ONCC is the offsets of the names of the dependencies, at the end (one offset for every name). That's where you can't allow to make the name of the linked-to TRBS longer without shifting all the following dependencies of the ONCC and updating their name offsets consistently. As for the name of the ONCC itself, you can rename the file to anything at all, like ONCCgriffin_generic_fubar.oni : OniSplit will ignore the internal name of the root instance and use the filename instead. And as for the ONCC name in CHAR, it's a fixed-size array (char[64]), so virtually any new name will work, as long as you take care of the null char after the ONCC name.
geyser 21:57, 5 June 2008 (CEST)
Maybe I'm confused, but, if you look at offset 0x0030 in an ONCC or TRAC .oni file, I thought that offset pointed to the end of the file. For example ONCCkonoko_generic.oni has 8017 and that points to 0x1780, ONCCbarabus is A016 that points to 0x16A0. Also, that's what I documented at OBD_talk:TRAC and if that point was incorrect, I'm sure someone would have corrected it. So based on that information, I made the statement about not messing up the file size, while using a hex editor. Also, I knew about being able to rename the file to anything else, that's what I did with the files related to the Motoko character.
EdT 23:00, 5 June 2008 (CEST)

EdT, you uploaded this picture a while back; isn't it useful in this article (or somewhere?): Image:3D rotationpose.jpg --Iritscen 04:58, 5 October 2008 (CEST)

Its probably not useful anymore, since Onisplit can now export the character in an upright pose. EdT 03:57, 6 October 2008 (CEST)
Well, I will mark for deletion, then; if you change your mind, the image probably won't actually be gone anytime soon. --Iritscen 05:53, 6 October 2008 (CEST)

Rewriting of AE: Importing character models

  • Maybe use some stuff Samer wrote over there.
  • Let's see where we can use links instead of copying stuff that is already on this wiki.

exporting a character from Oni

step 1: installing needed tools

  • .NET Framework 2 or higher
  • Oni Anniversary Edition (AE)
  • Vago

step 2: choosing a pose

  • default orientation
  • -noanim pose
  • Idle pose
  • Any pose

step 3: doing the export

  • via command line
  • via onisplit GUI (Vago)

creating a character in Blender

creating a character in Mod Tool

step 1: 19 body parts

  • bring together new stuff or do some bastardizing
  • create overlaps
  • avoid discountinuties (blue lines)
  • triangulate the meshes

step 2: level of detail (LOD)

  • create 5 models differing in level of detail (basically the triangle number)

step 3: hierarchy

  • move and rotate center
  • remove keyframes
  • build hierarchy

step 4: UVs

  • [...]

step 5: textures

  • [...]

step 6: error check

  • [...]

importing a character to Oni

step 1: TRBS // character 3D model

  • cel-shading
  • [...]

step 2: TRMA // character texture collection

  • [...]

step 3: TXMPs // character textures

  • [...]

step 4: ONCC // character main file

  • [...]

step 5: BINACJBOCharacter // character spawn collection

  • [...]

step 6: AE package

  • [...]

additional changes

animation contrails: white and colored ones

impact effects

Daodan stuff