Documentation/Tutorials/Export models from Autodesk Maya
From NeoAxis 3D Engine Wiki
|Language:||English • Russian||Status:||Not Approved|
In this tutorial, we are going to learn how to export models and materials from Autodesk Maya.
The NeoAxis Engine Exporter plugin for Maya 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.
Installation and Configuration
To install the exporter go to the SDK\Tools\Exporters\Maya folder and run NeoAxisEngineExporterInstaller_Maya.exe.
With enabled User Account Control you should run the installer with administrative privileges.
Check the Maya, 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.
Now that the installation is complete, we can have a look at the exporter configuration.
The menu NeoAxis Engine in the main menu of Maya is served to access the functions of the exporter.
To configurate the exporter you need to choose in the menu NeoAxis Engine -> Configure Export.
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 popup window of selecting the directory, specify the path to the folder Data.
All the exported objects will be placed in this folder Data 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 belong to a particular scene and saved inside the scene file
Exporting Static Models
Let's now see how to export a static 3D model. For this example, we will export a house mesh.
First open the window of the settings export using the menu item NeoAxis Engine -> Configure Export.
Now, add a scene object to the exported objects list. To do this, press the "+" button on the left of the window..
In the popup window, select the object you want to export.
Selecting the object in the list, you can change the export settings in the properties menu on the right pertaining to it. We will leave the default settings and press the button OK, when you finish editing the export settings.
The export settings of the scene are stored simultaneously with the preservation of the scene and stored inside the scene file (.mb, .ma).
Proceed directly to the export facilities. In the menu select NeoAxis Engine -> Export.
In the popup window press the button Export!.
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.
You can see your exported mesh in the Resource Editor.
Exporting Animated Models
In this section we are going to export from Maya a model with skeletal animation. For the example, we will use the Girl.type model, available in the SDK. Let's open the window of export setting with a help of NeoAxis Engine -> Configure Export.
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.
To add an animation to the list, use the Add button. To remove the animation, click Remove. 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.
To finish editing export settings, press the OK button in the settings window.
To export models to the export menu, you now need to select NeoAxis Engine -> Export. In the window that appears, press the Export! button, when the export is finished, press the Close button.
You can now see the result in the Resource Editor.
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 .scene file. 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.
Let's open the export settings window. To do this select in the main menu NeoAxis Engine -> Configure Export.
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.
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.
Save the export settings by pressing the OK button. After this in the menu NeoAxis Engine select the item Export. To run the object export and the scene file, press the button Export!.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.
The scene objects you exported from Maya will now be in your scene, with just a few clicks!.
In the exporter menu you can find the button to work with the export settings of the scene. Presented functions, for example, allow to transfer settings from one scene and upload them to another.
Available actions, which are described below:
|Import Settings||Load the export settings from a file.|
|Export Settings||Save the export settings to a file.|
|Clear Settings||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.
You can modify the general settings by selecting the root object Objects in the export settings window.
|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.|
|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.|
|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.|
|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.|
|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.|
|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.|
|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 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:
|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.|
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.
|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.|
|Invert Normals||Enable/disable normals inversion.|
|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.|
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:
|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.|
NeoAxis Engine Exporter For Maya supports the export properties of the following types of materials:
- Layered Shader (only first layer is used)
- Surface Shader
The compliance properties of materials NeoAxis Engine and Maya materials are listed in the table below:
|Material parameter NeoAxis Engine||Material parameter Maya|
|Diffuse1Map||The texture is assigned to the parameter Color (Out color for Surface Shader).|
|DiffuseColor||If a texture is assigned to the material for the Color parameter, it will use the "'Amount"' value. If there's no texture, the color parameter Diffuse Color (Out Color for Surface Shader) will be used.|
|SpecularMap||The texture is assigned to the Specular color parameter. Used in materials like Blinn, Phong и Anisotropic.|
|SpecularColor||If a texture is assigned to the material for the Specular Color parameter, it will use the Color Gain. If there is no texture, the color parameter Specular Color will be used. Used in materials like Blinn, Phong и Anisotropic.|
|SpecularShininess||In materials like Blinn is used Eccentricity parameter. In materials like Phong и Anisotropic is used the default value, 127.|
|EmissionMap||The texture is assigned to the Ambient Color. Used in materials like Blinn, Phong, Anisotropic и Lambert.|
|EmissionColor||If a texture is assigned to the material for the Ambient Color parameter, it will use the Color Gain. If there's no texture, the color parameter Ambient Color. Used in materials like Blinn, Phong, Anisotropic и Lambert.|
|NormalMap||The texture is assigned to the Bump Mapping parameter. Used in materials like Blinn, Phong, Anisotropic и Lambert.|
In addition, when you export the materials take into account the parameter Transparency, indicating the transparency of the material. In NeoAxis Engine materials transparency is influenced by two parameters: AlphaBlend and the alpha parameter DiffuseColor. AlphaBlend includes transparency, alpha channel of DiffuseColor specifies the degree of transparency..