Topics Covered
This tutorial covers tips for exporting using the OgreMax exporter for 3ds Max, Maya and Softimage XSI, for getting best results, for optimizing rendering performance (FPS), and for configuring collision support (before and after export) for objects and environments, including tips for setting up interior environments.
Though some of the terms used in this tutorial are 3ds Max-specific most of the concepts and techniques described here apply equally to Maya and Softimage XSI as well.
Though this manual is primarily written for OgreMax exporter use, it does cover concepts and tips that also apply to other formats and exporters, especially relating to optimizing performance and collision/interior/physics setup.
This manual will be revised once "Split to Multi-Actor Prefab" support (which is expected for v0.9.8.1 release) has been finished, to describe a simpler way of performing these same optimizations (and supporting interiors and advanced out-of-box collision) with any model format or exporter.
Selecting a Model Format
The Autodesk FBX (.fbx) format is expected to be suggested format for non-animated, once first version of importer is released with v0.9.7, and suggested format for animated models and scenes as it matures.
Currently, Ogre .mesh is the primary suggested format for models with animations, especially those which require dynamic animation blending at runtime. Specifically it is suggested for skeletal animations (eg. for characters), or part animations (if/when exporter is configured to export the .skeleton for them). However, non-blended skeletal animations and cinematic (non-skinned part/node) animations are supported for Collada .dae as well (though with limited triggering support until v0.9.7 is released, and animation blending coming later on for it).
Animation support for .fbx and .dae is under development, so eventually it is expected that .fbx and .dae may be preferred formats for animated models of all types.
Wavefront .obj is a common, compact format for non-animated models (and .mtl for materials), and is suggested in some cases for large models or where issues might be encountered with .dae or .fbx.
The other mentioned formats are generally better alternatives to the older more limited .3ds and .x formats, though those are supported for non-animated models and will include animation support later on.
Differences Between Ogre .mesh and .scene formats
If you just export to a single .mesh file, none of the parts will have per-part collision or be moveable/scriptable per part or be editable as a multi-part Prefab in Visual3D, by default. However, we do have a feature under development for "Split to Multi-Actor Prefab"", which will allow any model to imported as multiple-Actor prefab just like how we import Ogre .scene format. However, for first version of that, node and skeletal animations won't be preserved when its used.
Node animations may be exported automatically as Skeletal (Skinned) animations when exporting to only .mesh format (without .scene file), depending on settings, you can try and see. Keep in mind that "Split to Multi-Actor Prefab"
Just keep in mind that ou have an interior (eg. indoors for a building) model, be sure to exclude the ceiling when exporting (parts won't be able to be moved dynamically at runtime (unless animations are defined for them, which would end up being treated as skeletal animations even for non-Skinned models).
Exporting to .Mesh Format (Tutorial)
You can export a single Ogre .mesh file (along with .material and option .skeleton file(s)) by following the steps outlined below.
- Choose Object(s) to Export
- Option 1:
- Go to OgreMax (menu in menubar) > Export Scene ….
- Select .mesh from the file extension drop-down in the dialog shown
- Option 2:
- Select object(s) which you want to exclude from exporting, and then go to OgreMax > Object Settings… dialog and then set Type (in the General tab) to "Ignore" (this may automatically cause children to be ignored as well, by default)
- Go to OgreMax (menu in menubar) > Export Scene ….
- Select .mesh from the file extension drop-down in the dialog shown
- Option 3:
- Select the object(s) (including Children, eg. using Select Children selection mode) to be exported and then select OgreMax > Export Selected Objects, allowing you to select only a few objects (or ignore a few, for a one time export)
- Go to OgreMax (menu in menubar) > Export Selected Objects ….
- Select a folder to export to which is under the world project folder (which was created by Visual3D when creating a new world). (See Setup in Visual3D section for details.)
- Copy the textures used by the model into the same folder as the .mesh file(s) using it, if needed (OgreMax doesn't copy them over by default on export). (See Setup in Visual3D section for details.)
- Follow steps in the "Setup in Visual3D" section below for finding, configuring, and using the exported Assets in Visual3D, and reference it for more details about where t well as more details about where to export or organize those files.
Exporting to .Scene Format (Tutorial)
You can export a to a single Ogre .scene file (and associated .material file), representing a Multi-Actor Prefab, along with one or more Ogre .mesh file(s) it references (and their optional .skeleton files), by following the steps outlined below.
For models which do not require .scene format (which is only required at this point for non-skinned/non-skeletal scene node animations or cases where per-part collision is required, such as for buildings with interiors), then its suggested you instead export to only the Ogre .mesh format (done by selecting .mesh from file extension filter drop-down for the modeling package's Export dialog or for the OgreMax-specific Export dialog, or by entering file name into that dialog which ends in .mesh). This will avoid possible performance issues caused by OgreMax Exporter's tendency to export each Geometry node (eg. each primitive shape) to a separate model / renderable (.mesh file), since Visual3D has built-in support for merging all model parts into just having a part for each unique material, which can greatly improve performance.
Features are under development for the Visual3D Model Editor to allow excluding some parts (such as a ceiling for a building model with an interior) from collision, or splitting off only selected parts to their own models (ie. creating a Multi-Part Prefab from a Model). Once this is completed, interiors and other models with complex collision/physics requirements will be able to be setup regardless of what format or exporter was used.
Steps for Exporting to Ogre .scene Format for 3ds Max, Maya and Softimage XSI
- Force Submesh exporting by default for all Geometries
- Go to Scene Explorer (SE) in 3ds max
- Enable children auto selection (Right click in SE > Select > Select Children)
- Select all root node(s), (likely) after filtering to only Geometry type
- Can exclude any which you want to have treated as parent Geometry nodes (or other attached Submesh Geometry)
- Go to OgreMax (in menubar) > Object Settings …
- For the Type setting (in General tab), select "Submesh" from drop-down
- If don't see this, may need to filter out non-Geometry types from current selection set
- NOTE: Be sure to follow below steps for ensuring that Geometries with OgreMax Type = "Submesh" are attached (as direct or indirect child) of a Geometry with OgreMax Type = "Entity/Mesh", otherwise they won't be exported at all.
- Create a new hidden root Geometry
- In Sidebar > Create > Primitive > (Select any of lowest polygon primitives)
- Rename it (eg. to "Model 0")
- Hide it
- (possibly freezing or tweaking other settings to ensure its never rendered)
- Make sure its shown at root level in Scene Explorer
- This should default to OgreMax Type = "Entity/Mesh"
- Can confirm that in Object Settings dialog
- Select Parent Geometry for First .mesh (or Create Dummy One)
- Option A
- Right click (on "Model 0" in SE) > Copy Nodes
- Duplicate it by Right click in SE (not on any existing node) > Paste Nodes
- Option B
- If you have an existing Geometry you want / need to be the root for an exported .mesh (eg. possibly if has Morpher or Skin modifier on it, though maybe not needed there)
- Then select that and go to OgreMax > Object Settings… dialog and set Type = "Entity/Mesh"
- Use that existing Geometry instead of "Model 1" for below instructions.
- NOTE: Its fine to have "Submesh" type Geometries indirectly attached/linked to an a indirect parent "Entity/Mesh" Geometry, don't need to attach/link directly to the mesh
- Group Geometries/Nodes for Exporting to Different .Mesh Files (for importing as separate Actors/Models into Visual3D)
- Option 1:
Right click (on "Model 0" in SE) > Copy Nodes, then right click in Scene Explorer (on any other Node, or so that its created at Root level) and select > Paste Nodes, renaming it to new unique name like "Model 1", so you have a non-visible / Dummy Geometry which has its OgreMax Type = "Entity/Mesh"
- Option 2:
You can also just use an existing Geometry in place of creating a new "Model 1"
- You might do so if either….
- You want that single Geometry to be exported to its own .mesh file (without merging others into it)
- Or, you already have all intended merged/child Geometries "attached" to it (which includes indirect children, such as for Geometries under Helper or Group nodes attached to the parent Geometry)
- Just be sure to select that intended Parent geometry and go to Ogre Max > Object Settings… dialog to set Type = "Entity/Mesh" for it (ensuring that its Children are not selected when you do this)
- Option 3:
Merge Geometries into Single Geometry
(Slower than other options, reduces ability to edit meshes later on for rexporting)
- Multi-select node subtrees in Scene Explorer (with Select Children mode enabled)
- Go to Sidebar > Utility > Collapse
- Select Collapse to: "Single Object" radio button, if not already selected
- Press "Collapse" button
- This will merge the Geometries into a single Geometry.
- Ensure the Geometry has OgreMax Type = "Entity/Mesh" (should be default though)
- Might not be default if had performed the step to set all Geometries to OgreMax Type = "Submesh", however, as described in Technique 1
- Repeat Step #4 for Each .Mesh File you want to Export Automatically with the .Scene File
- See Finding/Grouping Objects section below for tips on how to quickly find/decide which objects to group
- Export the OgreMax .scene file (along with the .material file and .mesh (and optional .skeleton
- Select OgreMax (in menubar) > Export Scene...
- Alternatively, can select only objects want to export (with children included, eg. via enabling Select Children mode), and then select OgreMax > Export Selected Objects… instead
- NOTE: Usually its good idea to create a new folder to contain the .scene export, as it sometimes produces many .mesh files which may have same file name for a different exported .scene file.
Finding/Grouping Objects: Tips for Finding/Deciding Which Objects to Export as Single Mesh with 3ds Max
- Enable children auto selection (Right click in SE > Select > Select Children)
- Preview top-level groups
- Click through each of top (or near top) level nodes
- Clicking on 3ds max titlebar (to ensure selection isn't reset by clicking on viewport), then Alt-Q to enable Isolation Mode to view just that subtree
- Click on Exit Isolation Mode floating button
- Repeat (drilling down as needed) to find what want to make into separate objects
- Can also click in 3ds max viewport to find few meshes, and generally try previewing their immediate parent (eg. Helper or Group node) as often peers should be a part of same object
- Can right click > Group > Group to group them off for easier finding later
- Optionally can perform right click > Unlink or > Group > Exclude from Group for some nodes when needed, or to move to root in Scene Explorer
Setup in Visual3D: Optimizing Models and Configuring Collision/Navigation Support (especially for Interiors)
- After exporting the exported files (including one or more .mesh and .material files, and possibly .scene and .skeleton files) are all in the same folder under your Visual3D-created world project folder, or a referenced package folder (like Standard Assets or Demo Assets), to ensure Visual3D can find them.
- Also, ensure that all textures used by the scene/models are in that same folder, as they aren't copied to export folder by default.
- Optionally, textures can be in different folder if sharing across multiple models, but they should have globally unique names across all textures in the world project and package folders, if this is the case.
- Startup Visual3D
- Find that asset in Asset Explorer in Visual3D
- You can type the file name, like Model.scene or Model.mesh, into the search/filter box in the Asset Explorer toolbar startup Visual3D
- If you had exported to .scene format, you should find this under under Prefabs/ (for v0.9.7+, or "Objects/" or "Entities/" for v0.9.6 or earlier) asset group (top-level folder) in Asset Explorer
- Otherwise, if had just exported to .mesh format, you can find this under Media/Models (or just Models) folder in Asset Explorer
- You can use the Import Assets dialog from the Asset Explorer toolbar to show a dialog for finding asset files to copy into your world project, to make them available for use by Visual3D, if they aren't already shown in Asset Explorer
- Double click on that asset, to show it for editing in Entity Editor / Model Editor
- Preview it in Entity Editor and Configure & Optimize in Model Editor
- If had exported to .scene, you can preview the entire .scene prefab in Entity Editor (Entities > Entity tab), at least for v0.9.7 (possibly earlier as well), but you will only see a single part (represented by a .mesh file) in Model Editor (Entities > Model tab).
- If you don't see anything in Model Editor, or don't see the part you want to preview/edit, then select from the Selection drop-down at top-right corner of Model Editor, for the .mesh file you want to preview or edit.
- Optimize the Model
- For each .mesh (entire model when exporting to .mesh, or one part of the model when exporting to .scene), optimize it
- Select the Merge Parts by Material (or similar named) option in Model Editor
- This can have a huge impact on performance, greatly increasing it, because, by default each Geometry node/mesh/primitive in 3ds Max / Maya / XSI is considered a imported as a separate ModelPart, and each ModelPart can sometimes similar rendering overhead (reduction in FPS) as if it was a separate Actor / Model
- If you segment a model into multiple parts, as described for Technique 1, in some cases it can help performance, by allowing culling of each part (due to its being its own Actor) when that part isn't visible while other parts are visible.
- If your model is a building with an interior, you can setup collision for it as follows
- In the Model panel of Model Editor, for each model containing a floor (if it doesn't also contain a ceiling in same Model/.mesh file), set the Object Type (Physical Class) to Ground Surface to allow it to have per-polygon collision and to enable it to be a walkable/navigable surface for avatars.
- Other object types can usually be left with default Object Type of Obstacle.
- For other objects, like props you can set their type to Moveable Object if they should be able to physics-controlled (moved by physics forces/collisions).
- Any objects which have animated (eg. scene node/cinematic timeline-based) or scripted motion, and which shouldn't be physics-controlled (moved by physics forces) you should set their Object Type to Scripted Movement Object (or another type which results in Physical Type being set to something other than Static)
- Alternatively, if your ceiling is in the same model:
- Then you can set Physics.Physical = false (or Object Type = Non Physical or None) for the Building interior model(s)
- And then place (drag-drop from Asset Explorer) the Physics Hull assets (planes, spheres, etc. non-visible physics helper objects) into the scene, positioning them at walls, floors and ceilings
- Then set Object Type = Ground Surface for those Physics Hulls (Dummies/Helpers) used to represent floors.