Go to the Unigine SDK folder, plugins/Max/ directory and choose the plugin depending on the installed version of 3ds Max.
Copy all the files, such as
MeshExport.dle
MeshSkinnedExport.dle
MeshImport.dli
MeshSkinnedImport.dli
etc
into the 3ds Max plugins folder: for example, 3ds Max 2011/plugins.
In the Unigine SDK folder, choose plugins/Max/UnigineExport/UnigineExport.ms and copy it into 3ds Max Scripts folder: for example, 3ds Max 2011/Scripts or 3dsMax8/Scripts/Startup.
Restart 3ds Max to get plugins ready to work.
If you want to export nodes, add a path to the folder where ImageDDS resides to your %PATH% environment variable.
On Windows XP:
Right-click My Computer and choose Properties.
In the Advanced tab, click Environment Variables.
Edit the Path system variable (under System variables).
On Windows Vista and Windows 7:
Right-click Computer and choose Properties.
Select the Advanced system settings category on the right, click Environment Variables.
Edit the Path system variable (under System variables).
How to Use the Plugin
Unigine panel in 3ds Max
After installation that you can enable Unigine exporter on the Utilities panel:
Go to Utilities panel.
Open the Configure Button Sets dialog.
Choose Unigine and add it to the listed button sets.
To export 3ds Max models, use the following options:
Export As... allows to choose the file and save exported models.
Quick Export saves exported models into the same file (as previously specified in Export As... option).
Align — set a point that will be used as the origin of coordinates:
World — use the origin of world coordinates.
Center — use the center of the model's bounding sphere.
Bottom — use the bottom of the model's bounding sphere.
Top — use the top of the model's bounding sphere.
Pivot — use the pivot coordinates.
Notice
When exporting relative to the pivot, the value of the Scale option is ignored. It is reset to the default 100 %.
Scale — scaling ratio. This value scales the size of static geometry.
Precision — required precision of exported values (number of digits after a decimal point to keep).
Vertex optimization — optimization that reorders an indexed triangle list to improve vertex cache utilization. This option can be turned off for a quicker export; however, it should always be turned on if exporting the final version of assets.
Split by material — if Multi-materials are used, polygons with the same sub-material assigned are exported as a separate surface.
Sub-materials are considered the same if they have the same name.
Exported surfaces will be named after names of sub-materials (<objectName>_<materialName>_<submaterialName>).
Groups as surfaces — export objects combined in a group as one surface. The surfaces will be named after the names of groups.
UV mapping:
Channel 1 — UVW channel that should be copied into the 1st UV channel of the exported file. Enter 0 to fill the channel with zeros.
Channel 2 — UVW channel that should be copied into the 2nd UV channel of the exported file. Enter 0 to fill the channel with zeros.
Export Animated Object Into Skinned Mesh
You can export animated (skinned) mesh baked together with its animation in one file. It is also possible to export only the bind pose of the model (and after that, use it in the engine with separately exported animations, see details below).
In both cases, to export a skinned mesh into .smesh file:
Select a skinned mesh to be exported.
Do any of the following:
On the UnigineTools Exporter panel choose Type: Skinned mesh.
Select Unigine menu on the main bar -> MeshSkinned export.
Select File -> Export selected or Export (to export all scene) and choose .smesh format.
Set up export options.
Notice
The maximum number of bones per surface is equal to 96 to avoid crashes on graphics APIs of DirectX 9 level. If the number exceeds this limit, small child bones will be simply ignored by export.
Each vertex can have up to 4 bones assigned to it.
SMESH Export Options
Skinned mesh export (into SMESH format)
Options:
Align — set a point that will be used as the origin of coordinates:
World — use the origin of world coordinates.
Center — use the center of the mesh's bounding sphere.
Bottom — use the bottom of the mesh's bounding sphere.
Top — use the top of the mesh's bounding sphere.
Scale — scaling ratio. This value scales the size of a skinned mesh.
Precision — required precision of exported values (number of digits after a decimal point to keep).
Vertex Optimization — optimization that reorders an indexed triangle list to improve a vertex cache utilization. This option can be turned off for a quicker export; however, it should always be turned on if exporting the final version of assets.
Split by material — if Multi-materials are used, polygons with the same sub-material assigned are exported as a separate surface.
Sub-materials are considered the same if they have the same name.
Exported surfaces will be named after names of sub-materials (<objectName>_<materialName>_<submaterialName>).
Groups as surfaces — export objects combined in a group as one surface. The surfaces will be named after the names of groups.
UV mapping:
Channel 1 — UVW channel that should be copied into the 1st UV channel of the exported file. Enter 0 to fill the channel with zeros.
Channel 2 — UVW channel that should be copied into the 2nd UV channel of the exported file. Enter 0 to fill the channel with zeros.
All frames — export all the frames that currently displayed on a time track.
Custom frame range — export only the specified animation frames:
Start Time — the first frame of the exported animation.
End Time — the last frame of the exported animation.
Invert time — invert the animation sequence (export it playing from the last frame to the first one).
Export Only Animation of Skinned Mesh
You can export only animation (bones transformations) of a skinned mesh into a separate file. The mesh itself is exported as a Bind pose into SMESH file. This way, you can have only one mesh and choose what animations to set for it.
To export only animation into .sanim file:
Select a skinned mesh which animation is going to be exported.
Do any of the following:
On the UnigineTools Exporter panel choose Type: Animation frames.
Select Unigine menu on the main bar -> MeshSkinned animation export.
Select File -> Export selected or Export (to export the whole scene) and choose .sanim format.
Set up export options.
SANIM Export Options
Skinned mesh animation export (into SANIM format)
Animation:
All frames — export all the frames that currently displayed on a time track.
Custom frame range — export only the specified animation frames:
Start Time — the first frame of the exported animation.
End Time — the last frame of the exported animation.
Invert time — invert the animation sequence (export it playing from the last frame to the first one).
Export into Multiple Meshes
To export static models as separate .mesh files into a specified directory:
Select multiple models.
Select Unigine menu on the main bar -> Multi Mesh export.
Align — for transformations, this option is not valid. The origin of world coordinates is always used.
Scale — scaling ratio. This value scales only the position component of transformations — a path of the moving object.
Precision — required precision of exported values (number of digits after a decimal point to keep).
Animation:
All frames — export transformations of the object from all the frames.
Custom frame range — export transformations of the object from only the specified frames:
Start Time — the first frame to export.
End Time — the last frame to export.
Invert time — invert the transformation sequence (export it from the last frame to the first one).
Export Meshes and Materials into Nodes
Both static geometry and materials of objects can be exported at the same time. Meshes (.mesh files under meshes folder), textures (under textures folder) and a material library (.mat file) are created by that.
Notice
It is not recommended to use this type of export at the production stage, because Unigine has an in-built material system (with inheritance support for extremely efficient rendering at run-time) and a different set of shaders.
To export all data at once:
Select objects to export if you want to export a part of the scene.
Select Unigine menu on the main bar -> Node export. All exported nodes will be automatically named after 3ds Max objects.
Set up node export options.
Click Ok and save .node file. Additional files and folders will be automatically created.
Notice
This feature exports only those surfaces that have materials assigned to them. Other surfaces will be skipped.
NODE Export Options
Options for export into the node file format
Base:
Single mesh — merge all surfaces into a single mesh.
Selection only — export only selected objects. If not checked, the whole scene is exported.
Base material — set a base material: you can specify the existing material or create a new one. All node materials are inherited from this base material. By default, the base material is mesh_base.
Material prefix — set a prefix for names of the created material name. (For example, if the prefix is my_project_, materials are named my_project_MaterialName). By default, there is no prefix.
Path prefix — path prefix that should specify the path to a folder where .node file will be saved (relative to <UnigineSDK>/data directory).
You can also specify a a path to the existing project. This way, if meshes, textures folders and a material library file are found at this location, the node will be simply added there.
Move textures — copy textures into the textures folder.
Compression — convert and compress exported textures into .dds format with ImageDDS tool.
Options:
Align — set a point that will be used as the origin of coordinates:
World — use the origin of world coordinates.
Center — use the center of the bounding sphere for each of the model (if a Single mesh option is unchecked).
Bottom — use the bottom of the object bounding sphere for each of the model (if a Single mesh option is unchecked).
Top — use the top of the object bounding sphere for each of the model (if a Single mesh option is unchecked).
Pivot — use the pivot coordinates for each of the model (if a Single mesh option is unchecked).
Notice
When exporting relative to the pivot, the value of the World scale option is ignored. It is reset to the default 100 %.
World scale — scaling ratio. This value scales models' geometry.
Precision — required precision of exported values (number of digits after a decimal point to keep).
Vertex optimization — optimization that reorders an indexed triangle list to improve a vertex cache utilization. This option can be turned off for a quicker export; however, it should always be turned on if exporting the final version of assets.
Groups as surfaces — export objects combined in a group as one surface. The surfaces will be named after the names of groups.
UV Mapping:
Channel 1 — UVW channel that should be copied into the 1st UV channel of the exported file. Enter 0 to fill the channel with zeros.
Channel 2 — UVW channel that should be copied into the 2nd UV channel of the exported file. Enter 0 to fill the channel with zeros.
Export Identical Objects into Reference Nodes
You can easily export identical objects that are positioned at different places of the scene. (For example, it could be lamp posts, trash bins, benches, etc.) As objects are absolutely identical, and there are many of them, they are exported as a reference node (.node file). Such node, with geometry and all materials, is loaded into memory once and is instanced across the whole scene. (Afterwards, in the Unigine editor, it also possible to modify materials or parameters only for one node instance, making it unique — for example, a broken lamp post — though instancing will not work for it in this case.)
Exported objects will be represented as the following hierarchy in Unigine:
Node dummy as a root (so that all nodes can be disabled/enabled in one click)
To export identical objects into one .node file and automatically place them:
Select identical objects that you want to export.
Select Unigine menu on the main bar -> Nodes transform.
Set up export node options. You can choose to export only positions of reference nodes (if a .node file already exists), or create a reference node and position its instances.
NODE Transformation Export Options
Export of identical objects (into NODE format) and their transformations
Root node dummy — set the name of the node dummy (used a root for reference nodes in Unigine editor hierarchy).
Node path — path to the reference node (.node file) relative to <UnigineSDK>/data directory. You can specify an existing file (if an object was already exported), or create a new one.
Rename 'name_%' — renames reference nodes.
If this option is unchecked (by default), nodes are named after the names of objects.
If checked, reference nodes are named as 'new_name_%', where % is a number. (For example, 'lamp_post_%' renames all reference nodes into lamp_post_1, lamp_post_2, etc.)
World scale — scaling ratio. This value scales the position of the objects relative to each other.
Export of Camera
To export the path of the camera and changes of its field of view (FOV) along the way:
Select cameras to be exported
Select Unigine menu on the main bar -> Camera export
Each selected camera path will be exported in a separate texture file (without any extension) with the following format:
Here N is the number of time units (frames). The camera in each time unit is described by a single line containing a position, a rotation, and a field of view.
There is a special class for parsing file of this type, CameraPath. In order to use it, include data/core/scripts/camera.h.
Import of Unigine Mesh
To import the native Unigine mesh (.mesh file) into 3ds Max, choose one of possible options:
Select Unigine menu on the main bar -> Mesh import
Select File -> Import and choose .mesh file
Import of Unigine Skinned Mesh
To import the native Unigine skinned mesh (.smesh file) into 3ds Max, choose one of possible options:
Select Unigine menu on the main bar -> MeshSkinned import