Fork me on GitHub

Documentation for the Maniaplanet game operating system

You can import meshes from the fbx file format (maximum version 2014.1)
Importer has been tested with files exported from Blender and 3dsMax (with Fbx 2012.2 exporter, available at http://usa.autodesk.com/fbx/)
3d file must contain meshes with materials.

We distinguish 3 types of meshes : static meshes, dynamic meshes and characters meshes
The static objects use static meshes, the dynamic object use dynamic meshes, and the characters use character meshes.

The fbx file to import (and its depening assets (textures)) must be placed in the correct folders

To import a mesh, type the command :

NadeoImporter Mesh {fbxSourceFileNameRelativeToWorkFolder}

When you import a mesh from a .fbx file, a corresponding .mesh.gbx file is produced (in the non-work folder)
Note : for static meshes shapes (= collision models) files are also created during import (see below 1.1)

In order to specify how to import a fbx file, the recommended way is now to create a xxx.meshparams.xml file along the xxx.fbx file, instead of adding command line parameters.

In the samples, you have 2 files :
Work\Items\Samples\StaticObjects\Meshes\Block_Checkers.fbx
and
Work\Items\Samples\StaticObjects\Meshes\Block_Checkers.meshparams.xml

1. Mesh types

1.1 static meshes

static meshes shapes

During static mesh import, shapes (= collision models) are created.
From the file {meshname.fbx}, a {meshname}.shape.gbx file is created.
The objects within the fbx file whose name start with _socket_(ex : _socket_start) are imported as "sockets", that can be used by the items.
Use this when you import start or checkpoint items. (see the page item import)

If there are objects within in the fbx whose name starts with _trigger_ (ex : _trigger_A), they will be imported as another shape file named {meshname}Trigger.shape.gbx.
This allows you to define a mesh and an associated trigger with a single fbx file.
Use this when you import checkpoint or finish items. (see the page item import)

1.2 non-static meshes (dynamic & character meshes)

2. Meshparam.xml file structure

2.1. MeshParams

<MeshParams> root node attributes :

2.2. Materials

It's now possible to define materials with more flexibility.

For each material name present in the fbx file, you can define the corresponding imported material. You can define the material model used, the path of the base texture, and the physics id.

That means you can place you texture where you want in work the folder, and that you can more easily share texture between meshes

the <Materials> node contains an array of <Material> nodes.

<Material> attributes :

recap example :

<Materials>
    <Material Name="A" Model="TDSN" BaseTexture="../Textures/Checkers"  PhysicsId="TechGround" />
    <Material Name="B" Link="BaseGround" />
</Materials>

the fbx material named "A" will be imported as an instance of the TDSN model, using "../Textures/Checkers" for the base texture name,
( so the importer will look for the files : ../Textures/Checkers_D.tga, ../Textures/Checkers_S.tga and ../Textures/Checkers_N.tga),
and with the physical id "TechGround"
the fbx material named "B" will be displayed as the "BaseGround" material of the storm collection

2.3. Lights

It's now possible to create lights only for static meshes.
For eah light name present in the fbx file, you can define the corresponding imported light.

You can define the light type and the light parameters

the <Lights> node contains an array of <Light> nodes.

<Light> attributes

2.4.Textures

In the meshparam.xml file, you can now set the import texture parameters (as in command line)

<Textures> attributes :

3. Appendix

3.1 material model list

material models uses different texture layers that must follow some conventions :

Diffuse   : {BaseTextureName}_D.tga 24bits, RGB (32bits binary alpha if using Opacity)
Specular  : {BaseTextureName}_S.tga 24bits, FIE (Fresnel, Intensity, Exponent)
Normal    : {BaseTextureName}_N.tga 24bits, NxNyNz
SelfIllum : {BaseTextureName}_I.tga 24Bits, RGB (selfillum)
Energy    : {BaseTextureName}_E.tga 24bits, greyscale (0=> no energy 1=> full energy) (colorized by gameplay)
TeamMask  : {BaseTextureName}_M.tga 24bits, binary mask (black => not colorizable, white=>colorizable)

The importer converts those textures into the right .dds format.
Textures size must be power of two. (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, (8192 < not supported by very old graphic cards)

here is a list of material models, with their texture layers.

3.1.1. static mesh material models

3.1.2. dynamic mesh material models

3.1.3. character mesh material models

3.2. material physicsId list

ChangeLog :
- 09-04-2014 : light color : sRGB instead of "color", layer name "Material"=>"BaseMaterial"