OniSplit: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (→‎Download links: version bump)
(moving change log to talk page since it is not being updated and just takes up space here)
Line 115: Line 115:


BIG NOTE OF WARNING: some of the above instance types (most importantly ONWC) contain geometry data (M3GM) embedded in them. The geometry can round-trip through xml but versions of OniSplit up to and including 0.9.26 produce an invalid .oni file that may cause Oni to crash.
BIG NOTE OF WARNING: some of the above instance types (most importantly ONWC) contain geometry data (M3GM) embedded in them. The geometry can round-trip through xml but versions of OniSplit up to and including 0.9.26 produce an invalid .oni file that may cause Oni to crash.
==Change Log==
OniSplit version: OniSplit v0.9.52
What's new:
:* When a TRBS file is exported to xml the geometry is exported to separate .dae files, one .dae file for each LOD
:* New -anim-body option. This allows a particular body (ONCC or TRBS) to be specified when exporting animations:
  onisplit -extract:xml out -anim-body:ONCCbarabus.oni TRAMsomething.oni
:* New -recurse option for the xml exporter. Have fun :)
  onisplit -extract:xml out -recurse ONCCbarabus.oni
:* Changed light color in the environment importer to white (it used to be blueish)
:* New -env-notxmp option. This prevents the automatic creation of TXMP files while importing the environment.
:* Made -normals work when importing TRBS from xml + dae files.
:* Fixed the Collada importer to work with 3DSMax exported files
OniSplit version: OniSplit v0.9.40
What's new:
:* support for exporting/importing [[OBD:BINA/SABD|sound animations]] to/from xml files
:* better Collada export for environment
:* support for full color transparent textures (-format:bgra32 on the command line, ARGB8888 format in an xml file)
:* different (hopefully better) xml export format for animations (this one is actually from 0.9.38 but since that wasn't mentioned here...)
:* a more or less complete animation importer. This one deservers some notes:
::-unlike other importers that produce .oni files this one produces and .xml file (similar to the one you get when exporting a TRAM)
::when you do
  onisplit -create:tram target_dir animation.dae
::in the target dir you'll get a TRAManimation.xml file.
::You need to add some stuff to that file to make it actually work as an animation. In particular the animation type, from/to states and varient needs to be set.
::-For all I know this works with animations exported from Oni and modified in Softimage. If you come up with a completly new animation it should work as long as the skeleton is similar to the one used in Oni.
::-Note that the geometry that is present inside the Collada file is used to compute the "vertical extents" so it better be the same or close to the one the animation is intended for.
::-The biggest problem are the attacks. While it's not difficult to add attacks to the xml file, computing the necessary "extents" is not going to be easy. I guess in the end I'll have to add some command to OniSplit to do it.
::-Everything else that I forgot :)
[[User:Neo|Neo]]
New OniSplit version: [http://cid-639aa31296681bfe.skydrive.live.com/self.aspx/Oni/OniSplit/OniSplit|_v0.9.37.zip OniSplit v0.9.37]
What's new:
:* support for transparency in the environment importer
New OniSplit version: OniSplit v0.9.35
What's new:
:* conversion of recorded films (.dat binary files) to xml files that can be used to create FILM .oni files
    OniSplit film2xml out_dir film.dat
New OniSplit version: OniSplit v0.9.34
What's new:
:* SNDD importer
::-WAV files (.wav, mono/stereo, 22.05KHz/44.1KHz, uncompressed(PCM)/compressed(MS-ADPCM)) produce SNDD files that are compatible with Oni PC retail.
::-AIFC files (.aif/.aifc/.afc, mono/stereo 22.05KHz, compressed(ima4)) produce SNDD files that are compatible with Oni Mac.
::Example
 
  OniSplit -create out_dir test.aif
  OniSplit -create out_dir test.wav
:*LOD support for creating TRBS files. This can be done by creating an xml file containing the following:
  <?xml version="1.0" encoding="utf-8"?>
  <Oni Version="0.9.29.0">
      <Instance id="0" type="TRBS">
          <Elements>
              <Link>barabus_body_1.dae</Link>
              <Link>barabus_body_2.dae</Link>
              <Link>barabus_body_3.dae</Link>
              <Link>barabus_body_4.dae</Link>
              <Link>barabus_body_5.dae</Link>
          </Elements>
      </Instance>
  </Oni>
::and running the command (assuming the created xml file's name is barabus_body.xml):
  OniSplit -create out_dir barabus_body.xml
::It's not strictly necessary to create 5 different geometries for each LOD. The following works just as well:
  <?xml version="1.0" encoding="utf-8"?>
  <Oni Version="0.9.29.0">
      <Instance id="0" type="TRBS">
          <Elements>
              <Link>barabus_body_1.dae</Link>
              <Link>barabus_body_2.dae</Link>
              <Link>barabus_body_2.dae</Link>
              <Link>barabus_body_2.dae</Link>
              <Link>barabus_body_3.dae</Link>
          </Elements>
      </Instance>
  </Oni>
:*An xml file can contain "links" to other xml/obj/dae files. For example you can have the following line in an ONWC xml file:
  <Geometry>pistol.obj</Geometry>
::Assuming the file pistol.obj exists in the same directory an M3GM .oni file will be automatically created from it.
::Relative paths work just as well:
  <Geometry>geometry/pistol.obj</Geometry>
:*The -create:subt, -create:txmp and -create:m3gm are sort of obsolete. They still work but now you can simply use '-create' (or just 'create'):
  OniSplit -create out_dir crate.dae
  OniSplit create out_dir -format:bgr555 -genmipmaps pic.tga
  OniSplit create out_dir subtitles.txt
:*Work in progress: the AKEV importer now reads Collada materials so the resulting AKEV is textured.
:Sample levels:
:[http://cid-639aa31296681bfe.skydrive.live.com/self.aspx/Oni/noglass.zip TestLevel1] -- This level should look like this in-game: <u>[[:Image:NoGlass Import Test 1.jpg|Image 1]]</u> <u>[[:Image:NoGlass Import Test 2.jpg|Image 2]]</u> <u>[[:Image:NoGlass Import Test 3.jpg|Image 3]]</u>
:[http://cid-639aa31296681bfe.skydrive.live.com/self.aspx/Oni/hexagon.zip TestLevel2] -- This level should look like this in-game: <u>[http://edt.oni2.net/images/hexagon1.jpg Image 1]</u>
:A zip file contains the minimum needed to get a new level running in Oni. To "compile" a level extract it to a folder and run the following commands:
  OniSplit -create out -genmipmaps -format:dxt1 *.xml
  OniSplit -import:nosep . Oni\GameDataFolder\level1_Final.dat
:(Of course, you need to change the output .dat file path to match your Oni installation path)
:Note1: The hexagon level needs to be scaled up to work properly. Use the envscale option for this:
  OniSplit -create out -genmipmaps -format:dxt1 -envscale:40 *.xml
:Note2: I've updated the level files to contain 20 empty corpses to prevent crashes.


[[Category:Completed modding tools]][[Category:Bi-platform modding tools]]
[[Category:Completed modding tools]][[Category:Bi-platform modding tools]]

Revision as of 17:54, 4 April 2013

OniSplit, written by Neo, is an integral part of the Anniversary Edition and an essential modding tool on its own. It is able to import and export many kinds of Oni game data, such as textures, sound, 3D models, level geometry & combat animations and is also able to split & recombine Oni's data files. It's functions supersede those of OUP & OME and is currently the community's modding tool of choice.

Getting it

Download links

  • Latest (released) version of OniSplit: v0.9.82.0
  • A GUI for OniSplit for Windows can be found HERE and more recently HERE.
  • A GUI for OniSplit for the Mac is found HERE.

Requirements

OniSplit requires .NET 2.0 for Windows and the Mono framework for Mac OS X.



Using it

The following actions are listed when calling OniSplit with the -help option (another informative option is -version)

The command line must be preceded by either OniSplit.exe (Windows) or mono OniSplit.exe (Mac OS)
If OniSplit.exe is not in the current folder, you can provide the full/relative path to it or set the path variable.
On the Mac, be sure to use / rather than \ in paths. The following instructions are for Windows by default.

Conversion between .dat and .oni

-export <target directory> <source file> Exports source file (.dat) to target directory
-export:pattern <target directory> <source file> Exports named resource (wildcards also allowed) from source file (.dat) to target directory
-import <source directory> <target file> Imports target file (.dat) from source directory; tries to get target file format from source SNDD
-import:sep <source directory> <target file> Imports target file (.dat) from source directory; uses .dat+.raw+.sep format (Mac and PC Demo)
-import:nosep <source directory> <target file> Imports target file (.dat) from source directory; uses .dat+.raw format (PC retail)
Note that -import will search subdirectories too. If you find having hundreds or thousand of files .oni in one directory to be unmanageable you can always group them in subdirectories anyway you like. The only exception is that a subdirectory named "noimport" or "_noimport" is always ignored.

Management of .oni files

Unless mentioned otherwise, the filename field supports wildcards ("*").

OniSplit consistently detects and manages "dependencies" of .oni files.
The dependencies of a file are looked up in its folder and subfolders.
-deps <filenames> Displays a list of .oni files that the specified .oni file depends on
-copy <target directory> <filenames> Copies .oni file and its dependencies to target; skips file if it already exists at destination
-move <target directory> <filenames> Moves an .oni file and its dependencies to target; skips file if it already exists at destination
-move:overwrite <target directory> <filenames> Moves an .oni file and its dependencies to target; overwrites any existing .oni files
-move:delete <target directory> <filenames> Moves an .oni file and its dependencies to target; doesn't overwrite; deletes source files

Conversion between .oni/.dat and 3rd party formats

Textures

Unless mentioned otherwise, source filenames support wildcards. See HERE for a detailed tutorial.

-extract:dds <target directory> <filenames> Extracts all textures (TXMP) from a Oni .dat/.oni file in DDS format
-extract:tga <target directory> <filenames> Extracts all textures (TXMP) from a Oni .dat/.oni file in TGA format
-extract:png <target directory> <filenames> Extracts all textures (TXMP) from a Oni .dat/.oni file in PNG format
-create:txmp <targer directory> [-genmipmaps] [-nouwrap] [-novwrap]
[-format:bgr32|bgra32|bgr555|bgra5551|bgra4444|dxt1]
[-envmap:texture_name] <filename>
Creates .oni file in target directory from source image

The -extract commands can work with .oni files (a single file or several files, wildcards possible) or rip all the TXMPs from a .dat file.

Models

M3GMs, ONWCs, ONCCs can be exported to the Wavefront .obj and COLLADA .dae formats. For details see HERE and HERE

-extract:obj <target directory> <filenames> Extracts all M3GM, ONWC and ONCC instances to Wavefront OBJ files
-extract:dae <target directory> <filenames> Extracts all M3GM, ONWC and ONCC instances to Collada files
-create:m3gm <target directory> [-tex:texture_name] <filename> Creates a M3GM .oni in target directory from an .obj file
-create:trbs <target directory> [-cel] [-normals] <filename> Creates a TRBS .oni in target directory from a .dae file

The generic -extract commands can work with .oni files (a single file or several files, wildcards possible) or rip all the TXMP from a .dat file.

TRBS and ONCC support additional -noanim and -anim options for -extract:dae, see HERE for details.
Imported geometry must only contain triangles. See HERE for additional options (e.g., cel-shading)

Levels

OniSplit can convert AKEV files (level geometry) and the associated file types to and from DAE format:

-extract:dae <target directory> <name of AKEV.oni source file> Extracts all AKEV and related instances to Collada files

The next two steps are used on a folder in which you have placed the DAE and XML-formatted instances of the required files, as well as textures in TGA format.

-create <target directory> -genmipmaps -format:dxt1 <source directory/>*.xml Converts all AKEV and related instances to .oni files

-import:nosep <source directory> <target file name>.dat The standard command for creating .dat/.raw files from .oni files (remember to use the import:sep option on Mac!)

Misc

Some more import/export functions, e.g., to rip sounds or rip/replace subtitles.

-extract:wav <target directory> <filenames> Rips all SNDD as .wav into target folder from source .dat or .oni
-extract:aif <target directory> <filenames> Rips all SNDD as .aif into target folder from source .dat or .oni
-extract:txt <target directory> <filenames> Rips all SUBT as .txt into target folder from source .dat or .oni
-create:subt <target directory> <filename> Creates a SUBT .oni file in target folder from a .txt file
XML

One of the latest features is conversion of an .oni file (binary) into an XML metafile and back. XML files are more explicit and more readily editable.

Currently xml export/import is limited to files that do not have raw/sep parts. 2-way conversion is known to work for BINA, CONS, DOOR, DPge, FILM, HPge, IGHH, IPge, M3GM, OBAN, ONCC, ONCV, ONLD, ONLV, ONGS, ONSK, ONVL, ONWC, OPge, OSBD, PSpc, PSpL, PSUI, TRAC, TRAM, TRIG, TRGE, TRMA, TRSC, TXMB, TXMP, WMCL, WMDD, WMM_, WPge.
For detailed examples and tutorials, see HERE
-extract:xml <target directory> <filenames> Extracts all instances to XML files
-create <target directory> <filename> Creates an .oni file in the target directory from an XML file

BIG NOTE OF WARNING: some of the above instance types (most importantly ONWC) contain geometry data (M3GM) embedded in them. The geometry can round-trip through xml but versions of OniSplit up to and including 0.9.26 produce an invalid .oni file that may cause Oni to crash.