Documentation/Tutorials/Export models from Autodesk Maya

From NeoAxis Engine Wiki

Jump to: navigation, search
Go to higher level
Maya exporter 1.jpg

Contents

Introduction

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

The NeoAxis Engine SDK contains an exporter that supports exporting from Maya. 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\Maya folder and run NeoAxisEngineExporterInstaller_Maya.exe.

Maya exporter 2.jpg

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

Maya exporter 3.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 Maya.

Maya exporter 4.jpg

Access the exporter functions via the main menu toolbar of Maya.

Maya exporter 5.jpg

You need to prepare a scope to export. To do this, go to the settings by clicking Settings in the NeoAxis Engine menu.

Maya exporter 6.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 "...". 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.

Maya exporter 7.jpg

A window appears with a list of objects available for export. In the object list, select the item you wish to export and click OK.

Maya exporter 8.jpg

The object is now added to the list of the exporter.

Maya exporter 9.jpg
Once these settings are finished, you need to click OK in the options window, so they take effect. To begin the export of the models, click Export in the NeoAxis Engine menu. Now click Export in the popup window.
Maya exporter 10.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.

Maya exporter 18.jpg

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

Export animated models (for example, skeletal animation)

Maya exporter 19.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.

Maya exporter 13.jpg

Add to the list all the required animations.

Maya exporter 11.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 ExportSkeleton property to True. This property is responsible for exporting the file with a skeleton three-dimensional model.

Maya exporter 12.jpg

Now the animated model is ready to be exported.

Maya exporter 20.jpg

Export a scene (group of meshes)

NeoAxis engine supports the export of a scene created in Maya. 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.

Maya exporter 17.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.

Maya exporter 14.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 file stage.

Maya exporter 21.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.

Maya exporter 15.jpg

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

Maya exporter 16.jpg

Full description

A large number of different parameters are available 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

Materials:

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

NeoAxis Engine Exporter for Maya allows the export of the properties of the following types of materials:

  • Phong
  • Anisotropic
  • Blinn
  • Lambert
  • Layered Shader (only the first layer)
  • Surface Shader

The table below presents a mapping of the NeoAxis Engine Exporter parameter to the Maya material parameter.

NeoAxis Engine Maya
Diffuse1Map Structure and assignment of Color (Out color of Surface Shader).
DiffuseColor If the material texture is assigned to the parameter Color, then it uses its Color Gain. If there is no texture, then uses the color option Color. (Out Color of Surface Shader).
SpecularMap Structure and assignment of Specular color. Used in materials such as Blinn, Phong and Anisotropic.
SpecularColor If the material texture is assigned to the parameter Specular Color, then it uses its Color Gain. If there is no texture, then uses the color option Specular Color. Used in materials such as Blinn, Phong and Anisotropic.
SpecularShininess The Eccentricity parameter of the Blinn material is used. In materials such as Phong and Anisotropic uses the default value is 127.
EmissionMap Structure and assignment of Ambient Color . Used in materials such as Blinn, Phong, Anisotropic and Lambert.
EmissionColor If the material texture is assigned to the parameter Ambient Color, then it uses its Color Gain. If there is no texture, then uses the color option Ambient Color. Used in materials such as Blinn, Phong, Anisotropic and Lambert.
NormalMap Structure and assignment of Bump Mapping. Used in materials such as Blinn, Phong, Anisotropic and Lambert.

Besides the export of materials, the Transparency parameter is taken into account, indicating the transparency of the material. 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.