MeshImport
MeshImport is a tool for converting formats of geometry and animation data.
MeshImport tool is used:
- to convert meshes of external formats to Unigine-supported mesh formats.
- to upgrade the Unigine-based project meshes, which are outdated, to the up-to-date mesh formats.
You can use the Unigine upgrade script for batch upgrading of the outdated meshes.
Usage
To invoke MeshImport, run meshimport_x86.exe (in Windows), meshimport_x86 (in Linux) or meshimport_x86.macos (in Mac OS X) from the command line (the Windows command prompt and the Linux/Mac OS X Terminal) (the 64-bit version has x64 postfix).
- Under Windows, type at the command prompt:
meshimport_x86.exe OPTIONS FILE
- Under Linux, type into the Terminal:
meshimport_x86 OPTIONS FILE
- Under Mac OS X, type into the Terminal:
meshimport_x86.macos OPTIONS FILE
Command-Line Options
MeshImport recognizes the following command-line options:
-
-o NAME
— name of the output file.
If the -o option is not specified, the default file extensions are used:
- For a static mesh, the output file has the input file name and the .mesh extension.
- For a skinned mesh the output file has the input file name and the .smesh extension.
Only skinned meshes of the MD5MESH, MD5ANIM, MD5B and ANIMB formats can be converted to the SMESH or SANIM formats. If the -o option is not specified, skinned meshes of this formats are converted to the SMESH. - -s SCALE — scale a mesh. The default is 1.0, no scaling. The option value is float.
- -tx VALUE — translate a mesh along X axis. The option value is a float number.
- -ty VALUE — translate a mesh along Y axis. The option value is a float number.
- -tz VALUE — translate a mesh along Z axis. The option value is a float number.
- -f — flip Y and Z mesh axes.
Input Data Formats
The following formats of geometry and animation data can be converted by MeshImport:
- 3ds Max (3DS)
- LightWave Objects (LWO)
- Wavefront (OBJ)
- ASCII Scene Export (ASE)
- COLLADA (DAE)
- Quake 3 level model (BSP)
- Doom 3 level model (MAP)
- Quake 2 level model (MD2)
- Doom 3 skinned model (MD5MESH)
- Doom 3 animation (MD5ANIM)
- QuakeWars skinned model (MD5B)
- QuakeWars animation (ANIMB)
Output Data Formats
The following output formats are supported:
- Unigine mesh (MESH)
- Unigine skinned mesh (SMESH)
- Unigine animation for skinned mesh (SANIM)
Examples
Convert an External Mesh
Let's suppose that you want to convert a mesh called mesh.obj to the Unigine-supported data format. If it is located, for example, in the D:\my_project\external_meshes folder, you need to invoke MeshImport as follows:
meshimport_x86.exe "D:\my_project\external_meshes\mesh.obj"
D:\my_project\external_meshes\mesh.obj -> D:\my_project\external_meshes\mesh.mesh
meshimport_x86.exe "D:\my_project\meshes\my_mesh1.obj" "D:\my_project\meshes\my_mesh2.obj"
Upgrade an Outdated Mesh
Assuming that you need to upgrade the Unigine outdated mesh called my_mesh.mesh to the up-to-date mesh format. For example, if the file is located in the D:\my_project\meshes folder, then you need to invoke MeshImport as follows:
meshimport_x86.exe "D:\my_project\meshes\my_mesh.mesh"
meshimport_x86.exe "D:\my_project\meshes\my_mesh1.mesh" "D:\my_project\meshes\my_mesh2.mesh"