Exporter 3DStudioMax        

Mantained by: Banania
Project: OGRE Main Project (3dsmaxExport)
Type: Plug-in
Documentation: Install Instructions, ReadMe
Sources: OGRE Main CVS
Binaries: OGRE Tools Downloads Area
Status and bug reports: OGRE Forums


This is a rough page to outline the how-to and technical limitations on the 3DStudio Max exporter for Ogre. There are alternate exporters (such as the Octopus one), but this page is concerned only with the primary one include in the Ogre development tree.

More to come in terms of organization and content for this page.

Special Note: I intend to emphasize on this page what is a limitation of either Ogre, Max, or the Exporter. As I believe we need to know which areas need improvement (Ogre or the Exporter).

Threads on the forum for reference as this page is built

1. http://www.ogre3d.org/phpBB2/viewtopic.php?t=5812&highlight=
2. http://www.ogre3d.org/phpBB2/viewtopic.php?t=8660&highlight=

Working with the Exporter

General Tips on Meshes

1. The exporter will export to .mesh file which is single mesh object. You should have only mesh in your scene to be exported. You can not just hide the other meshes. Also can not be a scene object which you have more than one pivot point.

2. Assuming that you have a model with UV coordinates ready, you need to reset X-form to your model. This will mean to have model translation and rotation set to 0,0,0. Your scale should be 100 on all axis. Tip to accomplish this: Create a temporary box at 0,0,0 (size of box doesn't matter). Convert the box to an Editable mesh. While selecting your box mesh, attach the model to it. Delete the temporary box. Now the model should have a brand new transformation.

3. You should have your skin modifier enabled on the Max stack for your model. Do not collapse it. This will clean up the deformation.

Exporting Bones

1. Ogre requires that there be a 'single' root bone.
In Max, first check the bone structure in schematic view.
If you need to fix this, you can create another bone as root bone and link all the other root bones to this one.

2. Weight on bones.

Exporting Animation

1. Ogre does not support IK animation, only FK animation allowed. That means you cannot use Max IK solver for any bone chain in your animation. And you must have Position and Rotation keyframe for every single bone that you want to export for animation.

Improvements to Exporter or Ogre

This section is to propose/comment how we can improve either Ogre or the Exporter. psyclonist on the forums has expressed his desire to help improve the exporter... make suggestions! My desire is to better understand what is a limit of Ogre and what is a limit of the Exporter.

1. Add error messages to the Exporter if it does not find a root bone. This will cut down on frustration for newcomers.

2. Add a warning if IK animation is detected.

3. Is it possible we could find Max scripts to automatically convert IK to FK animation by baking? Perhaps include suggestions to run such a script (or even include it as an option)? According to the instructor Paul @ Lost Pencil Studios, exporters for game engine like Torque do this for you. In Paul's words: "If you have a good exporting routine it will convert the IK to FK - sort of like baking the animation on the bones. Then your artist can use IK to create the animation, and the engine can use FK (which is faster in game)". See #2 as minimum.

(This is actually easy to do through sampling — when sampling the transform matrix, and decomposing to PRS pieces, you get the IK baking "for free." You can then reduce the keyframes as necessary using whatever fit function you want. — jwatte)

4. When will Ogre allow more than 4 verts on a bone? Is this limitation that will be lifted long term... or is it always bad design for performance to have such a structure? Are there examples (someone can give) of characters that would be hard to do in Ogre because of this limitation?

5. Please allow to add keyframe to mesh without using bone for some simple animation. I don't know if this will be possible or not. But this may help to improve FPS somewhat by reducing complex animation with bone/biped. ( psyclonist indicates this is a planned improvement )

6. Ability to export the mesh WITHOUT resetting the xform. That is, exporting the mesh in the object space instead of world space. This way it would be possible to have all different meshes in the scene for layout, and you could just export them one by one without moving them to the origo. Currently the process of export is quite painful.

7. Ability to save the transformation inside the mesh file. Related to #6. This way you could setup a scene inside max instead of manually copying the transformation to the ogre. Maybe the transformation could be/would have to be loaded into entity with some special command like entity->loadTransformFromMesh(mesh);