OGRE  14.2
Object-Oriented Graphics Rendering Engine
Mesh Tools

There are a number of mesh tools available with OGRE to help you manipulate your meshes.

XMLConverter

This tool can convert binary .mesh and .skeleton files to XML and back again - this is a very useful tool for debugging the contents of meshes, or for exchanging mesh data easily - many of the modeller mesh exporters export to XML because it is simpler to do, and OgreXMLConverter can then produce a binary from it.

Usage
OgreXMLConverter [parameters] sourcefile [destfile]
Parameters
-vDisplay version information
-merge[n0,n1] Merge texcoordn0 with texcoordn1. The , separator must be present, otherwise only n0 is provided assuming n1 = n0+1; n0 and n1 must be in the same buffer source & adjacent to each other for the merge to work.
-oDON'T optimise out redundant tracks & keyframes
-ESet endian mode big little or native (default)
-xGenerate no more than num eXtremes for every submesh (default 0)
-qQuiet mode, less output
-logname of the log file (default: OgreXMLConverter.log)

MeshUpgrader

This tool is provided to allow you to upgrade your meshes when the binary format changes - sometimes we alter it to add new features and as such you need to keep your own assets up to date. Furthermore, OgreMeshUpgrader can generate additional information for the mesh, like bounding regions and level-of-detail reduction. See the Automatic Mesh LOD Generator Tutorial for details.

Usage
OgreMeshUpgrader [parameters] sourcefile [destfile]
Parameters
-packPack normals and tangents as int_10_10_10_2
-optvtxcacheReorder the indexes to optimise vertex cache utilisation
-autogenGenerate autoconfigured LOD. No LOD options needed
-lnumber of LOD levels
-ddistance increment to reduce LOD
-pPercentage triangle reduction amount per LOD
-fFixed vertex reduction per LOD
-elgenerate edge lists (for stencil shadows)
-tGenerate tangents (for normal mapping)
-tsTangent size (4 includes parity, default: 3)
-tmSplit tangent vertices at UV mirror points
-trSplit tangent vertices where basis is rotated > 90 degrees
-rDON'T reorganise buffers to recommended format
-ESet endian mode big little or native (default)
-bRecalculate bounding box (static meshes only)
-VSpecify OGRE version format to write instead of latest Options are: 1.10, 1.8, 1.7, 1.4, 1.0
-logfilename name of the log file (default: OgreMeshUpgrader.log)
Note
The OGRE release notes will notify you when meshes should be upgraded with a new release.

AssimpConverter

This tool converts 3D-formats supported by assimp to native OGRE .mesh .skeleton and .material files.

Usage
OgreAssimpConverter [parameters] sourcefile [destination]
Parameters
-qQuiet mode, less output
-logfilename name of the log file (default: OgreAssimp.log)
-aniSpeedMod[0..1] Factor to scale the animation speed (default: 1.0)
-3ds_ani_fixFix for 3ds max, which exports the animation over a longer time frame than the animation actually plays
-max_edge_angledeg When normals are generated, max angle between two faces to smooth over

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 Ogre::MeshSerializer and Ogre::SkeletonSerializer. They also normally require you to own the modelling tool.

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

A Note About Modelling / Animation For OGRE

There are a few rules when creating an animated model for OGRE:

  • You must have no more than 4 weighted bone assignments per vertex. If you have more, OGRE will eliminate the lowest weighted assignments and re-normalise the other weights. This limit is imposed by hardware blending limitations.
  • All vertices must be assigned to at least one bone - assign static vertices to the root bone.
  • At the very least each bone must have a keyframe at the beginning and end of the animation.

If you’re creating non-animated meshes, then you do not need to be concerned with the above.

Full documentation for each exporter is provided along with the exporter itself, and there is a selection of the currently supported modelling tools at OGRECave.

A Note About empty Material Names

All mesh files are required to have a material name set, otherwise most mesh tools will fail with an exception. Even if they don't, the exception will happen deep inside the render-loop which is way harder to debug (unless you set the material programmatically).

To set a material name for the mesh, you have these options:

  • Re-export the mesh from your preferred DCC (Digital Content Creator) exporter, making sure that a material has been assigned.
  • Edit the mesh.xml file to set a material name and reprocess the xml with OgreXMLConverter.
  • Edit the mesh file with MeshMagick to set a material name