<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Korvtiger</id>
	<title>TrainzOnline - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Korvtiger"/>
	<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/wiki/Special:Contributions/Korvtiger"/>
	<updated>2026-11-05T08:07:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Export_Blender_FBX_Animation&amp;diff=38845</id>
		<title>HowTo/Export Blender FBX Animation</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Export_Blender_FBX_Animation&amp;diff=38845"/>
		<updated>2023-09-24T15:39:32Z</updated>

		<summary type="html">&lt;p&gt;Korvtiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
(Work in progress)&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
This page describes a process for exporting animated meshes from Blender to the [[FBX file format]].  It is intended for new content creators or those more experienced who need to migrate from older versions of Blender and Trainz animation.&lt;br /&gt;
You should be familiar with Blender FBX export as described here [[HowTo/Export from Blender using FBX]]&amp;lt;br&amp;gt;&lt;br /&gt;
This tutorial is for Trainz Build 4.6 and Blender 2.80.&lt;br /&gt;
==Trainz Animation==&lt;br /&gt;
In Blender you can animate meshes but that animation is not recognised by Trainz.  Trainz only recognises animation helper objects that it calls bones.  A bone, for Trainz purposes, is an animated helper object using a &amp;quot;b.r.&amp;quot; notation.&lt;br /&gt;
Meshes are attached to bones in a parent-child relationship where the child is the mesh.  When the parent bone moves in 3D space, the child mesh moves with it.  In Trainz you cannot see the animated bones but you can see the mesh.&lt;br /&gt;
Animation helpers in Blender can be armatures or empties.  Lattices cannot be used since FBX doesn&#039;t recognise them. &lt;br /&gt;
=Examples=&lt;br /&gt;
Here are a number of example animations.  Each example is provided with source files but only the first example is fully explained.&lt;br /&gt;
==Example 1 - A Revolving Sphere==&lt;br /&gt;
This example is a very basic animation of a sphere using an empty as the animation helper.  The Blender file consists of a sphere located at grid centre and at elevation 2 (metres). The sphere has a PBR material and a simple UV map.&lt;br /&gt;
Your task is add the animation helper, add the rotation animation, export to FBX and import into Trainz.&lt;br /&gt;
===Load Example 1===&lt;br /&gt;
:* On your computer, create a project folder called &amp;quot;anim_example_1&amp;quot; or whatever name suits you.&lt;br /&gt;
:* Download the source files from here: [[File:Ex1 export.zip]]&lt;br /&gt;
:* The source file is in zip format so extract it into the project folder.  The source includes:&lt;br /&gt;
   example1_start.blend;&lt;br /&gt;
   example1_completed.blend;&lt;br /&gt;
   ex1_albedo.png&lt;br /&gt;
   ex1_albedo.texture.txt&lt;br /&gt;
   ex1_normal.png&lt;br /&gt;
   ex1_normal.texture.txt&lt;br /&gt;
   ex1_parameter.png&lt;br /&gt;
   ex1_parameter.texture.txt&lt;br /&gt;
   thumbnail_0.jpg&lt;br /&gt;
   config.txt&lt;br /&gt;
:* The config.txt is complete but you will need to change the asset kuid to be one of your own.&lt;br /&gt;
&lt;br /&gt;
  Updated and rebuilded tutorial files: [[File:Tutorial_Rebuild_Blender_Rotatating_Earth.zip|Example 1: Tutorial Rebuild Blender Rotatating Earth]]&lt;br /&gt;
  Beside some adjustments the main update was to move, add and amend animation tags to a effects sub container.&lt;br /&gt;
  Informations about Blender 3.x fbx export settings as picture one will find in [[Prequel Blender to Trainz|Prequel for this tutorial series: Blender to Trainz (with the full script)]]&lt;br /&gt;
&lt;br /&gt;
:* Open the ex1_example.blend Blender source file in Blender 2.8.  It should look similar to the following.  If the sphere is a pink/purple colour then that means Blender can&#039;t find the material textures.  You should be able to correct that by reloading the textures within Blender.&lt;br /&gt;
[[File:Ex1 start.jpg|1200px|thumb|center|The Start Layout]]&lt;br /&gt;
:* Save the file as &amp;quot;ex1_working.blend&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Add the Trainz Animation Helper===&lt;br /&gt;
:* Position the Blender cursor at World Origin (0,0,0). Press Shift S to bring up the Snap menu and select Cursor to World Origin.&lt;br /&gt;
:* Add an empty at the cursor location. Use menu Add-&amp;gt;Empty-&amp;gt;Arrows.  Shift A should also work.&lt;br /&gt;
:* Double click on the new Empty in the Properties Editor and rename it to &amp;quot;b.r.main&amp;quot;.&lt;br /&gt;
:* Move the b.r.main helper into the Animation collection.  You can either drag and drop it in the Properties Window or the menu Object-&amp;gt;Collection-&amp;gt;Move to Collection.  Having a collection name Animation makes it easier to export different LOD meshes.&lt;br /&gt;
===Animate the Trainz Helper===&lt;br /&gt;
:* Change to the Animation Workspace and ensure the b.r.main object is selected.  You will need to use the object&#039;s Context values that are shown at the bottom right - location, rotation, scale, etc.&lt;br /&gt;
[[File:Blender280 anim example1- view1.jpg|1200px|thumb|center|B.R.Main]]&lt;br /&gt;
:* For animation we use keyframes (aka frames) to manage our animation.  Trainz operates animations at 30 frames per second (fps) and, as we want to run this animation for two seconds, the End Frame in Timeline should be 60.  Make sure the Start Frame is 1 and the Current Keyframe is 1.  See the following image.&lt;br /&gt;
[[File:Blender280 anim example1- view2.jpg|1200px|thumb|center|Animation timeline]]&lt;br /&gt;
:* Select the b.r.main helper if not already selected.&lt;br /&gt;
:* For the start of our animation we need to set the rotation of our helper to be at 0 (zero) degrees.  For this example we can just leave the helper as Blender placed it..&lt;br /&gt;
:* Press the I key and select Rotation.  This creates a frame with just rotation data which, in this case, is 0.  You will see a keyframe indicator appear at frame 1 in Timeline and, if you are using the Animation workspace, you will also see entries appear in both the Dope Sheet and Graph editors.&lt;br /&gt;
:* Change the Current frame in Timeline to the last keyframe (6).  You can click on frame 60 in Timeline, manually change the current frame number or use the &amp;quot;Jump to end&amp;quot; icon in Timeline.&lt;br /&gt;
:* At the end of our animation we want the helper to have completed one full rotation of 360 degrees so select the helper and, in the Properties Window-&amp;gt;Context, change the Z Rotation value to 360.  The result should look like the following:&lt;br /&gt;
[[File:Setting the rotation.jpg|600px]]&lt;br /&gt;
:* Press the I key and select Rotation.  This sets the final keyframe.&lt;br /&gt;
:* Test out the animation by clicking on the Forward and Reverse icons in Timeline.  When finished reset the animation by stopping it first and then selecting the Start Endpoint icon.  Note that the sphere is not moving yet.&lt;br /&gt;
===Review===&lt;br /&gt;
So far we have created the helper with a name that Trainz will recognise for animation.  We have set the animation to compete one full circle in the Z axis in 60 keyframes and, since we are using 30fps, the animation will run for 2 seconds.&lt;br /&gt;
The use of the value 360 is somewhat of a trick to make sure that Blender animates the helper through 360 degrees.  Although 360 is essentially the same as 0, if you left it at 0 then no animation would take place even though keyframs exist.  Try a zero value and see what happens or rather what doesn&#039;t happen.&lt;br /&gt;
Using the value of 360 means that the helper will rotate 360 degrees in the anti-clockwise direction.  If you want clockwise motion then change the value to -360.&lt;br /&gt;
===Smoothing the Animation===&lt;br /&gt;
While watching the animation you may have noticed that the animation pauses briefly between the end and restart of the animation.  There is no time gap but this indicates that the animation is not following a linear path but one using an &amp;quot;F curve&amp;quot;.  These pauses may be noticeable in game except for bogie animations where the animation is dynamically managed by the game engine.&lt;br /&gt;
Within Blender this characteristic is known as the extrapolation mode of the animation channel.  By default Blender uses an F curve that resembles a Bezier curve.  For many Trainz animations you may want a continuous animation and that means the Linear Extrapolation.  Note that there is a Constant Animation but that may not give the same result as it essentially freezes the animation between keyframes.  &lt;br /&gt;
:* Change the workspace to Animation if not there already.&lt;br /&gt;
:* In the Graph Editor or the Dope Sheet Editor, select menu Channel&amp;gt;Extrapolation Mode&amp;gt;Linear Extrapolation.&lt;br /&gt;
:* Run the animation again and there should be no pauses.&lt;br /&gt;
[[File:Linear extrapolation.jpg|800px]]&amp;lt;br&amp;gt;&lt;br /&gt;
For more information on Blender animation channel extrapolation see [https://docs.blender.org/manual/en/latest/editors/graph_editor/fcurves/introduction.html Introduction to FCurves]&lt;br /&gt;
===Animating the mesh objects===&lt;br /&gt;
:* As stated earlier you cannot animate the meshes directly but you can make them follow the animation helper.  We do this by making the mesh a child of the helper.&lt;br /&gt;
:* There are two meshes to animated: the LOD0 and LOD1 meshes.&lt;br /&gt;
:* Enable viewing of both the LOD0 and LOD1 mesh by ticking the two collections.&lt;br /&gt;
:* Select the objects sphere_lod0, sphere_lod1 and finally b.r.main.  The help must be selected last.&lt;br /&gt;
:* In the 3D window, press Ctrl P&amp;gt;Object (Keep Transform).&lt;br /&gt;
:* Test the animation by starting the animation and showing or hiding the two mesh objects.&lt;br /&gt;
:* Save your work.&lt;br /&gt;
===Exporting the Animation===&lt;br /&gt;
The animation data for the helper(s) as well as the parent/child relationships are exported within the FBX file.  The Trainz FBX importer will extract the animation data and store it in a KIN file.  Since we have two LOD meshes this means that the importer will create two KIN files but with slightly different names.  As the animation is the same for both meshes you can use just one of the KIN files and delete the other.  Or you can use both.&lt;br /&gt;
Blender&#039;s FBX exporter will export each animation channel it finds and this can result in multiple KIN files for each mesh.  This doesn&#039;t work well if at all.  The solution is to use what is called a baked animation where all the channels and keyframes are &amp;quot;baked&amp;quot; together.  This is actually inefficient for Trainz purposes but is the only answer that currently works reliably.&lt;br /&gt;
====Exporting LOD0 Animation====&lt;br /&gt;
:* Disable viewing of the LOD1 meshes by unclicking the LOD1 collection.&lt;br /&gt;
:* Enable both the LOD0 and Animation collections.&lt;br /&gt;
:* In the 3D Editor select all objects using the A key.  You may need to press it twice.&lt;br /&gt;
[[File:Exporting LOD0.jpg|400px]]&lt;br /&gt;
:* Go to the File menu and select Export&amp;gt;FBX.&lt;br /&gt;
:* The default options will not work for us so we need to change a few things:&lt;br /&gt;
:* For the Main tab:&lt;br /&gt;
:* Check Selected Objects.&lt;br /&gt;
:* Scale - either change the scale value to 0.01 and have the adjacent icon selected, or leave the scale at 1.00 and deselect the icon. (VALIDATE)&lt;br /&gt;
:* Apply Scale - use FBX All.&lt;br /&gt;
:* Forward - use Y forward&lt;br /&gt;
:* Up - Z up. &lt;br /&gt;
:* The next area lists those objects to be exported.  In this case we want Empty and Mesh.&lt;br /&gt;
:* Leave the other options at their default value.&lt;br /&gt;
:* For the Animation tab:&lt;br /&gt;
:* Check Baked Animation.&lt;br /&gt;
:* Uncheck all other options. For this example we don&#039;t care about the other tabs but suggested values are shown in the next set of images.&lt;br /&gt;
[[File:Fbx main.jpg|300px]][[File:FBX geometry.jpg|300px]][[File:FBX armature.jpg|300px]][[File:FBX animation.jpg|300px]]&lt;br /&gt;
:* In the output filename space enter ex1_lod0.fbx and click on the Export FBX icon at the top right.&lt;br /&gt;
====Exporting LOD1 Animation====&lt;br /&gt;
:* Uncheck the LOD0 collection.&lt;br /&gt;
:* Check the LOD1 collection.&lt;br /&gt;
:* Leave the Animation collection checked.&lt;br /&gt;
:* Repeat the LOD0 process only changing the output name to ex1_lod1.fbx.  You shouldn&#039;t need to change any of the export settings unless you restarted Blender.&lt;br /&gt;
[[File:Exporting LOD1.jpg|400px]]&lt;br /&gt;
===Setting up the Asset in Trainz===&lt;br /&gt;
The FBX file contains both the mesh and the b.r.main empty plus the animation data.  When the FBX file is imported into Trainz, an animation file (KIN) is created in addition to the Trainzmesh file.&lt;br /&gt;
The name of the kin file depends on the options chosen within the Export FBX-&amp;gt;Animation panel.  If you choose the Baked Animation option, then the kin filename will be the mesh name plus “_scene.kin”.  In this instance, the kin filenames will be “ex1_lod0_scene.kin” and “ex1_lod1_scene.kin”.  &lt;br /&gt;
====Config.txt====&lt;br /&gt;
The names of mesh and KIN files may not be obvious so you may need to create some dummy names for your mesh and KIN files.   After importing into Trainz, open the asset for editing and look for the files created.  Then go back and correct entries in the config.txt.  You can always rename the kin file to a simpler name.&lt;br /&gt;
For this asset the mesh table will look like this:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mesh-table {&lt;br /&gt;
  lod_0 {&lt;br /&gt;
    mesh                                  &amp;quot;ex1_lod0.trainzmesh&amp;quot;&lt;br /&gt;
    auto-create                           1&lt;br /&gt;
    lod-level                             0&lt;br /&gt;
    anim                                  &amp;quot;ex1_lod0_scene.kin&amp;quot;&lt;br /&gt;
    animation-loop-speed                  1.00&lt;br /&gt;
  }&lt;br /&gt;
  lod_1 {&lt;br /&gt;
    mesh                                  &amp;quot;ex1_lod1.trainzmesh&amp;quot;&lt;br /&gt;
    auto-create                           1&lt;br /&gt;
    lod-level                             1&lt;br /&gt;
    anim                                  &amp;quot;ex1_lod1_scene.kin&amp;quot;&lt;br /&gt;
    animation-loop-speed                  1.00&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
===Asset in game===&lt;br /&gt;
&lt;br /&gt;
[[File:Ex1 in game.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
==Example 2 - Four revolving cogs==&lt;br /&gt;
This example shows four meshed cogs rotating together.  The rotation of the cogs is controlled by four armatures and an empty is used as a parent bone.&lt;br /&gt;
Each cog has its own armature and two rotate clockwise and the other two rotate anticlockwise.&amp;lt;br /&amp;gt;&lt;br /&gt;
There are two Blender files provided: one incomplete and one complete. &amp;lt;br /&amp;gt;&lt;br /&gt;
The starting file has the four cogs UV mapped and linked to a Trainz PBR material.  An armature is positioned at the centre of each cog.  The four cogs are grouped into a LOD0 collection and the four armatures are grouped into an Animation collection.  There is also a LOD1 collection but it is empty.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your task is to add the animation, duplicate the meshes into LOD1 and export to Trainz.  Not everything is explained in detail but if you have completed Example 1 then that will help.&lt;br /&gt;
[[File:4 cogs in Blender.jpg|800px]]&lt;br /&gt;
===Source Files===&lt;br /&gt;
The source files can be downloaded here [[File:ex2_export.zip]]. The source includes:&lt;br /&gt;
   ex2_start.blend;&lt;br /&gt;
   ex2_complete.blend;&lt;br /&gt;
   cogs_albedo.png&lt;br /&gt;
   cogs_albedo.texture.txt&lt;br /&gt;
   cogs_normal.png&lt;br /&gt;
   cogs_normal.texture.txt&lt;br /&gt;
   cogs_parameter.png&lt;br /&gt;
   cogs_parameter.texture.txt&lt;br /&gt;
   $screenshot$.jpg&lt;br /&gt;
   config.txt&lt;br /&gt;
&lt;br /&gt;
  Updated and rebuilded tutorial files: [[File:Tutorial_Rebuild_Blender_Four_Cogs.zip|Example 2: Tutorial Rebuild Blender Four Cogs]]&lt;br /&gt;
  Beside some adjustments the main update was to move, add and amend animation tags to a effects sub container.&lt;br /&gt;
  Informations about Blender 3.x fbx export settings as picture one will find in [[Prequel Blender to Trainz|Prequel for this tutorial series: Blender to Trainz (with the full script)]]&lt;br /&gt;
&lt;br /&gt;
===Things you need to do===&lt;br /&gt;
====Saving====&lt;br /&gt;
:* Save often.  Animation can be tricky so always save when you have reached a critical point.&lt;br /&gt;
====Animate the cogs====&lt;br /&gt;
:* Set the animation range to 120 frames, start frame 1, and the current frame 1.&lt;br /&gt;
:* Make the four cog armatures children of the root animation helper b.r.base.&lt;br /&gt;
:* For each cog:&lt;br /&gt;
:**  Make the cog mesh a child of its armature. Blender 2.8 seems to be a bit unreliable for this action so make sure the correct parent is applied.  You can see this in the Properties Editor, Context Panel-&amp;gt;Relations.  The parent type should be object.[[File:Checking the cog parent.jpg|800px]]&lt;br /&gt;
:**  Create five keyframes for each armature as detailed in the table below:&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! width=15% | Armature&lt;br /&gt;
! width=15% | Keyframe&amp;lt;br /&amp;gt;1&lt;br /&gt;
! width=15% | Keyframe&amp;lt;br /&amp;gt;30&lt;br /&gt;
! width=15% | Keyframe&amp;lt;br /&amp;gt;60&lt;br /&gt;
! width=15% | Keyframe&amp;lt;br /&amp;gt;90&lt;br /&gt;
! width=15% | Keyframe&amp;lt;br /&amp;gt;90&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;1&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-90&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-180&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-270&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-360&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;2&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;90&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;180&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;270&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;360&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;3&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-90&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-180&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-270&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;-360&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;4&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;90&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;180&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;270&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;360&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
:* Run the animation and check that the cogs rotate in the correct direction and mesh with each other.  If this doesn&#039;t look right then you may have to fall back to a saved version or even the starting version.&lt;br /&gt;
:* For each cog:&lt;br /&gt;
:**Make a copy. (Shift D)&lt;br /&gt;
:**Move the copy to the LOD1 collection. (M key)&lt;br /&gt;
:**Rename the copy to &amp;quot;gearx-lod1&amp;quot; where &amp;quot;x&amp;quot; is the gear number.&lt;br /&gt;
:**Add a Decimate modifier. The Planar option with an angle of 10 will reduce the number of polys to a usable number.  There is no need to apply the modifier since the exporter will do that on export.&lt;br /&gt;
:*Hide the LOD1 collection and run the animation again.  This will show the LOD1 meshes animating.&lt;br /&gt;
&lt;br /&gt;
====Export====&lt;br /&gt;
:*Select each LOD collection in turn and, together with the Animation collection, export to files called &amp;quot;cogs_lod0.fbx&amp;quot; and &amp;quot;cogs_lod1.fbx&amp;quot;.  For this export you must select Empty, Armature, and Mesh.&lt;br /&gt;
===Asset in Game===&lt;br /&gt;
[[file:cogs_in_game.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example 3 - coming soon(ish)==&lt;br /&gt;
&lt;br /&gt;
=Animation warnings and errors=&lt;br /&gt;
&lt;br /&gt;
{|  style=&amp;quot;border:1px solid gray;border-collapse:collapse;background:white;font-weight:bold; &amp;quot; cellpadding=5px align=left width=70% &lt;br /&gt;
|- style=&amp;quot;font-weight:bold; text-align:center;&amp;quot;&lt;br /&gt;
  ! width=40% style=&amp;quot; border:1px solid gray;&amp;quot;|Warning/Error&lt;br /&gt;
  ! width=60% style=&amp;quot; border:1px solid gray;&amp;quot;|Help/Explanation&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|! ...  T14120: Simplified dummy tracks with just one key.&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;| Not sure what this warning is about but the animation is OK.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|! ... Skipping one or more lines with the same contents&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|This is an ASSIMP message and can be ignored.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|! ...  T2776: FBX: animation is applied to multiple targets&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;| Might be caused by armatures, where the bones does not have names starting with &amp;quot;b.r.&amp;quot;. The armature object itself does not need to have a &amp;quot;b.r.&amp;quot; prefix in its name, however.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Return to Index=&lt;br /&gt;
 &lt;br /&gt;
[[HowToGuides|&amp;lt;&amp;lt; How To Guides]]&lt;br /&gt;
[[Category:How-to guides]]&lt;br /&gt;
[[Category:Modeling]]&lt;br /&gt;
[[Category:Content creation]]&lt;/div&gt;</summary>
		<author><name>Korvtiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Export_from_Blender_using_FBX&amp;diff=31493</id>
		<title>HowTo/Export from Blender using FBX</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Export_from_Blender_using_FBX&amp;diff=31493"/>
		<updated>2022-01-31T20:00:58Z</updated>

		<summary type="html">&lt;p&gt;Korvtiger: /* FBX to Trainzmesh Conversion Warnings and Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to export a simple model from Blender into the [[FBX file format]] for use in Trainz.  The model uses a Trainz PBRMetal format so it is only suitable for TRS2019 and later versions. The Blender source and PBRMetal textures are provided.&lt;br /&gt;
The tutorial was prepared using Blender 2.83.&lt;br /&gt;
&lt;br /&gt;
Some knowledge of using Blender and Trainz asset creation is assumed.&lt;br /&gt;
&lt;br /&gt;
[[File:MyBox asset in game.jpg|500px|left]] {{clear}}&lt;br /&gt;
&lt;br /&gt;
=Video Tutorial=&lt;br /&gt;
&lt;br /&gt;
An additional video tutorial can be found at [https://www.youtube.com/watch?v=qTXgaNOETF0 Exporting basic Cube from Blender with PBR Materials]. That tutorial uses a different mesh model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Asset Creation Workflow=&lt;br /&gt;
&lt;br /&gt;
The basic workflow is:&lt;br /&gt;
:#  Create your mesh.&lt;br /&gt;
:#  Create a UV map for mapping mesh polygons to a texture.&lt;br /&gt;
:#  Apply a Trainz material including textures.&lt;br /&gt;
:#  Export the model to an FBX file.&lt;br /&gt;
:#  Import the model into Trainz.  Trainz will create a Trainzmesh mesh data file.&lt;br /&gt;
&lt;br /&gt;
The provided Blender models are ready for you to do steps 3 through 5.&lt;br /&gt;
&lt;br /&gt;
=Adding the Material and Exporting=&lt;br /&gt;
&lt;br /&gt;
==Load Your Model==&lt;br /&gt;
A Blender 2.83 sample model of a simple box is provided.  The mesh is UV mapped but there is no material or textures linked in the model. The Blender source files include both a starting and completed model together with texture images, config.txt, etc.  For export, just change the owner KUID id to yours.&lt;br /&gt;
The source files can be found here: [[File:blender_box283.zip]]&lt;br /&gt;
:* Create a suitable working folder on your computer.  You might call it &amp;quot;FBX_export_example_1&amp;quot;.&lt;br /&gt;
:* Unzip the files into that folder.&lt;br /&gt;
:* Start Blender and load file &amp;quot;mybox_b283_start.blend&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add the Material and Textures==&lt;br /&gt;
:* On opening, the Blender will be in the default view, with the box mesh selected, and the properties panel open at the materials tab.  There are no materials allocated.  The Outliner Window (top right) shows several Blender collections including a LOD0 and LOD1.  The LOD1 collection is empty since the entire mesh is only 12 triangular polygons.  Using collections named in this fashion makes it easier to export FBX meshes for the same LOD level.&lt;br /&gt;
:* Create a new material and rename it &amp;quot;mybox.m.pbrmetal&amp;quot;&lt;br /&gt;
:* Change to the Shading Workspace.&lt;br /&gt;
:* There are a number of windows visible but the two of most interest are the 3DViewport at the top and the Shader Editor at the bottom.  It is useful to have the 3D Viewer in LookDev mode (aka Material Preview).  The Shader Editor was called the Node Editor in earlier versions of Blender.&lt;br /&gt;
:* The Shader Editor will show a Principled BSDF Shader node and a Material Output node.&lt;br /&gt;
:* For export to Trainz we will need to configure inputs to the shader node so that the texture/image names get correctly associated with the exported mesh and material.  It&#039;s worth noting that the Principled BSDF shader already has a number of PBR values but you cannot assume those values will be correctly exported to Trainz.  For example, Trainz expects the emissive, roughness, ambient occlusion and metallic values to be embedded in a &amp;quot;parameter&amp;quot; file.&lt;br /&gt;
:* We will add three texture nodes and a vector conversion node for the normal map image.&lt;br /&gt;
:* In the Shader Editor:&lt;br /&gt;
:*:* Use Shift A and select Texture-&amp;gt;Image Texture.  This will add a texture node.  Move it to the left of the shader node and towards the top.&lt;br /&gt;
:*:* Select the Image Texture Node and press Shift D and drag the duplicated node below the first texture node.&lt;br /&gt;
:*:* Repeat so you end up with three texture nodes.&lt;br /&gt;
:* Select the top texture node, click on Open and add the file &amp;quot;box_albedo.png&amp;quot;.  You may need to navigate Blender to your working folder as it doesn&#039;t default to your Blender file location.&lt;br /&gt;
:* Connect the texture node Color output to the shader Base Color input.  You should see the albedo (colour) on the mesh in the 3D Editor.&lt;br /&gt;
:* Select the middle texture node and load the file &amp;quot;box_parameter.png&amp;quot;.&lt;br /&gt;
:* Connect the texture node Color output to the shader Roughness input.  The box in the 3D Editor will likely look shiny and will reflect any environment images you may have used.&lt;br /&gt;
:* Change the Color Space to Non Color.  This change may not affect Trainz but it will make the model more closely resemble the final result in Trainz.&lt;br /&gt;
:* Select the bottom texture node and load the file &amp;quot;box_normal.png&amp;quot;.&lt;br /&gt;
:* Connect the texture node Color output to the Shader Normal input.&lt;br /&gt;
:* Select Shift A and choose a Vector-&amp;gt;Normal Map node. Drag it to the noodle (link) between the Normal texture node and the shader and drop it on the centre of the noodle.  The connections will change so the texture node color output is routed through the Normal Map vector to the shader normal input. Leave the value of the Normal Map at Tangent Space.  You can, if you wish, choose a UV map on the Normal Map node.  It doesn&#039;t appear to affect Trainz if that field remains blank.&lt;br /&gt;
:* Change the Normal texture node Color Space to Non Color.&lt;br /&gt;
:* The final shader node setup should look similar to the following picture.  The 3D viewport may look different.&lt;br /&gt;
[[File:B283 material applied.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;mw-customtoggle-shaderComments&amp;quot;&amp;gt;&#039;&#039;&#039;+ Click to show or hide comments about the shader node setup and the rendered asset in the 3D Editor&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot; id=&amp;quot;mw-customcollapsible-shaderComments&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rendered view in the 3D Editor is a product of the inputs and settings in the Shader Node tree.  For our arrangement, the albedo and normal should be correct but the roughness input is not a true roughness value.  It will be a value derived from the RGB channels (emit, roughness and AO).  We use the roughness input only to provide a link to the parameter image within the material so that Trainz can find it.&lt;br /&gt;
You should not assume the mesh, as viewed in Blender, will look exactly the same in Trainz.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Exporting to FBX==&lt;br /&gt;
The model is now ready for export. &lt;br /&gt;
:*	Change to the Default workspace and select the mesh object in the 3D Viewport.  &lt;br /&gt;
:*	Select File-&amp;gt;Export-&amp;gt;Export FBX and the FBX export window will be shown.  If the Export FBX option isn’t shown, then make sure it is enabled in User Preferences.&lt;br /&gt;
:*	Operator Presets.  This option allows you to define an export configuration that can be recalled rather than having to set options each time. &lt;br /&gt;
:*  Path Mode and Batch Mode.  Leave unchanged.&lt;br /&gt;
:*  Tick Selected Objects and leave Active Collection blank.&lt;br /&gt;
:*  For Object Types just select Mesh.&lt;br /&gt;
:*  Ignore Custom Properties.&lt;br /&gt;
:*	Leave the scale value at 1.0.&lt;br /&gt;
:*	Apply Scalings:  Use “FBX All”.&lt;br /&gt;
:*	Forward: select option “Y Forward”.  This automatically changes the Up option to “Z Up” which is correct for Trainz.&lt;br /&gt;
:*  Apply Unit and Apply Transform:  Leave blank.&lt;br /&gt;
:*	Leave the Geometry and Armature settings at their default value.&lt;br /&gt;
:*  Bake Animation: Uncheck.&lt;br /&gt;
:*	Leave any other options at their default values.&lt;br /&gt;
:*	At the top of the window, make sure the selected target folder is your project export folder.&lt;br /&gt;
:*	Enter the target FBX file as “mybox_lod0.fbx” .&lt;br /&gt;
:*	Click on the Export FBX button at the top right.  The mesh will be exported.&lt;br /&gt;
&amp;lt;span class=&amp;quot;mw-customtoggle-exportComments&amp;quot;&amp;gt;&#039;&#039;&#039;+ Click to show or hide comments about the exporter settings&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot; id=&amp;quot;mw-customcollapsible-exportComments&amp;quot;&amp;gt;&lt;br /&gt;
The settings show above are known to work with the base unit setting at &amp;quot;None&amp;quot;.  See Properties Editor-&amp;gt;Scene Properties-&amp;gt;Units-Unit System.&lt;br /&gt;
There are other combinations that will work.  If you find a setting that works for you then save it as a preset. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:B283 FBX export settings.jpg]]  {{clear}}&lt;br /&gt;
&lt;br /&gt;
 TIP: You can save your preferences for a given situation by clicking on the plus button (+) next to Operator Presets and saving the preset with a name.&lt;br /&gt;
&lt;br /&gt;
==Importing into Trainz==&lt;br /&gt;
===Config.txt===&lt;br /&gt;
When you submit your asset, Trainz will convert the FBX file to a Trainzmesh file so the mesh table will need to identify each mesh as such.  For the sample asset the filename will be mycube_lod0.trainzmesh.  See the config.txt in the project folder.&lt;br /&gt;
&lt;br /&gt;
===Texture.txt files===&lt;br /&gt;
You can provide your own texture.txt files (advisable) or let the commit process create them for you.  The commit process will create suitable files, such as those required for normal maps, but you can provide your own if you have special requirements.&lt;br /&gt;
&lt;br /&gt;
===Committing the asset===&lt;br /&gt;
Commit the asset by dragging the folder onto CM.  Assuming the commit is error free, open the asset for edit in explorer and see what Trainz has created.&lt;br /&gt;
The trainzmesh files should be as described above.  The FBX files will also be present so you may want to delete those if you are ready to upload your asset to the DLS or elsewhere.  If you delete the FBX files, then you will need to commit the asset again.  Since the trainzmesh files already exist no FBX conversion is carried out.&lt;br /&gt;
&lt;br /&gt;
== Notes about the box asset==&lt;br /&gt;
The material used for this asset was created within Substance Painter which is a powerful PBR material and texture creation tool.  The decals, including those with normal maps, are part of the decal collection in Substance Painter.&lt;br /&gt;
It is possible to create this material and effects within Blender but well beyond the scope of this tutorial.  There are many video tutorials on the Internet that can assist with the preparation of PBR materials.  There are also low cost addons that can bake PBR textures to image files for use as described in this tutorial.&lt;br /&gt;
==Animation==&lt;br /&gt;
If you are interest in animation for Blender 2.8, see this [[HowTo/Export Blender FBX Animation|page]]. &lt;br /&gt;
&lt;br /&gt;
=Some basic tips for exporting=&lt;br /&gt;
:*  Make sure you triangulate (convert to three sided polygons) before export. You can do this per mesh by using the triangulate command (Ctrl T) in mesh edit mode.  Or you can add a triangulate modifier to the mesh in mesh object mode.&lt;br /&gt;
:*  Make sure you only have one UV map per mesh.  Trainz doesn&#039;t seem to like more than one UV map.&lt;br /&gt;
:*  Unapplied mesh scaling can cause issues including island distortment in the UV editor.  Apply any scaling before export.&lt;br /&gt;
&lt;br /&gt;
=Double Sided Meshes=&lt;br /&gt;
It appears that FBX does not support double sided meshes so you will need to create a metadata file as described at [[FBX file format#Mesh Metadata Files]].  Note that this is done per material.  i.e. you cannot have the same material for single sided and double sided meshes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Errors, Warnings and other Issues=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FBX to Trainzmesh Conversion Warnings and Errors==&lt;br /&gt;
Errors and warnings starting with a T, such as T16128, are errors ouput by the ASSIMP converter and are not output by the Trainz FBX importer.  Errors or warnings starting with VE are generated by Trainz.  See [[Asset_Validation]].&lt;br /&gt;
&lt;br /&gt;
{|  style=&amp;quot;border:1px solid gray;border-collapse:collapse;background:white;font-weight:bold; &amp;quot; cellpadding=5px align=left width=70% &lt;br /&gt;
|- style=&amp;quot;font-weight:bold; text-align:center;&amp;quot;&lt;br /&gt;
  ! width=40% style=&amp;quot; border:1px solid gray;&amp;quot;|Warning/Error&lt;br /&gt;
  ! width=60% style=&amp;quot; border:1px solid gray;&amp;quot;|Help/Explanation&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Warning:  T16080: ...shading mode not recognised: Phong&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;| You can ignore this warning.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Warn,  T15808: FBX-DOM (TOK_KEY, offset 0xnnnn) source object for connection does not exist&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;| You can ignore this warning.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error: Unable to determine vertex format.&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|This can be caused by having multiple UV maps for the same mesh.  For example, baking a painted mesh to a bake mesh requires two UV maps.  Remove old maps before exporting.  If you wish to keep those maps, back up the Blender file and then delete the extra maps.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error, T5268 or T9068, Failed to triangulate polygon (no ear found). Probably not a simple polygon. &lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Try triangulating the mesh, or meshes, using Ctrl T (quads to tris).  If the error continues, try using the Triangulate modifier.  This problem is known to occur when using modifiers that may produce ngons on export.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error, Error, T16128: FindInvalidDataProcess fails on mesh uvcoords: All vectors are identical&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Probably caused by having multiple UV maps for the same mesh. Not sure of the relationship between this error and the &amp;quot;Unable to determine vertex format&amp;quot; error.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error, Mesh attached to scene twice; not currently supported&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Caused by having multiple meshes in the FBX that share the same mesh data, which is caused by the duplicate linked operator (copying objects using Alt-D instead of Shift-D in Blender). Make all meshes single user by selecting all meshes, Object&amp;gt;Relations&amp;gt;Make Single User&amp;gt;Object &amp;amp; Data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Return to Index=&lt;br /&gt;
 &lt;br /&gt;
[[HowToGuides|&amp;lt;&amp;lt; How To Guides]]&lt;br /&gt;
&lt;br /&gt;
[[Category:How-to guides]]&lt;br /&gt;
[[Category:Modeling]]&lt;br /&gt;
[[Category:Content creation]]&lt;/div&gt;</summary>
		<author><name>Korvtiger</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Export_from_Blender_using_FBX&amp;diff=31492</id>
		<title>HowTo/Export from Blender using FBX</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Export_from_Blender_using_FBX&amp;diff=31492"/>
		<updated>2022-01-31T19:58:15Z</updated>

		<summary type="html">&lt;p&gt;Korvtiger: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to export a simple model from Blender into the [[FBX file format]] for use in Trainz.  The model uses a Trainz PBRMetal format so it is only suitable for TRS2019 and later versions. The Blender source and PBRMetal textures are provided.&lt;br /&gt;
The tutorial was prepared using Blender 2.83.&lt;br /&gt;
&lt;br /&gt;
Some knowledge of using Blender and Trainz asset creation is assumed.&lt;br /&gt;
&lt;br /&gt;
[[File:MyBox asset in game.jpg|500px|left]] {{clear}}&lt;br /&gt;
&lt;br /&gt;
=Video Tutorial=&lt;br /&gt;
&lt;br /&gt;
An additional video tutorial can be found at [https://www.youtube.com/watch?v=qTXgaNOETF0 Exporting basic Cube from Blender with PBR Materials]. That tutorial uses a different mesh model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Asset Creation Workflow=&lt;br /&gt;
&lt;br /&gt;
The basic workflow is:&lt;br /&gt;
:#  Create your mesh.&lt;br /&gt;
:#  Create a UV map for mapping mesh polygons to a texture.&lt;br /&gt;
:#  Apply a Trainz material including textures.&lt;br /&gt;
:#  Export the model to an FBX file.&lt;br /&gt;
:#  Import the model into Trainz.  Trainz will create a Trainzmesh mesh data file.&lt;br /&gt;
&lt;br /&gt;
The provided Blender models are ready for you to do steps 3 through 5.&lt;br /&gt;
&lt;br /&gt;
=Adding the Material and Exporting=&lt;br /&gt;
&lt;br /&gt;
==Load Your Model==&lt;br /&gt;
A Blender 2.83 sample model of a simple box is provided.  The mesh is UV mapped but there is no material or textures linked in the model. The Blender source files include both a starting and completed model together with texture images, config.txt, etc.  For export, just change the owner KUID id to yours.&lt;br /&gt;
The source files can be found here: [[File:blender_box283.zip]]&lt;br /&gt;
:* Create a suitable working folder on your computer.  You might call it &amp;quot;FBX_export_example_1&amp;quot;.&lt;br /&gt;
:* Unzip the files into that folder.&lt;br /&gt;
:* Start Blender and load file &amp;quot;mybox_b283_start.blend&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add the Material and Textures==&lt;br /&gt;
:* On opening, the Blender will be in the default view, with the box mesh selected, and the properties panel open at the materials tab.  There are no materials allocated.  The Outliner Window (top right) shows several Blender collections including a LOD0 and LOD1.  The LOD1 collection is empty since the entire mesh is only 12 triangular polygons.  Using collections named in this fashion makes it easier to export FBX meshes for the same LOD level.&lt;br /&gt;
:* Create a new material and rename it &amp;quot;mybox.m.pbrmetal&amp;quot;&lt;br /&gt;
:* Change to the Shading Workspace.&lt;br /&gt;
:* There are a number of windows visible but the two of most interest are the 3DViewport at the top and the Shader Editor at the bottom.  It is useful to have the 3D Viewer in LookDev mode (aka Material Preview).  The Shader Editor was called the Node Editor in earlier versions of Blender.&lt;br /&gt;
:* The Shader Editor will show a Principled BSDF Shader node and a Material Output node.&lt;br /&gt;
:* For export to Trainz we will need to configure inputs to the shader node so that the texture/image names get correctly associated with the exported mesh and material.  It&#039;s worth noting that the Principled BSDF shader already has a number of PBR values but you cannot assume those values will be correctly exported to Trainz.  For example, Trainz expects the emissive, roughness, ambient occlusion and metallic values to be embedded in a &amp;quot;parameter&amp;quot; file.&lt;br /&gt;
:* We will add three texture nodes and a vector conversion node for the normal map image.&lt;br /&gt;
:* In the Shader Editor:&lt;br /&gt;
:*:* Use Shift A and select Texture-&amp;gt;Image Texture.  This will add a texture node.  Move it to the left of the shader node and towards the top.&lt;br /&gt;
:*:* Select the Image Texture Node and press Shift D and drag the duplicated node below the first texture node.&lt;br /&gt;
:*:* Repeat so you end up with three texture nodes.&lt;br /&gt;
:* Select the top texture node, click on Open and add the file &amp;quot;box_albedo.png&amp;quot;.  You may need to navigate Blender to your working folder as it doesn&#039;t default to your Blender file location.&lt;br /&gt;
:* Connect the texture node Color output to the shader Base Color input.  You should see the albedo (colour) on the mesh in the 3D Editor.&lt;br /&gt;
:* Select the middle texture node and load the file &amp;quot;box_parameter.png&amp;quot;.&lt;br /&gt;
:* Connect the texture node Color output to the shader Roughness input.  The box in the 3D Editor will likely look shiny and will reflect any environment images you may have used.&lt;br /&gt;
:* Change the Color Space to Non Color.  This change may not affect Trainz but it will make the model more closely resemble the final result in Trainz.&lt;br /&gt;
:* Select the bottom texture node and load the file &amp;quot;box_normal.png&amp;quot;.&lt;br /&gt;
:* Connect the texture node Color output to the Shader Normal input.&lt;br /&gt;
:* Select Shift A and choose a Vector-&amp;gt;Normal Map node. Drag it to the noodle (link) between the Normal texture node and the shader and drop it on the centre of the noodle.  The connections will change so the texture node color output is routed through the Normal Map vector to the shader normal input. Leave the value of the Normal Map at Tangent Space.  You can, if you wish, choose a UV map on the Normal Map node.  It doesn&#039;t appear to affect Trainz if that field remains blank.&lt;br /&gt;
:* Change the Normal texture node Color Space to Non Color.&lt;br /&gt;
:* The final shader node setup should look similar to the following picture.  The 3D viewport may look different.&lt;br /&gt;
[[File:B283 material applied.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;mw-customtoggle-shaderComments&amp;quot;&amp;gt;&#039;&#039;&#039;+ Click to show or hide comments about the shader node setup and the rendered asset in the 3D Editor&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot; id=&amp;quot;mw-customcollapsible-shaderComments&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rendered view in the 3D Editor is a product of the inputs and settings in the Shader Node tree.  For our arrangement, the albedo and normal should be correct but the roughness input is not a true roughness value.  It will be a value derived from the RGB channels (emit, roughness and AO).  We use the roughness input only to provide a link to the parameter image within the material so that Trainz can find it.&lt;br /&gt;
You should not assume the mesh, as viewed in Blender, will look exactly the same in Trainz.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Exporting to FBX==&lt;br /&gt;
The model is now ready for export. &lt;br /&gt;
:*	Change to the Default workspace and select the mesh object in the 3D Viewport.  &lt;br /&gt;
:*	Select File-&amp;gt;Export-&amp;gt;Export FBX and the FBX export window will be shown.  If the Export FBX option isn’t shown, then make sure it is enabled in User Preferences.&lt;br /&gt;
:*	Operator Presets.  This option allows you to define an export configuration that can be recalled rather than having to set options each time. &lt;br /&gt;
:*  Path Mode and Batch Mode.  Leave unchanged.&lt;br /&gt;
:*  Tick Selected Objects and leave Active Collection blank.&lt;br /&gt;
:*  For Object Types just select Mesh.&lt;br /&gt;
:*  Ignore Custom Properties.&lt;br /&gt;
:*	Leave the scale value at 1.0.&lt;br /&gt;
:*	Apply Scalings:  Use “FBX All”.&lt;br /&gt;
:*	Forward: select option “Y Forward”.  This automatically changes the Up option to “Z Up” which is correct for Trainz.&lt;br /&gt;
:*  Apply Unit and Apply Transform:  Leave blank.&lt;br /&gt;
:*	Leave the Geometry and Armature settings at their default value.&lt;br /&gt;
:*  Bake Animation: Uncheck.&lt;br /&gt;
:*	Leave any other options at their default values.&lt;br /&gt;
:*	At the top of the window, make sure the selected target folder is your project export folder.&lt;br /&gt;
:*	Enter the target FBX file as “mybox_lod0.fbx” .&lt;br /&gt;
:*	Click on the Export FBX button at the top right.  The mesh will be exported.&lt;br /&gt;
&amp;lt;span class=&amp;quot;mw-customtoggle-exportComments&amp;quot;&amp;gt;&#039;&#039;&#039;+ Click to show or hide comments about the exporter settings&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot; id=&amp;quot;mw-customcollapsible-exportComments&amp;quot;&amp;gt;&lt;br /&gt;
The settings show above are known to work with the base unit setting at &amp;quot;None&amp;quot;.  See Properties Editor-&amp;gt;Scene Properties-&amp;gt;Units-Unit System.&lt;br /&gt;
There are other combinations that will work.  If you find a setting that works for you then save it as a preset. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:B283 FBX export settings.jpg]]  {{clear}}&lt;br /&gt;
&lt;br /&gt;
 TIP: You can save your preferences for a given situation by clicking on the plus button (+) next to Operator Presets and saving the preset with a name.&lt;br /&gt;
&lt;br /&gt;
==Importing into Trainz==&lt;br /&gt;
===Config.txt===&lt;br /&gt;
When you submit your asset, Trainz will convert the FBX file to a Trainzmesh file so the mesh table will need to identify each mesh as such.  For the sample asset the filename will be mycube_lod0.trainzmesh.  See the config.txt in the project folder.&lt;br /&gt;
&lt;br /&gt;
===Texture.txt files===&lt;br /&gt;
You can provide your own texture.txt files (advisable) or let the commit process create them for you.  The commit process will create suitable files, such as those required for normal maps, but you can provide your own if you have special requirements.&lt;br /&gt;
&lt;br /&gt;
===Committing the asset===&lt;br /&gt;
Commit the asset by dragging the folder onto CM.  Assuming the commit is error free, open the asset for edit in explorer and see what Trainz has created.&lt;br /&gt;
The trainzmesh files should be as described above.  The FBX files will also be present so you may want to delete those if you are ready to upload your asset to the DLS or elsewhere.  If you delete the FBX files, then you will need to commit the asset again.  Since the trainzmesh files already exist no FBX conversion is carried out.&lt;br /&gt;
&lt;br /&gt;
== Notes about the box asset==&lt;br /&gt;
The material used for this asset was created within Substance Painter which is a powerful PBR material and texture creation tool.  The decals, including those with normal maps, are part of the decal collection in Substance Painter.&lt;br /&gt;
It is possible to create this material and effects within Blender but well beyond the scope of this tutorial.  There are many video tutorials on the Internet that can assist with the preparation of PBR materials.  There are also low cost addons that can bake PBR textures to image files for use as described in this tutorial.&lt;br /&gt;
==Animation==&lt;br /&gt;
If you are interest in animation for Blender 2.8, see this [[HowTo/Export Blender FBX Animation|page]]. &lt;br /&gt;
&lt;br /&gt;
=Some basic tips for exporting=&lt;br /&gt;
:*  Make sure you triangulate (convert to three sided polygons) before export. You can do this per mesh by using the triangulate command (Ctrl T) in mesh edit mode.  Or you can add a triangulate modifier to the mesh in mesh object mode.&lt;br /&gt;
:*  Make sure you only have one UV map per mesh.  Trainz doesn&#039;t seem to like more than one UV map.&lt;br /&gt;
:*  Unapplied mesh scaling can cause issues including island distortment in the UV editor.  Apply any scaling before export.&lt;br /&gt;
&lt;br /&gt;
=Double Sided Meshes=&lt;br /&gt;
It appears that FBX does not support double sided meshes so you will need to create a metadata file as described at [[FBX file format#Mesh Metadata Files]].  Note that this is done per material.  i.e. you cannot have the same material for single sided and double sided meshes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Errors, Warnings and other Issues=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FBX to Trainzmesh Conversion Warnings and Errors==&lt;br /&gt;
Errors and warnings starting with a T, such as T16128, are errors ouput by the ASSIMP converter and are not output by the Trainz FBX importer.  Errors or warnings starting with VE are generated by Trainz.  See [[Asset_Validation]].&lt;br /&gt;
&lt;br /&gt;
{|  style=&amp;quot;border:1px solid gray;border-collapse:collapse;background:white;font-weight:bold; &amp;quot; cellpadding=5px align=left width=70% &lt;br /&gt;
|- style=&amp;quot;font-weight:bold; text-align:center;&amp;quot;&lt;br /&gt;
  ! width=40% style=&amp;quot; border:1px solid gray;&amp;quot;|Warning/Error&lt;br /&gt;
  ! width=60% style=&amp;quot; border:1px solid gray;&amp;quot;|Help/Explanation&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Warning:  T16080: ...shading mode not recognised: Phong&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;| You can ignore this warning.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Warn,  T15808: FBX-DOM (TOK_KEY, offset 0xnnnn) source object for connection does not exist&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;| You can ignore this warning.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error: Unable to determine vertex format.&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|This can be caused by having multiple UV maps for the same mesh.  For example, baking a painted mesh to a bake mesh requires two UV maps.  Remove old maps before exporting.  If you wish to keep those maps, back up the Blender file and then delete the extra maps.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error, T5268 or T9068, Failed to triangulate polygon (no ear found). Probably not a simple polygon. &lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Try triangulating the mesh, or meshes, using Ctrl T (quads to tris).  If the error continues, try using the Triangulate modifier.  This problem is known to occur when using modifiers that may produce ngons on export.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error, Error, T16128: FindInvalidDataProcess fails on mesh uvcoords: All vectors are identical&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Probably caused by having multiple UV maps for the same mesh. Not sure of the relationship between this error and the &amp;quot;Unable to determine vertex format&amp;quot; error.&lt;br /&gt;
|-&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Error, Mesh attached to scene twice; not currently supported&lt;br /&gt;
  | style=&amp;quot;border:1px solid gray;font-weight:normal;&amp;quot;|Caused by having multiple meshes in the FBX that share the same mesh data, which is caused by the duplicate linked operator (copying meshed using Alt-D instead of Shift-D). Make all meshes single user by selecting all meshes, Object&amp;gt;Relations&amp;gt;Make Single User&amp;gt;Object &amp;amp; Data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Return to Index=&lt;br /&gt;
 &lt;br /&gt;
[[HowToGuides|&amp;lt;&amp;lt; How To Guides]]&lt;br /&gt;
&lt;br /&gt;
[[Category:How-to guides]]&lt;br /&gt;
[[Category:Modeling]]&lt;br /&gt;
[[Category:Content creation]]&lt;/div&gt;</summary>
		<author><name>Korvtiger</name></author>
	</entry>
</feed>