Documentation/Tutorials/Export models from Autodesk 3ds Max

From NeoAxis 3D Engine Wiki

Jump to: navigation, search
Go to higher level

Contents

Introduction

In this tutorial, we are going to learn how to export models and materials from Autodesk 3ds Max.

The NeoAxis Engine Exporter plugin for 3ds Max will be used. This plugin is intended to export 3D models, materials, animations as well as full scenes consisting of several objects.

There is an alternative way of exporting models using Model Import Editor, however, using the NeoAxis Engine Exporter is recommended.

The plugin exports files of the following type:

  • .mesh — 3D models format,
  • .skeleton — stores the skeleton and animations data,
  • .highMaterial — material,
  • .scene — Scene file used to import a group of objects in Map Editor.
MaxExporter 027.jpg

Installation and Configuration

Installation

To install the exporter go to the SDK\Tools\Exporters\3dsMax folder and run NeoAxisEngineExporterInstaller_3dsMax.exe. If User Account Control is enabled, you should run the installer with administrative privileges.

MaxExporter 001.jpg

Check the 3ds Max versions you want to install the exporter for and press the Install button. When the installation is complete, an installation success message will be displayed.

MaxExporter 002.jpg

Now that the installation is complete, we can have a look at the exporter configuration.

Configuration

Run 3ds Max. For convenince, we will place a quick launch button for the exporter in the utilities menu. To do this, move to the Utilities tab and press the Configure Button Sets button.

MaxExporter 003.jpg

In the configuration window, locate the NeoAxis Engine Exporter in the utilities list on the left and drag it on a button you don't use in the list on the right.

MaxExporter 004.jpg

Now that you have a NeoAxis Engine Exporter button on the right side of the window, click OK.

MaxExporter 005.jpg

Congrats, we now have a quick access to the NeoAxis Engine Exporter in the Utilities tab! Press the NeoAxis Engine Exporter button, and in the export menu below press the Configure Export button to go to the export settings.

MaxExporter 006.jpg

In the popup window, specify the Data folder path of the engine. To do this press the "..." button on the top of the window. In the folder selection dialog that appears specify the path to the Data folder. All the exported objects will be placed in this folder or it's subfolders. The path to the Data folder is a global export setting and is used for all scenes. All the other export settings (such as objects, meshes animations etc.. export settings), are scene specific and are stored inside the .max file.

MaxExporter 007.jpg

Exporting Static Models

Let's now see how to export a static 3D model. For this example, we will export a house mesh.

The first thing to do is to open the Utilities tab, and click on NeoAxis Engine Exporter, and press the Configure Export button.

MaxExporter 008.jpg

Now, add a scene object to the exported objects list. To do this, press the "+" button on the left of the window.

MaxExporter 009.jpg

In the popup window, select the object you want to export.

MaxExporter 010.jpg

Each object have a list of settings. Leave the default settings and press the OK button.

MaxExporter 011.jpg

Export settings are stored directly in the scene file (.max).

To export the object, you now need to click the Export button located in the Main group.

MaxExporter 012.jpg

In the popup window, press the Export! button.

MaxExporter 013.jpg

In the export window, information about the exported object is displayed, as well as any errors that might show up during the process. If there are no errors, when the export is finished, you will see the following message: "Export successfully finished!".

Simply close the window to finish.

MaxExporter 014.jpg

You can see your exported mesh in the Resource Editor.

MaxExporter 015.jpg

Exporting Animated Models

In this section we are going to export from 3ds Max a model with skeletal animation. For the example, we will use the Girl.type model, available in the SDK. The Original model, Girl.max can be found in the SDK\Tools\Exporters\3dsMax\Examples\Girl folder.

Go to the Utilities tab, and in the NeoAxis Engine Exporter menu, press the Configure Export button, to open the export settings window.

MaxExporter 016.jpg

Add the Girl object to the export list. Then select it in the Objects list. One selected, you will find all the object specific export settings on the right side of the window.

As this model has a skeleton, you need to set the Export Skeleton property to True.

To export animations, it's necessary to set a list of animations you want to export. To do this, press the "..." button in the Animations field.

MaxExporter 017.jpg

To add an animation to the list, use the Add button. Every animation is characterised by a unique name, format, as well as it's first and last frames. All these parameters must be specified for each animation. When the list is set, press the OK button.

MaxExporter 018.jpg

To finish editing export settings, press the OK button in the settings window.

To export the object, you now need to click the Export button located in the Main group. In the window that appears, press the Export! button. When the export is finished, press the Close button.

MaxExporter 019.jpg

You can now see the result in the Resource Editor.

MaxExporter 020.jpg

Exporting a Scene (Group of Meshes)

Exporting a scene is an easy way to add a group of object to a map. During scene export, in addition to exporting model files, the exporter will create a .scenefile. It stores object position data in the scene as well as other information. You can then import the .scene file directly in the Map Editor.

As an example, we will export a scene consisting of three objects: building, haystack and cart. Go to the Utilities tab, and in the NeoAxis Engine Exporter menu, press the Configure Export button, to open the export settings window.

MaxExporter 021.jpg

Add all the objects of your scene to the list. In our case, there are three objects. You also need to enable the export scene setting. To do this, select the root object Objects and set the value of the Export Scene property to True.

MaxExporter 022.jpg

All information about the objects position is stored in the scene file, that is why objects must be exported without global transformations. To achieve this, we need to set the Apply World Transform property to False for each object.

MaxExporter 023.jpg

Save the export settings by pressing the OK button.

To export the object, you now need to click the Export button located in the Main group. In the window that appears, press the Export! button. When the export is finished, press the Close button.

MaxExporter 024.jpg

When the export is finishedn you will need to import the scene in the Map Editor.

Run the Map Editor. To import the .scene file, use the File -> Scene File Import -> Import objects menu. In the popup window, select the Objects.scene file.

MaxExporter 025.jpg

The scene objects you exported from 3dsmax will now be in your scene, with just a few clicks!

MaxExporter 026.jpg

Export Settings

MaxExporter 028.jpg

The Settings group of the export menu allows you to do several actions, which are described below:

Parameter Description
Import Load the export settings from a file.
Export Save the export settings to a file.
Clear Clear the export settings of the file.

Full Export Description

There are a numerous parameters in the export settings. They are divided into general export settings and object settings and combined in groups

General Settings

You can modify the general settings by selecting the root object Objects in the export settings window.

Materials properties:

Parameter Description
Export Materials Enable/disable materials export. If set to "True", models will be exported with materials assigned to them.
Materials Directory The directory where you want the materials to be exported. It's relative to the "Data" directory. If the path is not specified, the materials will be exported to the "Data" folder.
Materials Name Prefix The prefix, added to the material's names. This property is recommended in order to avoid problems with duplicated material names for exported content.

Meshes properties:

Parameter Description
Max TexCoord Channel Count The maximum number of texture channels per meshes.
Meshes Directory The directory where you want the meshes to be exported. It's relative to the "Data" directory. If the path is not specified, the meshes will be exported to the "Data" folder.

Scenes properties:

Parameter Description
Export Scene Enable/disable the scene export. If set to True, a .scene file is exported together with models, which can be used to quickly import all the exported object on your map, in the Map Editor.
Scene Scale The scale factor of the scene objects. Used when importing in the Map Editor.
Scenes Directory The directory where you want the scene file to be exported. It's relative to the "Data" directory. If the path is not specified, the scene will be exported to the "Data" folder.

Textures properties:

Parameter Description
Base Map Format The file format you would like to use for your textures. Does not affect normal maps.
Export Textures Enable/disable texture export. If set to "'True"', models and materials will be exported with textures assigned to them.
Normal Map Format The file format you would like to use for your normal maps
Textures Directory The directory where you want the textures to be exported. It's relative to the "Data" directory. If the path is not specified, the textures will be exported to the "Data" folder.

Object Settings

General properties:

Parameter Description
Allow Merge Sub Meshes Enable/disable merging submeshes. If set to "'True"', then all submeshes of a model that have the same material are merged together.
Edge List Enable/disable the export list of ribs. If set to "'True"', then the mesh is exported with a list of his ribs. These details are only required for stencil shadows, which are no longer supported...
Merge Close Vertices Enable/disable merging of closely spaced vertices. If set to "'True"', in order to optimize the mesh, close vertices are merged together. To determine if a vertice should be merged with another, the exporter will check if the distance between them is lower than the value specified in the Merge Close Vertices Radius parameter.
Merge Close Vertices Radius Merge vertices threshold. If the distance between two vertices is lower than the specified value, the vertices are merged. Is used if Merge Close Vertices is enabled .
Sub Directory Subdirectory the object will be exported to. The path is relative to the general mesh export folder. If no value is specified, the object will be exported with the other mesh in the general mesh export folder(see parameter Meshes Directory of general settings).
Name 3D model file name.
Tangents Enable/disable export of the tangent vectors channel. These data are necessary for normal mapping.
Vertex Colors Enable/disable export of vertex colors. If set to "'True"', then for each vertex, it's color will be exported.

Transform properties:

Parameter Description
Apply World Transform Enable/disable the use of global transformation. If set to "'True"', then each mesh applies a global transformation in the scene.
Scale The scale factor of the model.

Animation properties:

Parameter Description
Animations List of model animations.
Export Skeleton Enable/disable skeleton export. If set to "'True"', a skeleton file is exported with the model.
Frame Step The exported frames of animation. This value indicates how many frames of animation in the modeling package will be 1 frame of animation in the exported model.
Morph Interpolation Error The error of interpolation when calculating the key frames in the morph animation. The higher the value is , the less key frames there will be and, and the smaller the file size of the model will be. The smaller the value is, the more keyframes the animation will have and the more defined it will be. The model file size will also increase.

LODs properties:

Parameter Description
LODs Count The number of LODs (simplified copies of the mesh with fewer polygons) of the object. About LOD creation, you can learn more about it here.
LODs Distance Distance to the camera at which appears the next LOD.
LODs Reduction The percentage of faces this LOD will havecompared to the previous LOD.

Scene Export Only properties:

Parameter Description
Allow Decals Enable/disable decals for this object. If decals are enabled, they will be displayed on the object (for example, bullet impacts, explosions).
Cast Dynamic Shadows Enable/disable dynamic shadows casting for this object.
Cast Static Shadows Enable/disable static shadows (lightmap) casting for this object.
Collision Enable/disable collisions with the object. If the collisions are disabled, the other physics bodies (e.g., characters) will pass through the object.
Collision Material Name The name of the physical material. You can specify one of the four standard physical materials "Metal", "Wood", "Rubber", "Ice". It is also allowed to specify the names of the physical materials that you would haev previously created. This parameter affects the properties of physics bodies. For example, if you export the mailbox and set this parameter to Ice, if you ush it in simulation mode, the drawer will ride and slide like if it was on ice.
Collision Special Mesh Name Mesh used to calculate collisions. By default, the collision mesh will be a copy of the mesh itself. This property can be used to simplify collision calculations for complex physics objects. You can specify a custom collision mesh here.
Force Material Define the object material. If a material name is specified here, instead of the original 3D model material, you will use the specified one.
Receive Static Shadows Enable/disable the ability to receive static shadows. If set to "True", the shadows cast by other objects will be drawn on this model.
Rendering Distance The distance at which the object will not be rendered anymore. If set to "0", the object will always be drawn.
Render Queue Group Rendering order of this object relative to other objects.
Split Geometry Enable/disable automatic mesh cutting into small pieces. The size of the pieces is controlled by the "Split Geometry Size" parameter. This allows the manager to filter out the geometry that has not appeared on the screen. This parameter is useful only for very large objects. For example, rooms, buildings, with a character inside.
Split Geometry Piece Size The cell size of the cutting. The higher the value is, the larger the cell is. Is used if Split Geometry is enabled.

Submesh Settings

In addition to the object's settings, you can configure submeshes settings. To access them, you need to click the little (+) button next to the mesh name in the objects list and select a submesh.

General properties:

Parameter Description
Allow Collision Enable/disable collisions calculation for this submesh. If the collisions are disabled, the other physics bodies (e.g., characters) will pass through this part of the object.
Text User Dictionary Used to store custome text values. Allows you to add a list (with the "key" — "value" parameters) that contains text information . Used by developers.
UV Unwrap Channel The channel of the texture coordinates used by the submesh.

Geometry properties:

Parameter Description
Invert Normals Enable/disable normals inversion.

Material properties:

Parameter Description
Override Material Material name is for overriding the source material. If a material name is specified here, instead of the original 3D model material, you will use the specified one.

Animation Settings

To edit the animation settings, you need to click on the "..." button in the "Animations" field. The settings you will find are used to configure each animation the model will have.

Each animation (element of the animation list) has the following characteristics:

Parameter Description
_Name Animation name.
Disable Bones List the bones that you want to exclude from the export. The bones in the list must be separated by the symbol ';'.
Format The format of the animation. You can choose between the following values: "'Skeleton' (skeletal animation), "'Morph"' (vertex animation), "'Pose"' (pose animation), "'SkeletonAndMorph"' (combined skeletal and vertex animation), "'SkeletonAndPose"' (combined skeletal and pose animation).
Frame Begin Start frame of the animation.
Frame End End frame of the animation.

Material Export

NeoAxis Engine Exporter can export the basic 3ds Max materials properties. The properties available for export are given in the table below

Material parameter NeoAxis Engine Material parameter 3ds Max
Diffuse1Map The texture is assigned to the parameter Diffuse Color.
DiffuseColor If a texture is assigned to the material for the Diffuse Color parameter,it will use the "'Amount"' value. If there's no texture, the color parameter "'Diffuse Color will be used.
SpecularMap The texture is assigned to the Specular color parameter.
SpecularColor If a texture is assigned to the material for the Specular level parameter,it will use the "'Amount"' value. If there's no texture, the color parameter Specular Color will be used.
SpecularShininess Is calculated by 3ds Max based on the Specular Level, Glossiness and Soften parameters.
EmissionMap The texture is assigned to the Self-Illumination parameter.
EmissionColor If a texture is assigned to the material for the Self-Illumination parameter,it will use the "'Amount"' value. If there's no texture, the color parameter Self-Illumination will be used , if it has been entered. Else the value of Self-Illumination"' will be used if not color is specified.
NormalMap The texture is assigned to the Bump parameter.

In addition, when you export the materials, the Opacity and 2-Sided parameters are taken into account.

In NeoAxis Engine materials, transparence is influenced by two parameters: Blending and the alpha-channel of the DiffuseColor parameter. Blending defines how the transparence is handled and the alpha-channel of the DiffuseColor specifies a degree of transparence. If the property 2-Sided is enabled, then NeoAxis parameter DoubleSided will also be enabled.