level 6
markminiko
楼主
原文地址:
http://wiki.oni2.net/User_talk:Neo#OniSplit_0.9.25
OniSplit by Neo, is an integral part of the Anniversary Edition. It does the work of splitting and recombining the data files. But it also does much more such as importing and exporting TXMP, M3GM and now TRBS files. ONCC files can also be exported.
UPDATE: Sep 14, 2008 OniSplit v0.9.40:
http://mods.oni2.net/system/files/OniSplit.exe_.zip (地址更新,原地址报废了. markminiko)
Adds .xml export/import of ONIE
More info can be found here: http://wiki.oni2.net/OniSplit
Export/Import for TXMP files:
To extract all the TXMP files
onisplit -extract:png destination_directory_for_image_files level0_Final.datTGA and DDS are also supported using -extract:tga and -extract:dds.
To import image files. (Create new TXMP files)
onisplit -create:txmp destination_directory [options] source_image_filewhere 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 imported -format:bgr32 -genmipmaps tga\concrete.tgaTo batch process a folder of image files
onisplit -create:txmp imported -format:bgr32 -genmipmaps tga\*.tgasource_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 dest_dir -format:bgra4444 -genmipmaps -envmap:envmapname imagefile.tgaThe envmap name can have the TXMP prefix but it is not required, it is added automatically if missing.
How to find the name of the envmap there are 2 ways:
1) Use the -dump command:
onisplit -dump TXMPIteration001%2FKS_face.oni
TXMPIteration001/KS_face:TXMPInstance {
TextureName:"Iteration001/KS_face"
Flags:4609
Width:128
Height:128
Format:0
Animation:null
EnvMap:"TXMPenvksface"
DataOffset:32
}2) Open the .oni file in a hex editor, you will see the names:
TXMPIteration001/KS_faceExport/Import for Wavefront OBJ files:
Named M3GMs and (unfortunately unnamed) M3GM contained in ONWC files can be exported to obj file format:
onisplit -extract:obj dest_dir M3GMnotfound.oni
onisplit -extract:obj dest_dir ONWCw1_tap.oniOr for greedy people:
onisplit -extract:obj dest_dir level0_Final.datImporting obj files:
onisplit -create:m3gm dest_dir TCTF_Shotgun.objFor 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.objJust 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.
To see a list of all the commands available in OniSplit:
OniSplit -helpNote: For Mac users the command is:
mono onisplit.exeLast edited by EdT (14/9/08 19:42)
2010年03月20日 23点03分
1
http://wiki.oni2.net/User_talk:Neo#OniSplit_0.9.25
OniSplit by Neo, is an integral part of the Anniversary Edition. It does the work of splitting and recombining the data files. But it also does much more such as importing and exporting TXMP, M3GM and now TRBS files. ONCC files can also be exported.
UPDATE: Sep 14, 2008 OniSplit v0.9.40:
http://mods.oni2.net/system/files/OniSplit.exe_.zip (地址更新,原地址报废了. markminiko)
Adds .xml export/import of ONIE
More info can be found here: http://wiki.oni2.net/OniSplit
Export/Import for TXMP files:
To extract all the TXMP files
onisplit -extract:png destination_directory_for_image_files level0_Final.datTGA and DDS are also supported using -extract:tga and -extract:dds.
To import image files. (Create new TXMP files)
onisplit -create:txmp destination_directory [options] source_image_filewhere 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 imported -format:bgr32 -genmipmaps tga\concrete.tgaTo batch process a folder of image files
onisplit -create:txmp imported -format:bgr32 -genmipmaps tga\*.tgasource_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 dest_dir -format:bgra4444 -genmipmaps -envmap:envmapname imagefile.tgaThe envmap name can have the TXMP prefix but it is not required, it is added automatically if missing.
How to find the name of the envmap there are 2 ways:
1) Use the -dump command:
onisplit -dump TXMPIteration001%2FKS_face.oni
TXMPIteration001/KS_face:TXMPInstance {
TextureName:"Iteration001/KS_face"
Flags:4609
Width:128
Height:128
Format:0
Animation:null
EnvMap:"TXMPenvksface"
DataOffset:32
}2) Open the .oni file in a hex editor, you will see the names:
TXMPIteration001/KS_faceExport/Import for Wavefront OBJ files:
Named M3GMs and (unfortunately unnamed) M3GM contained in ONWC files can be exported to obj file format:
onisplit -extract:obj dest_dir M3GMnotfound.oni
onisplit -extract:obj dest_dir ONWCw1_tap.oniOr for greedy people:
onisplit -extract:obj dest_dir level0_Final.datImporting obj files:
onisplit -create:m3gm dest_dir TCTF_Shotgun.objFor 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.objJust 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.
To see a list of all the commands available in OniSplit:
OniSplit -helpNote: For Mac users the command is:
mono onisplit.exeLast edited by EdT (14/9/08 19:42)