S2ENGINE HD
1.4.6
Official manual about S2Engine HD editor and programming
|
Several file formats are supported by S2ENGINE importing plugins.
Here we describe how to import models from the well-known FBX format.
When you want to import a model you must click on IMPORT button of the prefabs browser as showed into the following image:
When clicking on the IMPORT button a file dialog appear for selecting the file to import.
Choose the file and click on Open.
Basing on the file format of the model to import a plugin is chosen by the system. The chosen plugin will show its own import options dialog.
In the case of the FBX file format the dialog will appear as in the following image:
The most important parameters are:
rescale:
Rescale the model before importing it by the specified factorimportGeometry:
Import the model geometry (you can set it to false in the case you have to import only model animation)importAnimation:
Import model animation if it exists. (default value is false)collapseFBX:
If true this parameter makes the additional nodes created by FBX exporter (see Setup Mesh) to be collapsed. An example of use will be showed below.If you do not choose a folder in which to import the model, the plugin automatically creates a folder named as the FBX file to import and use it as destination for all assets.
For every model into the FBX file the plugin creates a prefab associated with the model, the filename of the prefab is the same as name of the model.
The prefabs are placed inside the destination folder as said, BUT you can change the destination folder of the associated resources (model, textures, animations, materials) by changing the following parameters:
ModelsFolder:
Folder in which to put modelsTextureFolder:
Folder in which to put texturesMaterialsFolder:
Folder in which to put materialsAnimationsFolder:
Folder in which to put animationsTo import static meshes simply click import button of the import dialog, if all goes well the engine will create:
To view the prefab created:
The prefab Viewport and Prefab Tool will be showed containing the created prefab.
To inspect the model associated with the prefab right-click mouse button on the model parameter and choose Inspect from the appearing drop-down menu, as showed into the following image:
At this point we come back to talk about FBX collapsing. If you haven't Freezed transformations in Maya before exporting (see Preparing FBX Models in Maya for S2Engine), or if you haven't check the collapseFBX
parameter into the import plugin dialog, the model you see will be like the following:
CollapseFBX
parameter of the import plugin dialog: In this case all redundant nodes are collapsed in a single one and a single mesh is created:
To import hierarchical meshes simply click import button of the import dialog, if all goes well the engine will create:
If you have setup hierarchical model correctly (see Hierarchical Mesh Models) There is no need to check CollapseFBX option in the model importer as for static and skinned meshes.
This is due to the fact that, in the correct case, the pivots of the meshes have all transformations correctly Freezed.
If your model isn't correctly built in Maya the result of import should look like the following image:
The following image, instead, shows the correct result:
To import skinnedmodels simply click import button of the import dialog, if all goes well the engine will create:
CollapseFBX
parameter of the import plugin dialog: As showed in Skinned models before exporting the skinned model you must be sure the root node has pivot reset.
The following is an image showing what happens if you don't reset pivot of root and import model WITHOUT CollapseFBX option: