In this page we will show how to prepare models in Autodesk Maya for importing them into S2Engine HD.
- Note
- In S2Engine HD coordinate system Y axis is the UP axis.
-
In S2Engine HD dimension units are in centimeters, i.e. an object that have Y coordinate set to 100 means that it is 1 meter up.
-
When creating materials do not using : symbol in their names.
Single Mesh Models
Single mesh models are basic models for populating S2Engine scenes. They are composed by a single mesh that can contains multiple materials.
Setup Mesh
In the following example we create a cube
and apply it 3 different materials as showed into the following image:
- Note
- In this example note that the cube is scaled by 10 units.
When exporting a mesh from Maya FBX exporter save some additional information about transformations (rotation, scaling, translation, pivots).
This information is reflected into the imported mesh, generating unwanted additional nodes.
See Importing Static mesh from FBX to view the effects of generating additional nodes in S2ENGINE
There are 2 method for avoiding this:
- 1. Using Maya before exporting
- 2. Using S2Engine HD importer. (see Importing Static mesh from FBX)
To make things in Maya before exporting, click on the Freeze transformations command as showed into the following image:
Export Mesh
When our mesh is ready for exporting:
- Select the model from the outliner as showed into the following image:
- Click on Export Selection... as showed into the following image:
- Note
- We suggest to not use Export All to avoiding exporting things like camera, light, etc.. that aren't useful in S2ENGINE. To export more than one object we suggests to create a group containing objects and export it.
Following image shows all options to export a single mesh for S2ENGINE in FBX format:
Setup Single Mesh Lods
S2ENGINE HD can import a single mesh also with LODs.
To make S2Engine HD importer recognize mesh lods you must setup the mesh as following:
- Create the base mesh place it at the center of the world and give it a name as usual:
- Create the first lod place it at the center of the world and give it the same base mesh name followed by _lod1 string:
- Create the second lod place it at the center of the world and give it the same base mesh name followed by _lod2 string:
- Finally select all three meshes and click on export selection...
- Note
- the three meshes must be placed into the same position.
Hierarchical Mesh Models
Hierarchical mesh models are models in which meshes are organized in a hierarchy.
These type of models can be animated just like skinned models.
Setup Hierarchical Mesh
To setup hierarchical models in order to export them for S2ENGINE you must take care of pivots.
- Note
- You must take care about pivot transformations to avoid S2ENGINE importer creating additional nodes. In the case of hierarchy models CollapeFBX option of the importer is useful during to the particular nature of the model.
If you want to move mesh pivot to a position different to the default:
- When create a mesh, pivot and mesh transform should be as showed into the following image:
- Move the pivot where you want:
- move the mesh to (0,0,0) as showed into the following image:
- Freeze transformations:
- After freezing the mesh transformations should look like following image:
- Now you can move the mesh in the right place before put it into the hierarchy:
- Finally you can move mesh into the hierarchy as showed into the following image:
The following are two images that summarize the difference between the wrong and the right case:
Export Hierarchical Mesh
Hierarchical models can be exported using FBX just as single mesh models.
Skinned models
Skinned models are typical models used for game characters. They are composed by a hierarchy of nodes (called bones) and one or more meshes that are deformed by one or more influencing bones. Skinned models are often also animated.
S2ENGINE HD treats skinned models and animations as separate files, usually first a skinned model is imported in stance pose and then its associated animations are imported one file per animation.
In this section we show how to export a skinned model in stance pose.
- Warning
- For now in S2ENGINE HD every vertex of a skinned mesh can be influenced by max 4 bones
Setup Skinned Mesh
When you want to export from Maya a skinned model for S2ENGINE HD you must be sure to create a group containing all bones and all skinned meshes as showed into the following image:
- Note
- The name of the group will be the name of the model and of the object prefab when it will be imported in S2ENGINE.
- Warning
- Be sure the pivot of the root node, i.e. the group containing all the meshes and bones, having transformations (position, rotation and scaling) reset.
In the wrong case the importing of the model into S2ENGINE could be corrupted if you select the CollapseFBX option, see Importing FBX into S2Engine.
The following images show respectively the wrong and the right cases:
Note the root node pivot values be not equal to zero. This could corrupt the file importing when selecting collapseFBX option
The pivot of the root has been reset
Export Skinned Mesh
To export the skinned model:
- select the group containing all bones and meshes as showed into the following image.
- Click on Export Selection... as showed into following image:
- Select FBX export
- Into the FBX export dialog select centimeter and un-check automatic scale factor as showed into the image:
- Into the FBX export dialog check Animations, deformed models and skins:
Animations
Setup Animation
Export Animation