User Tools

Site Tools


Working with existing meshes

Before you can work on any meshes, you'll almost certainly want to convert to the XML format. However, due to version of the software used by SPM not matching up with the available open source Ogre tools, you must first prepare the mesh files.

Preparing SPM binary meshes for conversion

EE's meshes have a custom defined serializer string, which you'll need to hex edit back to something that OgreXMLConverter recognizes.

Method 1 - Use a HEX editor

  1. Open the .mesh file in the HEX editor of your choice.
  2. Near the beginning of the file there's a part that looks like this: [MeshSerializer_v1.40o]
  3. Simply delete the 'o' so it looks like this: [MeshSerializer_v1.40]
  4. Save the file

Method 2

If you have GNU tools installed, sed can do this :-

sed -i 's/MeshSerializer_v1.40o/MeshSerializer_v1.40/g' Prop-Something.mesh

Convertng SPM binary meshes to XML

You'll need now to use the program called OgreXMLConverter. It's available from the Ogre Command-Line Tools package. [link][/link]

This program will take a .mesh file, and turn it into a .mesh.xml that may be impored into your modelling tool.

OgreXMLConverter -d3d Prop-Something.mesh Prop-Something.mesh.xml

  • The -d3d option is not required on Windows, as it is the default
  • You don't have to supply the target filename (.mesh.xml), it is provided here for completeness.
  • Run the command with no options for help

Although it's a console application, you can drag and drop the .mesh and .skeleton files onto OgreXMLConverter to convert them back and forth between binary and .xml formats.

Save it. OgreXMLConverter should now be able to open it.

[b]Creating new assets[/b] If you have a new model from somewhere and can export it to Ogre mesh/skeleton format, it should work just fine in EE. The Torchlight 2 pets demonstrate that feat.

[b]Editing the mesh[/b] Search for an Import script for your 3D program of choice. If you use Blender, [url=]Torchlight To Blender[/url] is good choice, but it doesn't support animations. There are others out there, even one that does support animations to some extent, but you may need to Google them (I haven't kept up to date). Most scripts usually require changing a few parameters inside them, often a path to the OgreXMLConverter utility.

You'll need Export scripts to save them back out. For Blender, there's a link to Blender Exporter in the Tools page above. Depending on which editor, and which version it is, you may need different scripts. Google is your friend.

Here are [url=]some models[/url] to get started. Biped-Male: The default male body. The animations are shared for both male and female. The base body types are shared for all races, and do not contain faces, tails, or forearms. Biped-Hart_Male: The race-specific stuff for male hart. Face, tail, horns, etc. Boss-Dragon: Demonstrates how simple creatures are. Includes sound files too. Item-1hSword-Basic1: Simple item mesh. Prop-Wooden_Furniture: A collection of many props (provided as is, you'll have to convert them yourself) Converted: An extra folder where I tossed some pre-converted mesh and skeleton XML files for the other models. The binary .skeleton files in this folder contain all the animation data, consolidated from the .anim files. The files in the other folders are provided as is (except for some altered serializer strings).

Requested asset packs can be found in the [url=]Assets folder[/url]. Similarly, specifically requested textures can be found in the [url=]Textures folder[/url].

These zip files contain all the prop data (textures, meshes, XML files). The mesh files will need binary editing in the post above to use.

Prop-Church1 : Church_Altar1, Church_Rug Prop-Paintings1 : Painting1, Painting1a Prop-Tribal_Furniture : Tribal_{Chair1, Lamp_Unlit, Lamp1, Plate1, Rack, Rug, Stool1, Table1}

workingwithexistingmeshes.txt · Last modified: 2013/10/14 22:27 by rockfire