OniSplit: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (Added the -normals option)
(Update to 0.9.14 info)
Line 1: Line 1:
'''OniSplit''', written by Neo, is an integral part of the [[Anniversary Edition]] and an essential modding tool on its own. It does the work of splitting and recombining Oni's data files.  But it also does much more such as extracting and creating [[TXMP]] files and [[M3GM]] files.
'''OniSplit''', written by Neo, is an integral part of the [[Anniversary Edition]] and an essential modding tool on its own. It does the work of splitting and recombining Oni's data files.  But it also does much more, such as extracting and creating textures, 3D and .xml files.


===Export/Import textures===
===Export/Import textures===
To extract all the [[TXMP]] files:
To export a single TXMP
   onisplit -extract:png destination_directory_for_image_files level0_Final.dat
  onisplit -extract:png txmp_dir ..\GameDataFolder\level0_Final\TXMPBOSS1talking.oni
To export all the [[TXMP]] files:
   onisplit -extract:png txmp_dir ..\GameDataFolder\level0_Final.dat
TGA and DDS are also supported using -extract:tga and -extract:dds.
TGA and DDS are also supported using -extract:tga and -extract:dds.


To import image files:
To import image files:
   onisplit -create:txmp destination_directory [options] source_image_file
   onisplit -create:txmp ..\GameDataFolder\level0_Final [options] source_image_file
where options can be
where options can be
   -nouwrap - set the "U wrapping disabled" flag
   -nouwrap - set the "U wrapping disabled" flag
Line 17: Line 19:


Example:
Example:
   onisplit -create:txmp imported -format:bgr32 -genmipmaps tga\concrete.tga
   onisplit -create:txmp ..\GameDataFolder\level0_Final -format:bgr555 -genmipmaps tga\concrete.tga
To batch process a folder of image files:
To batch process a folder of image files:
   onisplit -create:txmp imported -format:bgr32 -genmipmaps tga\*.tga
   onisplit -create:txmp ..\GameDataFolder\level0_Final -format:bgr555 -genmipmaps tga\*.tga
source_image_file can be dds or tga. "Color indexed" and "black and white" tga files are not supported currently. Other image file formats (png, jpg, bmp, tif) may work depending on Mono/.NET support for them.
source_image_file can be dds or tga. "Color indexed" and "black and white" tga files are not supported currently. Other image file formats (png, jpg, bmp, tif) may work depending on Mono/.NET support for them.
onisplit will automatically prepend TXMP to the output file name if the source file name does not start with TXMP already.
onisplit will automatically prepend TXMP to the output file name if the source file name does not start with TXMP already.


For TXMP files that contain envmaps:
For TXMP files that contain envmaps:
   onisplit -create:txmp dest_dir -format:bgra4444 -genmipmaps -envmap:envmapname imagefile.tga
   onisplit -create:txmp ..\GameDataFolder\level0_Final -format:bgra4444 -genmipmaps -envmap:envmapname imagefile.tga
The envmap name can have the TXMP prefix but it is added automatically if missing.
The envmap name can have the TXMP prefix but it is added automatically if missing.


===Export/Import 3D models===
===Export/Import 3D models===
[[M3GM]]s, [[ONWC]]s, [[ONCC]]s and now [[TRBS]] can all be exported (in OBJ file format):
[[M3GM]]s, [[ONWC]]s, [[ONCC]]s can all be exported to the OBJ file format:
   onisplit -extract:obj dest_dir M3GMnotfound.oni
   onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final\M3GMnotfound.oni
   onisplit -extract:obj dest_dir ONWCw1_tap.oni
   onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final\ONWCw1_tap.oni
   onisplit -extract:obj dest_dir ONCCbarabus.oni
   onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final\ONCCbarabus.oni
Or for a total export:
Or for a total export:
   onisplit -extract:obj dest_dir level0_Final.dat
   onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final.dat
Importing obj files:
Importing obj files:
   onisplit -create:m3gm dest_dir TCTF_Shotgun.obj
   onisplit -create:m3gm ..\GameDataFolder\level0_Final TCTF_Shotgun.obj
For importing obj files the obj file must only contain triangles so when exporting a model from a 3D design tool it needs to be triangulated. If the obj file uses more than one texture then only one will be taken into consideration. If the obj file does not contain a texture or someone wants to use a different one then the texture name to be used can be specified with -tex option:
For importing obj files the obj file must only contain triangles so when exporting a model from a 3D design tool it needs to be triangulated. If the obj file uses more than one texture then only one will be taken into consideration. If the obj file does not contain a texture or someone wants to use a different one then the texture name to be used can be specified with -tex option:
   onisplit -create:m3gm dest_dir -tex:TCTF_Shotgun TCTF_Shotgun.obj
   onisplit -create:m3gm ..\GameDataFolder\level0_Final -tex:TCTF_Shotgun TCTF_Shotgun.obj
Just like in -envmap option case the texture name can start with TXMP but it is not required.
Just like in -envmap option case the texture name can start with TXMP but it is not required.
Note that in both -envmap and -tex cases a .oni file is not created for the specified texture. The .oni file for that texture must be create separately.
Note that in both -envmap and -tex cases a .oni file is not created for the specified texture. The .oni file for that texture must be create separately.
Line 43: Line 45:
'''For TRBS files'''
'''For TRBS files'''


To extract an ONCC file to Collada format:
To export an ONCC or TRBS file to Collada format:
   onisplit -extract:dae dest_dir level0_Final/ONCCkonoko_generic.oni
   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.
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:
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 level0_Final/ONCCkonoko_generic.oni
   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.
-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.
-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:  
To create a TRBS file, use the following command:  
   onisplit -create:trbs dest_dir some_dir\ONCCkonoko_generic.dae
   onisplit -create:trbs ..\GameDataFolder\level0_Final ONCCkonoko_generic.dae
This will create the TRBSkonoko_generic.oni file in dest_dir.   
This will create the TRBSkonoko_generic.oni file in dest_dir.   


You also have the options for OniSplit to autogenerate normals.
Options include
   onisplit -create:trbs dest_dir -normals some_dir\ONCCkonoko_generic.dae
  -normals autogenerate normals.
  -cel generate a shell to give the effect of cel shading.
 
Example
   onisplit -create:trbs ..\GameDataFolder\level0_Final -normals ONCCkonoko_generic.dae


For more detailed information about importing characters, please this page: [[AE:Importing character models]]
For more detailed information about importing characters, please this page: [[AE:Importing character models]]
===Export/Import xml===
Currently xml export/import is limited to files that do not have raw/sep parts.  Some files that currently work are [[ONCC]], [[TRAC]] and [[TRMA]]. The ability to modify these files in a text editor opens the door to easily changing character parameters, combat moves and textures without resorting to hex editing.
To export a file to .xml
  onisplit -extract:xml xml_dir ..\GameDataFolder\level0_Final\ONCCstriker_hard_3.oni
To import an .oni from .xml file
  onisplit -create ..\GameDataFolder\level0_Final ONCCstriker_hard_3.xml


===OniSplit commands===
===OniSplit commands===
A list of commands can be found be entering OniSplit -help
A list of commands can be found be entering OniSplit -help


-export <directory>            Export a Oni .dat file to directory.
-export <directory>            Export a Oni .dat file to directory
-import <directory>            Import a Oni .dat file from directory.
        -import <directory>            Import a Oni .dat file from directory
                                         Target file format is determined from source files (when possible)
                                         Target file format is determined from source files (when possible)
-import:sep <directory>        Import a Oni .dat file from directory.
        -import:sep <directory>        Import a Oni .dat file from directory
                                         Create a .dat file that uses .raw and .sep binary files (Mac and PC Demo)
                                         Create a .dat file that uses .raw and .sep binary files (Mac and PC Demo)
-import:nosep <directory>      Import a Oni .dat file from directory.
        -import:nosep <directory>      Import a Oni .dat file from directory
                                         Create a .dat file that uses only .raw binary file (PC)
                                         Create a .dat file that uses only .raw binary file (PC)
-extract:dds <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in DDS format.
 
-extract:tga <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in TGA format.
        -extract:dds <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in DDS format
-extract:png <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in PNG format.
        -extract:tga <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in TGA format
-extract:wav <directory>        Extracts all sounds (SNDD) from a Oni .dat/.oni file in WAV format.
        -extract:png <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in PNG format
-extract:aif <directory>        Extracts all sounds (SNDD) from a Oni .dat/.oni file in AIF format.
        -extract:wav <directory>        Extracts all sounds (SNDD) from a Oni .dat/.oni file in WAV format
-extract:txt <directory>        Extracts all subtitles (SUBT) from a Oni .dat/.oni file in TXT format.
        -extract:aif <directory>        Extracts all sounds (SNDD) from a Oni .dat/.oni file in AIF format
-create:txmp <directory> [-genmipmaps] [-nouwrap] [-novwrap] [-format:bgr32|bgra32|bgr555|bgra5551|bgra4444|dxt1] [-envmap:texture_name] image_file
        -extract:txt <directory>        Extracts all subtitles (SUBT) from a Oni .dat/.oni file in TXT format
-create:m3gm <directory> [-tex:texture_name] obj_file
        -extract:obj <directory>        Extracts all M3GM and ONCC instances to Wavefront OBJ files
-create:subt <directory> txt_file
        -extract:dae <directory>        Extracts all M3GM and ONCC instances to Collada files
-copy <directory>              Copy an exported .oni file and its dependencies to directory.
        -extract:xml <directory>        Extracts all instances to XML files
-move <directory>              Move an exported .oni file and its dependencies to directory.
 
-move:overwrite <directory>    Move an exported .oni file and its dependencies to directory.
        -create:txmp <directory> [-genmipmaps] [-nouwrap] [-novwrap] [-format:bgr32|bgra32|bgr555|bgra5551|bgra4444|dxt1] [-envmap:texture_name] image_file
        -create:m3gm <directory> [-tex:texture_name] obj_file
        -create:trbs <directory> dae_file
        -create:subt <directory> txt_file
        -create <directory> xml_file    Creates an .oni file from an XML file
 
        -copy <directory>              Copy an exported .oni file and its dependencies to directory
        -move <directory>              Move an exported .oni file and its dependencies to directory
        -move:overwrite <directory>    Move an exported .oni file and its dependencies to directory
                                         Overwrites any existing files
                                         Overwrites any existing files
-move:delete <directory>        Move an exported .oni file and its dependencies to directory.
        -move:delete <directory>        Move an exported .oni file and its dependencies to directory
                                         Deletes files at source when they already exist at destination.
                                         Deletes files at source when they already exist at destination
-deps                          Get a list of exported .oni files the specified files depends on.
        -deps                          Get a list of exported .oni files the specified files depends on
-version                        Print OniSplit versions
        -version                        Print OniSplit versions
 




Note: For Mac users the command is:
Note: For Mac users the command is:


   mono onisplit.exe
   mono onisplit.exe (Also change every \ to /)


===Download links===
===Download links===

Revision as of 21:52, 25 May 2008

OniSplit, written by Neo, is an integral part of the Anniversary Edition and an essential modding tool on its own. It does the work of splitting and recombining Oni's data files. But it also does much more, such as extracting and creating textures, 3D and .xml files.

Export/Import textures

To export a single TXMP

  onisplit -extract:png txmp_dir ..\GameDataFolder\level0_Final\TXMPBOSS1talking.oni

To export all the TXMP files:

  onisplit -extract:png txmp_dir ..\GameDataFolder\level0_Final.dat

TGA and DDS are also supported using -extract:tga and -extract:dds.

To import image files:

  onisplit -create:txmp ..\GameDataFolder\level0_Final [options] source_image_file

where options can be

 -nouwrap - set the "U wrapping disabled" flag
 -nowwrap - set the "V wrapping disabled" flag
 -format:bgr555 (or dxt1) for most of the stuff
 -format:bgr32 for skyboxes
 -format:bgra4444 for transparent/reflective stuff (in a couple of places bgra5551 is used but probably it's not big deal if bgra4444 is used instead)
 -genmipmaps - generate mipmaps if they are not already present in the source file and if the source file is not dxt1 compressed

Example:

  onisplit -create:txmp ..\GameDataFolder\level0_Final -format:bgr555 -genmipmaps tga\concrete.tga

To batch process a folder of image files:

  onisplit -create:txmp ..\GameDataFolder\level0_Final -format:bgr555 -genmipmaps tga\*.tga

source_image_file can be dds or tga. "Color indexed" and "black and white" tga files are not supported currently. Other image file formats (png, jpg, bmp, tif) may work depending on Mono/.NET support for them. onisplit will automatically prepend TXMP to the output file name if the source file name does not start with TXMP already.

For TXMP files that contain envmaps:

  onisplit -create:txmp ..\GameDataFolder\level0_Final -format:bgra4444 -genmipmaps -envmap:envmapname imagefile.tga

The envmap name can have the TXMP prefix but it is added automatically if missing.

Export/Import 3D models

M3GMs, ONWCs, ONCCs can all be exported to the OBJ file format:

  onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final\M3GMnotfound.oni
  onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final\ONWCw1_tap.oni
  onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final\ONCCbarabus.oni

Or for a total export:

  onisplit -extract:obj dest_dir ..\GameDataFolder\level0_Final.dat

Importing obj files:

  onisplit -create:m3gm ..\GameDataFolder\level0_Final TCTF_Shotgun.obj

For importing obj files the obj file must only contain triangles so when exporting a model from a 3D design tool it needs to be triangulated. If the obj file uses more than one texture then only one will be taken into consideration. If the obj file does not contain a texture or someone wants to use a different one then the texture name to be used can be specified with -tex option:

  onisplit -create:m3gm ..\GameDataFolder\level0_Final -tex:TCTF_Shotgun TCTF_Shotgun.obj

Just like in -envmap option case the texture name can start with TXMP but it is not required. Note that in both -envmap and -tex cases a .oni file is not created for the specified texture. The .oni file for that texture must be create separately.

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.

Example

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

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

Export/Import xml

Currently xml export/import is limited to files that do not have raw/sep parts. Some files that currently work are ONCC, TRAC and TRMA. The ability to modify these files in a text editor opens the door to easily changing character parameters, combat moves and textures without resorting to hex editing.

To export a file to .xml

  onisplit -extract:xml xml_dir ..\GameDataFolder\level0_Final\ONCCstriker_hard_3.oni

To import an .oni from .xml file

  onisplit -create ..\GameDataFolder\level0_Final ONCCstriker_hard_3.xml

OniSplit commands

A list of commands can be found be entering OniSplit -help

-export <directory> Export a Oni .dat file to directory

       -import <directory>             Import a Oni .dat file from directory
                                       Target file format is determined from source files (when possible)
       -import:sep <directory>         Import a Oni .dat file from directory
                                       Create a .dat file that uses .raw and .sep binary files (Mac and PC Demo)
       -import:nosep <directory>       Import a Oni .dat file from directory
                                       Create a .dat file that uses only .raw binary file (PC)
       -extract:dds <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in DDS format
       -extract:tga <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in TGA format
       -extract:png <directory>        Extracts all textures (TXMP) from a Oni .dat/.oni file in PNG format
       -extract:wav <directory>        Extracts all sounds (SNDD) from a Oni .dat/.oni file in WAV format
       -extract:aif <directory>        Extracts all sounds (SNDD) from a Oni .dat/.oni file in AIF format
       -extract:txt <directory>        Extracts all subtitles (SUBT) from a Oni .dat/.oni file in TXT format
       -extract:obj <directory>        Extracts all M3GM and ONCC instances to Wavefront OBJ files
       -extract:dae <directory>        Extracts all M3GM and ONCC instances to Collada files
       -extract:xml <directory>        Extracts all instances to XML files
       -create:txmp <directory> [-genmipmaps] [-nouwrap] [-novwrap] [-format:bgr32|bgra32|bgr555|bgra5551|bgra4444|dxt1] [-envmap:texture_name] image_file
       -create:m3gm <directory> [-tex:texture_name] obj_file
       -create:trbs <directory> dae_file
       -create:subt <directory> txt_file
       -create <directory> xml_file    Creates an .oni file from an XML file
       -copy <directory>               Copy an exported .oni file and its dependencies to directory
       -move <directory>               Move an exported .oni file and its dependencies to directory
       -move:overwrite <directory>     Move an exported .oni file and its dependencies to directory
                                       Overwrites any existing files
       -move:delete <directory>        Move an exported .oni file and its dependencies to directory
                                       Deletes files at source when they already exist at destination
       -deps                           Get a list of exported .oni files the specified files depends on
       -version                        Print OniSplit versions


Note: For Mac users the command is:

  mono onisplit.exe (Also change every \ to /)

Download links

Requirements

OniSplit requires .NET for PC and the mono framework for Mac OS X.