Table of contents
This tutorial assumes you are using 3DSMax for your modelling.
Please note that the links for the Octopus exporter are not active, so you will not be able to use 3DS Max following these steps. Visit this link to find other Ogre Exporters for 3DsMax:
First we need to get your environment set up.
Get the Octopus exporter from:
Install it as described in the wiki:
If you use the version from 08/24/2004, apply the fix found in the forum thread:
If you don't already have the Ogre ModelViewer, get it at:
- Press the "Export scene to Octopus" button created when you installed Octopus.
- Open the "Export Plug-in Options" section and hit the "Open OctopusScript.ini" button.
- Change all the directories to be correct for your setup. Save and close the INI file.
- Make sure the Units are set correctly in the same section.
- Open the "Default Mesh Settings" and make sure that the "Scale" is set to 1.0, and the "Flip Y/Z" checkbox is enabled.
- Close the Octopus dialog box.
Now let's make a simple, multi-meshed model.
Fire up 3DSMax.
Create two boxes with some distance between them.
Now add one bone in the center of each box, and give them fins to increase their influence area.
Convert both boxes to Editable Meshes.
Hit 'M' to bring up the Material Editor. Hit the "Get Material" button and double-click "OGRE (single/pass)".
Rename the material to something friendly, with no unusual characters. It's safest to stick with alpha-numeric characters with no spaces.
At the "Map 1:" location, first change the dropdown list from "
hide" to "Diffuse", then hit the button labelled "None".
Double-click "OGRE Texture Unit". Rename this section to a friendly name, as above.
Under the "Bitmap Parameters" section, click the button labelled "None". Select an existing image file, and be sure a copy of it resides in your Octopus ouput directory (so the MeshViewer can access it).
Now drag this new material to Box01.
Do this procedure again for another material, selecting a different image file this time. Drag this second material to Box02.
Select one of the boxes, and go to the Modify panel. Under the "Edit Geometry" section, click the "Attach" button, and select the other box. Click the "Attach" button again to deselect it.
You've now got one object consisting of the two boxes. It will be named whatever the first box was that you selected. (Box01 in this tutorial) If you need to modify them individually again, select the object and pick "Element" under the "Selection" section. Then you can select each of the boxes individually, and if necessary, detach them (under "Edit Geometry" section).
From the "Modifier List" dropdown, add a "Skin" modifier to your new object. Scroll down to the bottom of the panel, and under the "Advanced Parameters" section, change the "Bone Affect Limit" to 4. This is the maximum that Ogre will allow.
Now scroll the panel back to the top, and click the "Add" button at the top of the "Parameters" section. In the popup window, select all four bones, and hit "Select".
Hit the "Edit Envelopes" button under the "Parameters" section. Now you can adjust the bone envelopes if necessary. Make sure the envelopes don't overlap the opposite box. Refer to the 3DSMax manual if you need further instructions regarding the envelopes.
Hit the "Edit Envelopes" button again to deselect it. The envelopes should disappear from the display.
Select one of the large bones, and rotate it a bit to verify the envelopes are correct. Do the same thing to the other large bone (once for each box). If the boxes don't spin along with the bone, or part of the opposite box spins with the bone, fix the envelopes until it is correct.
Now we're going to add a simple animation.
Select the large bone on the left. Move the time slider to frame zero and hit the Key button.
Do the same thing to the large bone on the right (add a Key).
Right-click on the Play Animation button and change the Length of the animation to 29.
Press the Auto Key button. It should turn red and stay red.
Move to frame 7, and rotate each of the large bones 1/4 turn (90 degrees). Move them in opposite directions to make the animation more obvious that it's correct.
Now move to frame 15 and do the same thing. Do it again at frames 22 and 29.
Press the Auto Key button again to turn it off.
Press the Play Animation button and both boxes should spin in 360 degrees smoothly.
Select the Box01 object. From the Modifier List, add a OctopusExport modifier to the object.
The "Skeleton Animation Type" should be "Skin only". Change the Frames numbers to run from 0 to 29, and set the "Animation Length" to 1.0 (assuming 30 frames per second).
Type a name for your animation ("spin") in the edit box and hit the "Add name to list" button.
Select the Box01 object and press the "Export scene to Octopus" button.
Type in a name for you mesh in the "Scene name" edit box.
Be sure "Export meshes", "Export skeletons", "Export Materials", and "Run XMLconvertor" are checked, and the "Meshes folder" has your correct output directory.
Hit the "Export scene" button, and hopefully you'll get the pop-up box saying "Exported 1 of 1 meshes".
Using Windows Explorer (assuming you're using Windows), browse to the Meshes folder. You should find several files created by Octopus there.
Open the file "Box01.mesh" with the MeshViewer utility. In the left panel, click the "+" next to "Animations" to open that section up. Here you should see the "spin" animation we created. Select it, and the boxes should start spinning!