Go to Gallery           Register for MyTrainz | Login to MyTrainz

Trainz to support any modelling software.

By Admin, February 16 2018

Over the years Trainz has focussed heavily on 3DS-Max support for asset creation. In the very early days GMax, being free, was a great fit for content creators and shipped with Trainz until 2009. Side note; we were the first game to ship with GMax .. there you go!

As time progressed Discreet (now Autodesk) stopped supporting GMax, and Trainz continued to support the latest versions of 3DS-Max with updated exporters. Eventually the Trainz community started to create exporters for Blender, which is a very popular and free alternative 3D modelling package. 

For a long time the only format for Trainz mesh assets was .IM files. This meant we had to create and maintain the .IM format ourselves and each time a 3D software modelling package got an update, or we developed a new art pipeline, our .IM exporters needed upgrading as well. As you can imagine, over the many years of development, the cost of maintenance and updates for exporters kept adding up!

To provide broader support, it made sense to transition to a new file format. We chose .FBX since this format is widely supported by the majority of 3D software modelling packages. Technically, Content Manager takes an FBX file and creates a .trainzmesh from it, which means Trainz no longer needs to create individual exporters to support all the different 3D software modelling packages in the world. Trainz-build 4.5 (TANE SP2) and above take advantage of .FBX support.

However, as always, it's not as simple as that. Not all 3D software modelling packages use the same export data for .FBX files. For example, Blender 2.79 allows you to create your masterpieces (models/materials/textures) using the new PBR pipelines, but their .FBX exporting does not support the new blender PBR materials-to-texture correlation (maybe Blender 2.8 will). How many more 3D software modelling packages out there will end up doing something similar to our content creators pipeline we wondered?

The solution? Metadata! As long as the .FBX exporter for whatever 3D software modelling package you are using exports the geometry (which would be very silly if this was missing) and the material names, our new metadata functionality will allow you to link the material names with your textures.

Blender Example:

Here is Blender's PBR material / texture setup that Blender 2.79 .FBX doesn't support. If you require the correct material / texture setup for PBR in Blender 2.79 you can view it HERE otherwise you can use this new metadata Trainz functionality that we are about to tell you about!

Other Modelling Packages:

In the upcoming version of Trainz, (technically) any content creator can use any 3D software modelling package to create their assets, whether the .FBX file supports the required material to texture mapping that Trainz is looking for of not. (3DS Max and Blender both support the mapping). For the other modelling packages, when you export your .FBX files, all you need to do is create a metadata file for your .FBX file and add the mapping yourself. For example my filename.fbx metadata file (filename.txt) would look like this:

        material-type "pbrmetal"
                texture-resource "albedo.texture"
                texture-resource "normal.texture"
                texture-resource "parameter.texture"

If your .FBX Trainz asset looks like the following when you commit it to content manager, it's more than likely no material to texture mappings exist:

Once you add these mappings:

You should see your textures play nicely with your materials in Trainz:

It might look complicated but it is very straight forward once you make your first metadata file.

Read more on Metadata Files here: http://online.ts2009.com/mediaWiki/index.php/Mesh_metadata_file


Even more good news - we are looking to create an automated process for creating your metadata files from your .fbx and texture files. This is an internal R&D project at the moment, but hopefully will soon be with you to test.

For more information on future Trainz development be sure to keep up-to-date at http://www.trainzportal.com or see all the articles and have your say at the forums.