Documentation/Tutorials/Export models from Autodesk 3ds Max

From NeoAxis Engine Wiki

Jump to: navigation, search
Go to higher level
Max export1.jpg

Contents

Introduction

In this article, we shall demonstrate how to export models and materials from the Autodesk 3ds Max.

The NeoAxis Engine SDK contains an exporter that supports exporting from 3ds Max. You can use it to export models, materials, animation, and complex scenes consisting of multiple objects.

The exporter will export the files in the following formats:

  • .mesh - the format of three-dimensional models. Format OGRE mesh.
  • .skeleton - a skeleton format for storing models. Format OGRE skeleton.
  • .highMaterial - a material format in the NeoAxis Engine.
  • .scene - an intermediate format for the import of a scene (a group of objects in the map editor).


Installation

To install the exporter, go to the SDK\Tools\Exporters\3dsMax folder and run NeoAxisEngineExporterInstaller_3dsMax.exe.

Max export2.jpg

Check the versions of 3ds Max that you have installed on your machine and click Install. When the installation is complete, you will receive the following message.

Max export3.jpg

Once this installation is completed, the exporter is ready to use.

Exporting a static model

As an example, lets export a sphere object with its texture from 3ds Max.

Max export4.jpg

The first step is to configure the menu of the exporter. Click on the tab, Utilities, and then click Configure Button Sets.

Max export5.jpg

In the window that appears, select the NeoAxis Engine Exporter from the left Utilities list and drag it to the place of one of the elements in the right Utilities list. Then click the OK button.

Max export6.jpg

Now the NeoAxis Engine Exporter will be available in the Utilities list.

Max export7.jpg

Now you can click the NeoAxis Engine Exporter button and click on Settings.

Max export8.jpg

The first thing you need to do is specify the path to the directory "Data" of your project. The exported model and material will be located here. To select a folder to export, click on the "...".

Max export12.jpg

This will now enable you to export the models to the same directory. To add a field to the list of exported objects, click the + button.

Max export9.jpg

In the object list, select the item you wish to export and click OK.

Max export10.jpg

Once the item is added to the list of objects, the configuration is complete. Press OK.

Max export11.jpg

Now we return to the Utilities tab. With NeoAxis Engine Exporter tab selected , click Export.

Max export13.jpg

To start the conversion, click on the Export! button in the pop-up window.

Max export14.jpg

The conversion process now takes places and resulting messages will appear in the window. Once you see the line "Export is successfully finished!" the export process has finished.

Max export15.jpg

To view the result of the export process, open the Resource Editor and check the object.

Max export16.jpg

Export animated models (for example, skeletal animation)

Max export17.jpg

The major difference in the export of an animated model from a static model is that you have to specify the list of animations that you wish to export. To do this, you should set the Animations property of the object to be exported in the Settings window.

Max export18.jpg

Add to the list all the required animations.

Max export19.jpg

Each animation is characterized by a unique name, type, start frame and end frame. All these parameters must be specified for each animation. Finally, if you wish to export skeletal animation, set the property ExportSkeleton to True. This property is responsible for exporting the file with a skeleton three-dimensional model.

Max export20.jpg

Now the animated model is ready to be exported.

Max export21.jpg

Export a scene (group of meshes)

NeoAxis engine supports the export of a scene created in 3ds Max. This will export all the objects along with the relative positions of the objects in the scene. This is stored in an intermediate file format .scene. The exported scene can be directly imported in to the Map Editor. Let us consider an example with three entities in our scene.

Max export22.jpg

You must add all the objects that you want to export to the list in the Settings window. In our case, this will include the three primitives in our scene. In addition, you must set the ExportScene property to True. These and other scenes settings are available when you select the root object in the list.

Max export23.jpg

For each exported object, you must set the ApplyWorldTransform property to False. This is necessary so that the object is exported without a global transformation, which will be stored in a scene file.

Max export24.jpg

Now all we must do is export the scene and import it in the Map Editor. Import the scene by selecting Import objects in the Scene File Import menu, which, in turn, is located in the File menu.

Max export25.jpg

The scene objects will appear on the map as static objects.

Max export26.jpg

Full description

A large number of different parameters are present while exporting objects. These parameters are divided into general settings and object settings. At the same time, all settings are grouped by type.

General Settings

Material

Parameter Description
ExportMaterials If set to True, the materials are exported along with the object.
MaterialsDirectory Path to the directory where the materials are exported. It is relative to the "Data" directory. If no path is specified, the materials are exported to the "Data" directory.

Meshes:

Parameter Description
MeshesDirectory Path to the directory where the meshes are exported. It is relative to the "Data" directory. If no path is specified, the meshes are exported to the "Data" directory.

Scenes:

Parameter Description
ExportScene If true, the models are exported to an intermediate file format . scene, with which you can quickly import all the objects in the scene on the map in Map Editor.
SceneScale The factor with which the scene should be scaled. This is used to adequately represent the scene in the Map Editor.
ScenesDirectory Path to the directory where the scene is exported. It is relative to the "Data" directory. If no path is specified, the scene is exported to the "Data" directory.

Textures:

Parameter Description
BaseMapFormat Format in which the textures are converted, except for normal maps.
ExportTextures If true, the textures will be exported along with the object.
NormalMapFormat Format to convert the normal map.
TexturesDirectory Path to the directory where the textures are exported. It is relative to the "Data" directory. If no path is specified, the textures are exported to the "Data" directory.

Object Settings

General:

Parameter Description
AllowMergeSubMeshes If true, submeshes that have the same material and vertex channels will be be merged to one.
EdgeList If true, the mesh is exported with a list of its edges. This is only needed for stencil shadows.
Name The name of the object scene.
Tangents If true, the mesh will be exported along with PTT. This is only needed for normal maps (Normal Mapping).
VertexColors If true, the top mesh will be exported along with its assigned colors.

Transform:

Parameter Description
ApplyWorldTransform If true, the mesh uses global transformation. Thus the top of the mesh is placed in the same coordinates as on the stage.
Scale Scaling factor of the object.

Animation:

Parameter Description
Animations List of animated models.
ExportSkeleton If true, the model is exported with the file skeleton.
FrameStep This value indicates how many frames of animation in the simulation package will account for an animation frame in the exported object.
MorphInterpolationError Interpolation error in calculating the key frames in the morph animation. When the value is greater, key frames are smaller and, accordingly, the file size of the model is smaller. When the value is less, animation is better, but the key frame will be bigger and the file size of the model will increase.

LODs:

Parameter Description
LODsCount The number of LODs(simplified copies with fewer polygons) on an object. More details about the automatic creation of LOD can be found here.
LODsDistance Distance to the camera, after which the next level of LOD begins.
LODsReduction Percentage of faces, removed at the LOD, compared to the previous.

Scene Export Only:

Parameter Description
AllowDecals Enables / disables the attachment of decals to the object. If disabled, the decals will not appear (for example, traces of bullets and explosions).
CastDynamicShadows Enables / disables the generation of dynamic shadows on the object.
CastStaticShadows Enables / disables the generation of static (lightmaps) shadows on the object.
Collision Enables / disables the collision properties of the object. If disabled, other physical bodies (eg characters) will pass through this object.
CollisionMaterialName This parameter affects the properties of the interaction of physical bodies. Choose from 4 values - Metal, Wood, Rubber, Ice. For example, if you set this parameter to Ice for a card box and approach it and push it, the character will ride and slide like on ice.
CollisionSpecialMeshName This option allows you to change the geometry of the collision of the object. This can be used to facilitate the rendering of complex physical objects. If you specify a different mesh, then the collisions will compute it exactly, and it will be on a visible mesh specified by MeshName.
ForceMaterial Choose to specify a different material for the object.
ReceiveStaticShadows Allows you to draw shadow on this object. If enabled, the shadows cast by other objects will be drawn on the object.
RenderingDistance This option allows you to specify the distance, after which the object is not drawn. If the value is set to 0 it will be drawn at all times.
RenderQueueGroup Defines the rendering of the object relative to other objects.
SplitGeometry This option allows you to automatically cut the mesh into small pieces as defined by the SplitGeometrySize. This allows the scene manager to clip the geometry of the objects that do not fall into the screen in a better way. This is used for large objects (such as rooms, buildings, in which a character will appear).
SplitGeometryPieceSize This option allows you to specify the size of the cells cut. The higher the value, the larger cell. See SplitGeometry.

Export of materials

The table below presents a mapping of the NeoAxis Engine Exporter parameter to the 3DS max material parameter.

NeoAxis Engine 3DS Max
Diffuse1Map Structure and assignment of Diffuse Color.
DiffuseColor If the material texture is assigned to the parameter Diffuse Color, then it uses its Amount. If there is no texture, then uses the color option Diffuse Color.
SpecularMap Structure and assignment of Specular color.
SpecularColor If the material texture is assigned to the parameter Specular Color, then it uses its Amount. If there is no texture, then uses the color option Specular Color.
SpecularShininess Calculated by 3DS Max based on the Specular Level, Glossiness and Soften parameters .
EmissionMap Structure and assignment of Self-Illumination.
EmissionColor If the material texture is assigned to the parameter Self-Illumination, then it uses its Amount. If there is no texture, then uses the color option Self-Illumination or the value of Self-Illumination if no color is specified.
NormalMap Structure and assignment of Bump.

In addition, the export of materials takes into account the Opacity and 2-Sided parameters. The materials in the NeoAxis Engine for transparency is influenced by two parameters: AlphaBlend and the alpha parameter DiffuseColor. AlphaBlend includes transparency and the alpha channel in DiffuseColor indicates the degree of transparency. If the 2 -Sided property is enabled then the NeoAxis DoubleSided material parameter is set to on.