the original Torchlight game or TorchED : http://www.torchlightgame.com
Blender 2.49b: http://www.blender.org (doesn't work with Blender 2.5x yet)
Python 2.6: http://www.python.org/download/
OgreCommandLineTools : http://www.ogre3d.org/download/tools
Blender file with import script : wardrobe_template.blend
note: import script uses only .xml files, so you need to convert .mesh and .skeleton files into .mesh.xml and .skeleton.xml files
Importing existing mesh
Run (or open) the .blend fileOn the right side of the screen is the import script running for you already
There 6 editboxes (from top to bottom):
1. Use 'Select File' button next to first editbox to look for mesh file you want to import
2. - you can ignore material editbox -
3. Press 'Search for' button to search skeleton .xml file in directory where your .mesh file is located, then press 'Use it' button
4. - you can ignore texture directory -
5. Write name you want to use for mesh
6. - ignore the animation file entry -
Now press 'Start' to import your mesh together with skeleton
You should have something like that:
Now you have to manualy create and name materials and rename existing vertex groups so that you'll have materials ending with 'face', 'boots', 'chest, 'gloves', 'helmet', 'shoulders'
So e.g. 'Material_#143/shoulde' needs to be renamed to 'gunsl_shoulders' (material name was cut because of blender name restrictions) (use CTRL and left click on name in Outliner window to rename vertex groups)
...
Attach textures (defined in .material) to vertex groups.
To materials add respective textures and set Map Input to UV.
Adjust the mesh to your liking.
Exporting mesh
To have exported mesh in sync with Torchlight skeletons, you need to adjust your exporter python script.Or just download it from here and replace this file in your '.blender\scripts\ogrepkg\' directory
Changed armature export script (zipped) : armatureexport.zip
Adjustment to the script just sorts the bones same way as Torchlight export script for 3D studio max (it won't affect export in any bad way)
Firstly, select all submeshes of character (boots, chest, head, ...) and merge those into one mesh (one object) (shortcut Ctrl + J).
Make sure everything is scaled properly by selecting mesh and pressing Ctrl + A and choosing Scale And Rotation to ObData.
Then go to File -> Export and choose Ogre meshes
Change setting of exporter according to: also make sure Preferences in exporter are set like this:
Press Export
Now you should have .mesh, .skeleton and .material file generated in your output directory





