SWG 3D MAX MSH Exporter
I started this project to prepare myself for a 3d modeling class I am taking this fall. I knew nothing about 3d modeling or 3d max, but decided if I was going to start learning, might as well create models I might be able to enjoy. I settled on SWG as the models are quite old, easy to look at, and I might be able to improve on some of them. One big problem though, there wasn't really a way to get them into SWG. I tried the blender extractor, which was ok but it didnt have any texture support. So after a week of swaying back and forth between 3dmax and the blender msh extractor, I decided to stick with 3dmax. Thanks to Xunil's work, recreating the MSH file wasn't that bad, but then I started to include the SHT file into the extractor. Very little information is publicly known about it, and while I could base a guess on one sht file of how they should look, I decided to increase my odds. I wrote a file parser to export certain sections of code for over 6000 SHT files relating to MSH files. So atleast now I have an idea of what is there. I just need to figure out what the heck it all really means. And that is where you can help.
- MSH File Outline
- Multi Object Support
- Multi Texture Support
- Advanced SHT Creation
- Attachment Support
- 32 bit face Support
- Lots of testing needed
- Lots of unknowns
- 20 object limit for models. Will boost later on
- 65,536 texture vertex limit per object
- Create APT files
- Added main SHT file creator selector switch. Will check all on or off
- *Extended shader list did not make this version
3D Max Support
Installation and Running
To get started, download the file and save it to your computer. Any where works. I would recommend the scripts folder though. For me thats --> C:\Program Files\Autodesk\3ds Max 2013\scripts
To run the program, make sure the model you want to export is opened and in mesh form. Then goto the menu bar and choose: Maxscript --> run script. Navigate to the SWG_MSHExporter and hit open.
The following should popup if everything is good.
- Export: Choose whether or not to export that object
- Create Shader File: Choose whether or not to create a SHT file for the object
- Shader Name: Name of the SHT file that will hold the texture information for this object (*.sht)
- FVF Code: Unknown at this time. Only 48, 52, 56, 68 bpv have selectable options
Change what is necessary for each object you wish to export. Once finished, hit the Export MSH button. Choose what to name the msh file and where to save it.
SHT File creator
If you selected to create a shader file then you will see the above.
- Options: All these are unkowns, but supposedly might change texture features like gloss
- Option 9: Probably do not need to touch as it relates to water
- Options 14-16: Usually the same value
- Type: Type of texture
- TCSS: Unknown, might have to do with texture layer. Diffuse is required, normally set at 0.
- AVRS: Unknown, might be similar to TCSS
- Name of Texture: Name of the texture file (*.dds)
To have multiple texture types that relate to one model, for example a diffuse and a normal map, each texture will need to have its own UV map. The UV maps must be setup the same but need to be on different channels. Would not recommend doing this right now unless you are into testing.
Once you are finished, hit the create SHT button. You will need to do one of these for each SHT file you wanted to create. SHT files will save in the same location as you saved the msh file. Only exception as of now is if you saved the msh file in your swgemu directory, then they will be saved in the shader folder.
Make sure your new files are setup properly. Assuming SWGEmu is setup as follows:
C:\SWGEmu\appearance\mesh <-- most msh models go in here
C:\SWGEmu\shader <-- sht files go here
C:\SWGEmu\texture <-- dds files go here
If you are using another emulator, then adjust as needed.
Once done, you are ready to boot up the game and see if your new model works.