Documentation/Articles/Overview of Model Import Editor
From NeoAxis 3D Engine Wiki
|Language:||English • Russian||Status:||Approved|
Model Import Editor is a component of the Resource Editor that enables import of various mesh formats into NeoAxis Engine. Note that special exporting software have been created for 3dsMax and Maya to import meshes from them. It also possible to use easy 3D model import and next continue importing with this editor.
Model Import Editor supports a large number of popular formats, including:
For the full list of supported formats, see below.
In order to import a three-dimensional model into the engine, you have to perform the following steps:
- create an import configuration file,
- open and configure the import configuration file (specify the necessary parameters for object position, configure animation, etc.),
- generate meshes and materials.
Generated meshes and materials will be synchronized with their source files. If a source file is modified, the generated meshes and materials will be updated automatically. If you manually edit a mesh or a material in Resource Editor, synchronization with the original model file will be removed and resources will no longer be automatically generated on update.
Unfortunately, import of vertex (morph) animation is not currently supported.
The column Export indicates formats to which engine models can be converted. To access this function, right-click on a .mesh file and select the Convert to another format option.
|Format||Static Meshes||Skeleton animation||Export|
|blend||Not all modifiers are supported. It's recommended that you import via FBX or DAE format from Blender.|
|ms3d||May cause a critical error|
In order to access Model Import Editor settings, select Tools -> Options in the main menu. Then select the Model Import Editor option in the opened window.
The General tab contains four parameters:
|Background Color||Background color.
Note: The background color is only visible when you are not using Sky Box.
|Show Axes||If this parameter is set to True, the engine displays coordinate axes.|
|Show Grid||If this parameter is set to True, the engine displays the grid. The default cell size is 1 meter.|
|Sky Box||Sky Box. A sky (skybox) to be displayed as background of the editor.|
In this section we will provide you with two tutorials on importing static and animated models to the engine.
The best formats to be used for model import is FBX and Collada. Read more about making file in an intermediate format in Export models from Blender, Autodesk Softimage and other packages.
Tutorial - Importing a Static Mesh
In this tutotial you will learn how to import static meshes into the engine.
First, create a configuration file for mesh import. To do this, select the original mesh file. In our tutorial it is ColladaTest.dae, which you can find in the following folder "Data\_ResourceEditorSamples\Importing3DModel\Stone". Next, right-click the file and select the Import Model.
Now, you have to proceed to import settings editing. To do this, double-click on the settings file (in our case it is ColladaTest.modelImport) or bring up the context menu and select the Edit.
When you proceed to editing, the Objects list containing all importable objects appears in the upper right corner. Select a source in the window. You can also select a source by clicking on it in the editor working area.
Right-click and select Create Mesh with Selected Sources in the context menu. This will add the mesh to the object list, as well as it will add a source to it. It is important to distinguish between the mesh and its sources. The mesh is an object created as a .mesh file, which is, in fact, an engine format model. On the other hand, sources are made into submeshes of the resulting mesh.
Now, you may need to adjust the position of the resulting mesh. Select the created mesh in the Objects window.
Let us set up the pivot for the mesh to be imported. To do this, select the "movement" tool in the main panel. In order to lower the pivot, pull Z axis down. This way you can adjust the mesh center.
You can also adjust position of a source in mesh coordinates. This may be useful when the resulting mesh contains several sources. Select a source in the Objects window.
Rotate the source. To do this, select the "Rotation" tool in the main panel. Pull the rotation axis in order to rotate the source 90 degrees around the Z axis.
Now, save your import settings by clicking on the Save button in the main menu.
Once import settings have been configured, proceed to generating the resulting files: mesh and material. To do this, click the Create Files button under the Properties window.
If importing succeeds, a corresponding text message will be displayed. New files will appear in the resource tree (in this tutorial they are ColladaTest.mesh and ColladaTestStoneStatic.highMaterial.
So, you have completed model exporting. In order to ensure that the files have been generated correctly, open the the mesh file. You can see that the model have been successfully imported. On this stage, our tutorial on import of a static model is complete.
Tutorial - Import of Animated Model
In this tutorial you will learn how to import an animated model into the engine. The file PigA.x will be used as a testing mode, which you can find in the following folder "Data\_ResourceEditorSamples\Importing3DModel\Animated".
The first part of this tutorial is the same as importing a static model as described in the previous tutorial. For this reason we omit it now.
After having set up mesh import, you have to configure animation. To do this, select the mesh and click the "..." button in the Animations field.
In the window that will appear, click Add to add a new animation track.
Now, specify an animation name, as well as start and end frames for it.
Use the same procedure to add the remaining animations. Click OK to proceed.
Next, you have to set the CreateSkeleton property value to True in order to create the skeleton during file generation.
Save your import settings by clicking on the Save button in the main panel.
Now, you only have to generate mesh, skeleton and material files. To do this, press the Create Files button under the Properties window.
If importing succeeds, a corresponding text message is displayed.
On this stage, model importing is complete. In order to ensure that files have been generated correctly, open the mesh file. You can see that model importing was successful.
This section contains description of import properties for scenes, meshes and sources.
Scene Import Properties
|SourceFile||Path to a source file of the model.|
|GenerateMaterials||Creation of material files. If this parameter is set to True, .highMaterial is created.|
|MaterialsNamePrefix||Prefix used with the names of created materials.|
|OverrideMaterialDirectory||Override the directory for materials. If the directory is not specified, all generated materials are saved to the directory with the original model. If the directory is specified, generated materials are saved to it.|
|RenameMaterials||Renamed materials list. The list includes initial names of materials as well as their new names.|
|MaxTextureCoordChannelCount||Maximum number of used texture channels. Default value is 4.|
|OverrideMeshDirectory||Override the directory for meshes. If the directory is not specified, all generated meshes are saved to the directory with the original model. If the directory is specified, generated materials are saved to it.|
|BaseMapFormat||The file format of base maps. If this parameter is set to Original, the initial texture format is used. If you specify a different value, the texture will be converted to the specified format.|
|GenerateTextures||If this parameter is set to True, textures are created.|
|NormalMapFormat||The file format of normal maps. If this parameter is set to Original, the initial texture format is used. If you specify a different value, the texture is converted to the specified format.|
|OverrideTextureDirectory||Override the directory for textures. If the directory is not specified, all textures will be copied to the directory with the original model. If the directory is specified, the textures will be copied to it.|
|AllowMergeSubMeshes||If this parameter is set to True, submeshes with the same material and vertice format are merged into one.|
|EdgeList||Import of the edge list. If this parameter is set to True, meshes will be generated with an edge list. This data is required for stencil shadows.|
|MergeCloseVertices||Allow merging close vertices.|
|The maximum radius between two close vertices. It is used with the tab MergeCloseVertices. If the radius between two vertices is less than the set value, the vertices are considered to be close to each other and can be merged.|
|Tangents||Import tangent vectors. If this parameter is set to True, meshes will be imported with tangent vectors. This data is required for normal maps.|
|VertexColors||Import vertex colors. If this parameter is set to True, meshes will be imported with vertex colors.|
|PivotPosition||Coordinates of the mesh pivot after import.|
|PivotRotation||Rotation of the mesh pivot after import.|
|Animations||The animation list of the imported mesh. Each animation has a name, a number of opening and closing frames.|
|AnimationSpeed||If this parameter is set to 1, the original animation speed is used.|
|CreateSkeleton||If this parameter is set to True, a mesh skeleton (if it is available) is also imported.|
|FrameStep||Sampling frequency for animation frames. If this parameter is set to 0, sampling is turned off.|
|InterpolationError||Interpolation error for animation. This parameter is used for animation optimization (reduction of the number of key frames). If this parameter is set to 0, the optimization is turned off.|
|RemoveUnusedBones||If this parameter is set to True, bones of the mesh skeleton that are not conected with vertices are removed.|
|LODsCount||Number of levels of detail for the model. You can learn more about LOD creation in description of meshes editor. By default, LOD generation is turned off.|
|LODsDistance||Camera distance for the next LOD level.|
|LODsReduction||Percentage of polygons removed at the next LOD level in comparison to the previous one.|
|AllowCollision||If this parameter is set to True, submesh collisions are allowed. In future this parameter will be used with the Physics System.|
|TextUserDictionary||User text information addded to the generated submesh. The information is a list of elements in the key - value form.|
|UVUnwrapChannel||A channel containing UVUnwrap. If set to None, the UVUnwarp channel will not be specified. Otherwise, the specified channel will be used. UVUnwrap is required for static lighting.|
|InvertNormals||If this parameter is set to True, normals are inverted.|
|InvertUCoordinate||If this parameter is set to True, the U texture coordinate for this source is inverted.|
|InvertVCoordinate||If this parameter is set to True, the V texture coordinate for this source is inverted.|
|OverrideMaterial||Ovverride the material name. If material is not specified, the material of the original model is used. Otherwise, the specified material is used.|
|Name||Name of the source.|
|Position||Position relative to the parent mesh. This parameter is ignored if a skeleton file is generated.|
|Rotation||Rotation relative to the parent mesh. This parameter is ignored if a skeleton file is generated.|
|Scale||Scale relative to the parent mesh. This parameter is ignored if a skeleton file is generated.|