OGRE (Object-Oriented Graphics Rendering Engine)

Tutorial 1 - Overview
Exporters

 

Exporters

Exporters are plugins to 3D modelling tools which write meshes and skeletal animation to file formats which OGRE can use for realtime rendering. The files the exporters write end in .mesh and .skeleton respectively.

Each exporter has to be written specifically for the modeller in question, although they all use a common set of facilities provided by the classes MeshSerializer and SkeletonSerializer. They also require you to own the modelling tool.

There is also a legacy tool used to convert .3ds files directly called 3ds2oof, although use of this tool is no longer supported. Whilst the advantage of converting files directly is that you no longer have to own the modelling tool, the downside is that it is a lot harder to convert files reliably from outside the tool, especially as most tools have undocumented or poorly documented file formats.

All the exporters here can be built from the source code, or you can download precompiled versions from the OGRE web site.

Milkshape3D

Milkshape3D is a popular low-polygon editor, especially popular in the modding community because of it's low price and the fact that it supports many game file formats.

Installing it is easy, just copy the 'Release' builds of OgreMain.dll and msOGREExporter.dll (or the rebuilt versions) into your Milkshape folder and fire it up. You can then export the currently selected model by going to the menus and selecting File|Export|OGRE Mesh / Skeleton...

An important tip: Make sure you are not in 'animation' mode when you do this, otherwise Milkshape gets confused as to what the 'reference' position of the mesh is. Just make sure the 'Anim' button in the bottom-right is NOT depressed.

You then get a dialog box with several options:

Export Mesh: Obvious really - if checked this exports the geometry data (vertex positions, normals & texture coordinates) to a .mesh file.

Export Skeleton & Animation: If checked, the bones of the model and animation data is exported to a .skeleton file.

Split Keyframe Sequence Into Multiple Animations: You can check this to split the single timeline in Milkshape into multiple separate animations (this option has no effect if you are not exporting the skeleton). This is necessary because Milkshape doesn't have a concept of multiple separate animations, you just have to model them all in a single timeline and then use this feature to split them up. If you check this box you must supply a text file which tells OGRE how to split the animation up. This text file is very simple: each line is a single animation, and must contain comma-separated values indicating the start frame, end frame and name of the animation, e.g.:

1,30,Walk
31,45,Run
46,75,Die
...etc

Frame Rate: The Milkshape timeline is in frames, but OGRE likes to deal with animations in terms of seconds for simplicity. This value allows the exporter to do the conversion. Note there's nothing to stop you animating the mesh at a different frame rate in OGRE at runtime by scaling the amount you change the animation by each time, but this bakes a 'default animation speed' into the animation for simplicity.

Export Material Definitions: If checked, the .mesh file created will also contain the definitions of the materials the model uses. This ensures that material definitions exist in OGRE as defined on the Materials page in Milkshape. However, because Milkshape has very limited material settings, I recommend you don't use this option. When this option is unchecked, only the name of the material used by each subpart of the model is exported. You can then provide a material script at runtime which defines this material using OGRE's full range of material properties, which OGRE links the mesh up to at load time. This is a far more flexible way to define materials which is why I don't recommend you use this option unless you're really lazy.

 

Back to Index << Previous sectionNext section >>