Single mesh -> Multiple mesh VMeshData/Ref converter uplo
This is a command line utility that reads in a VMeshData and VMeshRef segment then outputs a new VMeshData segment and the relevant number of VMeshRef segments for you to import into a FL .cmp file.
Basically it removes the hassle of hex editing from this tutorial which describes how to manually convert a single mesh .cmp into one with multiple components.
Multiple components are required for ships having destructable parts/bay doors, custom weapon models, jumpgates that open and docking bay doors on stations.
At the moment this is very basic. You must export your model from milkshape as normal, making sure that each component is a separate group. Once you have done this open up the .cmp file and export the VMeshLibrary -> yourmodelname.lod0.vms -> VMeshData node and the yourmodelname.3db -> Multilevel -> Level0 -> VMeshPart -> VMeshRef node to separate file e.g. to two files called 'VMeshData' and 'VMeshRef'.
Move these files to the directory where you have the converter (i.e. the directory where you have put the file meshconv.exe). Now run the converter, the syntax is :
meshconv VMeshData_filename VMeshRef_filename
So if you used the filenames from above you would type :
meshconv vmeshdata vmeshref
It exports the new VMeshData segment to a file called 'newvdata' and the VMeshRef segments to files called 'meshref1', 'meshref2' etc. If these files already exist they will be overwritten. The 'meshrefX' files will go up to 9 then start being called 'meshref:' etc so dont use more than 9 meshes. I will sort this soon but dont really see any need for that many meshes so its not a priority.
You then have to import the new VMeshData segment into your .cmp in place of the old one. You will have to import the VMeshRef segments into the relevant xxxxxx.3db -> Multilevel -> Level0 -> VMeshPart -> VMeshRef (as you only have one .3db node to start with you will have to make new ones manually, unless you are using a game .cmp as a template).
Anyway thats a bit off topic, for more info on the .3db nodes etc. see the above tutorial link. Downloading the Battleaxe and using its .cmp as a template will allow you to easily see if a ship with multiple components is working.
As i said, this is a very basic version. Ultimately i hope to get it to read in the .cmp and do all the converting automatically, outputting a new .cmp with the relevant nodes all in place. Possibly with options for it to create Fix/Rev/Pris nodes for you aswell.
For the time being this will have to do Remember it is very simple and not designed to cope with all sorts of crazy input. If you give it valid VMeshData and VMeshRef it should work fine tho.
Edited by - redeye on 25-07-2003 18:50:21
Edited by - redeye on 31-07-2003 21:14:36
Basically it removes the hassle of hex editing from this tutorial which describes how to manually convert a single mesh .cmp into one with multiple components.
Multiple components are required for ships having destructable parts/bay doors, custom weapon models, jumpgates that open and docking bay doors on stations.
At the moment this is very basic. You must export your model from milkshape as normal, making sure that each component is a separate group. Once you have done this open up the .cmp file and export the VMeshLibrary -> yourmodelname.lod0.vms -> VMeshData node and the yourmodelname.3db -> Multilevel -> Level0 -> VMeshPart -> VMeshRef node to separate file e.g. to two files called 'VMeshData' and 'VMeshRef'.
Move these files to the directory where you have the converter (i.e. the directory where you have put the file meshconv.exe). Now run the converter, the syntax is :
meshconv VMeshData_filename VMeshRef_filename
So if you used the filenames from above you would type :
meshconv vmeshdata vmeshref
It exports the new VMeshData segment to a file called 'newvdata' and the VMeshRef segments to files called 'meshref1', 'meshref2' etc. If these files already exist they will be overwritten. The 'meshrefX' files will go up to 9 then start being called 'meshref:' etc so dont use more than 9 meshes. I will sort this soon but dont really see any need for that many meshes so its not a priority.
You then have to import the new VMeshData segment into your .cmp in place of the old one. You will have to import the VMeshRef segments into the relevant xxxxxx.3db -> Multilevel -> Level0 -> VMeshPart -> VMeshRef (as you only have one .3db node to start with you will have to make new ones manually, unless you are using a game .cmp as a template).
Anyway thats a bit off topic, for more info on the .3db nodes etc. see the above tutorial link. Downloading the Battleaxe and using its .cmp as a template will allow you to easily see if a ship with multiple components is working.
As i said, this is a very basic version. Ultimately i hope to get it to read in the .cmp and do all the converting automatically, outputting a new .cmp with the relevant nodes all in place. Possibly with options for it to create Fix/Rev/Pris nodes for you aswell.
For the time being this will have to do Remember it is very simple and not designed to cope with all sorts of crazy input. If you give it valid VMeshData and VMeshRef it should work fine tho.
Edited by - redeye on 25-07-2003 18:50:21
Edited by - redeye on 31-07-2003 21:14:36