From Wikibooks, the open-content textbooks
The first thing you have to do is install Blender. So go
directly to http://en.wikibooks.org/wiki/Trainz/Tutorial_for_Blender#Getting_started
and follow the instructions on installing Blender and the
The recommendation is to watch the video tutorials http://en.wikibooks.org/wiki/Trainz/Tutorial_for_Blender#Video_tutorials_from_Blender.org
before attempting the basic house tutorial but it is not essential
to do so.
Next you need to create something then export it.
- Tutorial to build a basic
To texture this house download kuid:86627:2491 or any version of
it. You want the texture file from it "Terrace one.tga". Use that
file and the texture tutorial to texture the house. It is 3.25 mb
download so if you don't have a first class ticket you might do
better downloading it from TPR http://trainzproroutes.com/downloads/index.php
"Leopold Lane" under buildings.
- Tutorial to texture a basic
To export the house:
- Tutorial to export a basic
To convert it into a moving house:
- Tutorial to create a moving
If we change the shape we can actually get a reasonable basic
wagon out of it.
Also please note that Paul Hobbs has three blender tutorials
These tutorials cover a lot of material quite quickly and Paul
is very knowledgeable.
- The intention of this page is to assist people in exporting
their Blender creations directly to Trainz using the Blender
Exporter for Trainz. Only items that are pertinent to the exporter
will be described here. If you are stuck in Blender or have a
question about Content Creation itself, then you find a lot of
explanations and experienced people under the following links:
- Blender Documentation
- Blender Community
- TRS2006 Content Creation
- Trainz Discussion
Video tutorials from
Start with the Interface.avi then follow with the 3dview.avi
- Blender getting started
- Blender video
- Blender animation video
tutorial View this one to see how to make a roof.
Under the heading Textures is a basic tutorial
that will guide you through creating a cylinder in Blender then
exporting it as a scenery object and also as a wagon into Trainz.
Sample config.txt files for cylinder are available on the DLS.
Please do the video getting started tutorials first.
Blender is a big complex product but we only need a sub section
of the features for building models for Trainz, so start with the
tutorial under Textures then have a look through the getting
started videos, especially the interface ones.
Things you may find useful when working with Blender.
Under File is "load factory settings", in Blender it is possible
to change the default this one gets you back to sanity.
When texturing with an external .tga file the exporter expects a
certain type of texturing. Even if you can see it in Blender it may
not export. F6, choose as texture type "Image" and load your image
b is box select, ie select everything in the box.
Trainz requires absolute sizes and positioning, type "N" to
bring up a properties page so you can type in dimensions directly.
Note the name is entered here OB:a.limback etc. You can select or
search and select an object in the outliner window / view, then
mouse over to a 3d view where you can tab to edit. You may need to
experiment in outliner to find the view that lets you select.
Working with four windows above the button window makes sense.
If you go into user preferences (click the mouse just below the
file add labels and pull them down) click on the view name button
each quadrant will be labelled.
Number pad 0 is camera view, the others are 1 3 7. <Ctrl>3
or <Shift>3 gives the opposite side etc. 5 changes from ortho
view to perspective.
fa: next to the www.blender.org 2.46 gives the number of faces,
multiply by 2 to get poly counts. M move the selected item to a
different level to see the poly count for a selected item. You can
reduce the poly count be selecting unseen faces then deleting
F9 brings up the double sided button to turn off double sided
Use append (<Shift><F1>)to combine things from two
To change the texture file name F6, then change the file name
To pick out an item by name use the outliner.
When creating an animated load note that the first and last
frame seem to interact so the highest load should be the frame
before last or a wagen with no load may show the high load when
empty. Also export with the frame number set to the highest
To tile a texture in Blender "Select your plane, press F, press
A until all the faces are selected, and then in the UV image editor
press A a few times untill everything is selected. Press S and
scale it up. That is it... just scale it bigger then the UV texture
window and it will automatically tile for you"
The following link shows how to (use) import blue prints into
Importing from GMAX into Blender
The process is:
first tutorial setting up GMAX.
Page 6 and 7 refer to Tempest game pack this gives you a MD3
export. It also tells you were to download the tempest game pack.
If you get desperate I think I have it somewhere. Getting out of
GMAX is the most difficult part.
Then go here: https://svn.sourceforge.net/svnroot/...trunk/blender/
copy all the scripts into your Blender script folder.
- What you need to create content for Trainz with Blender is
obviously Blender itself and the Blender Exporter for
Trainz. The script was developed for Blender 2.45, but any
later version should work also. To use the Blender Exporter for
Trainz, you must unzip the archive and copy the included file
trainz_exporter.py into the script directory of Blender.
This is normally the folder scripts located in the
subdirectory .blender, so if you install Blender on a
Windows system using the default path, you have to copy the file
trainz_exporter.py from the archive into the folder
Foundation\Blender\.blender\scripts. On some Blender
installations it maybe found in Application Data\Blender
Foundation\Blender\.blender\scripts under document and settings,
application data maybe a hidden folder / directory in windows which
makes locating it difficult sometimes especially on Windows 7
machines where you may have to turn off UAC to reach it.
Every time Blender starts it scans this directory and include
any scripts found into its menu structure. So if you start or
restart Blender after copying the exporter script then you call it
using the Blender menu File > Export > Trainz
Export. After selecting what you want to export and if no
problems occur you find yourself in Blender's file save dialog.
Choose the desired location and filename and press
Save to finally create the resource file. You
should always check the Blender console for infos or warnings, as
the exporter only stops at fatal errors.
- Whilst we are still experimenting to find the best Blender
settings to get the best results in Trainz based on what we have
found out so far here are some suggestions:
- In Blender you can't scale units like in GMAX(where you have to
set in preferences that a system unit should be one meter), simply
assume that one BU(Blender Unit) is one meter, that's it. The
exporter has a conversion of one Blender unit to one meter as part
of the script. If you want to use imperial units, then you may wish
to explore Blender Mesh Attribute
- If you want to move an object to an absolute position, then
change to Object Mode(Hotkey TAB) and press
N. In the now visible Transform Properties window
you can enter the values you need. But beware, LocX, LocY and LocZ
are local values, only if an object doesn't have a parent these are
world coordinates. If you have already assigned a parent, then you
will see and must enter the location relative to that parent.
- Not all material properties visualized in Blender will have
effect in Trainz, and some effects in Trainz are unable to be
visualized in Blender. So don't trust what you see in Blender and
take a look at your creation in Trainz.
- Regarding textures, only diffuse, opacity, reflection and
normal maps have effect in Trainz. You can also export meshes
without any texture.
- Meshes are the Blender objects you will see in Trainz. You can
build your objects by manipulate Blender primitives or even place
vertices and create faces. Just keep in mind the following
- center your creation around the point of origin, as Trainz
place this point at cursor position when you insert the asset
- Faces can be double or single sided, in Blender this is a mesh
and not a material option. You will recognize the difference only
in Trainz, as Blender render faces always double sided.
- every mesh needs a material; you can use one material for
- keep an eye on vertex and face count
- The Exporter only recognizes meshes which are visible during
export. Make sure all objects you want to export are visible and
you have selected all needed layers too! There are two reasons for
this behaviour: First, nothing will be exported what you not
see(maybe a long forgotten test mesh). The second reason is that
you can hold big or animated objects in one Blender file and export
only the needed parts by changing visibility(here the layers comes
- The term bone in this section stand in general
for a helper object to build up hierarchical animation systems. It
is not related to the subobject Bone
contained in Blender Armatures. Up to now Blender Exporter
only recognize Lattices as valid
- here are two tutorials to get a clue about animation basics in
- • Animation do this video tutorial first to understand the
basics like where the frame number is. 
- • Next for simple animation such as we use in Trainz do this
- As soon as you want to animate your asset, there is no way
around using bones. You can create bones by placing a
Lattice(Add > Lattice) and rename it to
something like b.r.something as it is described for the
bone naming conventions in CCG.
- Note the animation works by making the bone b.r.rot etc a
parent of object then the animation is applied to the bone.
- If you use bones you need to build up a complete hierarchy,
that mean starting from a root bone all other bones or meshes need
to be child of this root bone or any subordinated bone. The
Exporter will fail if you have loose meshes or bones, because
unbound meshes will not shown in Trainz.
- The root bone should be located at the point of origin and
should not be rotated. Best practice might be to place it in top
view (Hotkey NumPad 7) and leave it untouched. The
root bone also must not be animated; it serves as parent for any
not animated mesh within this asset and for any bone which is not
driven by/depending on an animated parent.
- To export bones they must be visible; so watch your Outliner
and your Layers.
- Attachment points are used in Trainz to attach effects, tracks
or even other meshes. To create an AP you have to add an Empty
first(Add > Empty). Afterwards place and rotate
it like you need and give it a name following the CCG-Rules for
APs(a.whatsoever, do you remember? ;)). APs don't
need a parent, as this information will get lost during export. To
although made animation possible, Trainz use an extended naming
schema. Assume you have a bone b.r.john and an AP
a.doe. To tell Trainz that a.doe should be
animated like b.r.john, you must rename the AP to
a.r.john/a.doe. In your config.txt this AP is still to
refer as a.doe.
- What is valid for meshes and bones, is also valid for
attachment points: If they are not visible, they will not be
- You can manipulate diffuse and specular color in Blender to
give the material in Trainz the appearance you want. Both you find
at the material panel, Col for diffuse and
Spe for specular color:
1 - Blender material panel
- There are two other colors supported by Trainz: ambient and
- The ambient color in Blender work different from Trainz and as
in most cases ambient and diffuse color will be equal, ambient
color is copied from diffuse color during export. The emissive
color is used for self illumination in Trainz and not provided in
Blender. As things normally have the same color even if lighted or
light, the Exporter here also copies the value of diffuse
- If you plan to use textures you should set the diffuse color to
pure white, else your textures will appear darker in Trainz than
- Also on the material panel you find the slider for Opacity, in
Blender called Alpha(slider A down at the right
side). A value of 1 means the material is completely visible, a
value of 0 render your material completely invisible. If you use
texture maps which also affect the opacity, then better leave the
Alpha-slider at its right position as the over all opacity will not
be higher then the material opacity.
- Specularity can be adjusted using the shader panel. The
interesting sliders are specularity Spec and
hardness Hard in the middle of the panel.
2 - Blender shader panel
- Slider specularity maintain the intensity of specular color
from 0(no specular highlight) up to 2(full specular highlight),
while slider hardness define how concentrate the reflected light
should be. A high hardness gives a hard specularity(imagine glass
or an polished surface), while a low hardness gives a dull
shine(like asphalt or rough/dirty metal). The hardness
range(0..511) will be scaled down from the Exporter to 0..128. A
hardness value below 4 switch off specularity to avoid strange
effects in Trainz.
- The brightness without to be lighted. You find the slider
Emit in the lower right corner of shader panel.
The more emissive you order, the more your material glow in diffuse
This is the area that causes the most problems.
This is the simplest case so do it first, once you have this
part working you can add complexity.
Right click the image below and save it as Blender cylinder
texture.jpg. Trainz can use .jpg files but it is much better to
convert it to Blender cylinder texture.tga.
After starting Blender, delete the default cube, and press
space, then create a cylinder of 8 sides, press "N" this puts a
properties tab up and you can see what object Blender is focused
If you change the numebrs in the properties tab you can change
the height and direction etc of the model. Here the cylinder has
been raised to 2 metres by changing LocZ value to 2.00 and it's
direction by changing it's RotY to 90.
Next F5, under 'links and pipeline' select 'add new'.
Now F6 and under the texture tab select "add new"
select 'image' from the texture type.
Now under the image tab, press 'load' then navigate to your
image file. Double click the image file and its name appears in the
navigation widow. Press 'select image' and the details and
confirmation will appear in the image tab.
F5 to change the map input to UV
Change one window to UV/Image editor and tetxure file.
We have to unwrap the image so change from object mode to edit
Type U to unwrap, selecting 'Unwrap (smart projections)'.
Accept the defaults.
Now to modify the mapping, select the face tool in the UV/Image
editor on the far right of the screen shot, you may need to scroll
to see it, <Crtl> <up arrow> with the mouse on the
UV/Image editor screen may make this easier to see.
Select scale rotate as normal in Blender.
In more detail, in the UV window, select all eight lower end
faces and move them over the orange circle then scale them down to
fit inside the circle. Do the same with the top end faces and the
blue circle. (Reminder, RMB selects a face, Shift RMB selects more
than one at a time. Once selected, use G for grab, use S for scale,
R for rotate, LMB accepts the change.)
Don't forget to scale down the sides to avoid a dot in the
For a preview of the result, press F12"
Return to object mode.
Now export the model to Trainz. File/Export/Trainz Export.
export to Cylinder.im to match the sample kuid. Copy the
cylinder.im file, texture and texture.txt file into a scenery
object clone such as kuid 86627:1791 available on the DLS. The
scenery object should show up in Trainz.
If you don't have the Trainz Exporter get it here: and copy the
file into Blender Foundation\Blender\.blender\scripts
To create a wagon or loco we need to add attachment points and
have a different config.txt file such as 86627:1792, available on
the DLS. First we need it to be rotated so it lies along the track.
Note the Y and Z values here.
We are going to add more items to the scene and in order to
select items easily in Blender we use the outliner, first bring it
up then switch the view until you get the outline.
Next we add the empty which will become our attachment
Trainz expects to see a specific name on the attachment point so
we change the name in the properties OB: to a.limfront
Now change the z value to .89, the Y value to -4.5 X to 0.
Duplicate (Shift D) and rename a.limback change the y value to
we also need a.bog0, x0, y-1, z0 a.bog1, x0, y1, z0
and if you are using the sample wagon config
a.bog2, x0, y0, z0
Now save your work (Name your file 'cylinder') and export the
model to Trainz. File/Export/Trainz Export. Copy the cylinder.im
file, texture and texture.txt file into a wagon object clone such
as kuid 86627:1792 available on the DLS. The wagon object should
show up in Trainz. Note the sample kuid has two cylinders so if you
see one you have been successful.
At first some common things to textures:
- NEVER use packed picture formats, as they often distort colors,
wasting resources while loading(to extract they need additional
memory and CPU-time) and at last they have the same footprint in
memory as an uncompressed picture format. A good format is
Targa(*.tga), as it is uncompressed(don't use the RLE-option!) and
has the ability to store also an alpha channel if needed.
- Made your textures as small as possible. What ever should work
is the creation of your texture twice as big as finally used and
afterwards scale them down with enabled antialiasing. You get
nearly the same detail grade as in the original map and need only
1/4 of its memory.
- Always use "power of 2" values as map dimensions(i.e. 64x64,
128x128, 128x512). Such textures could processed very fast,because
"power of 2" - numbers are the native language of your hardware. If
you don't abide by this rule your meshes will be white in Trainz.
You don't have to use square maps, but you must avoid an aspect
ratio above 1:8 (this is unsupported in Trainz).
- In Blender in order to access textures you must first add them
to the project through the texture panel you find in the Material
buttons window(Hotkey F5).
3 - Blender Texture panel - empty
4 - Blender Texture panel - texture
- After creating a TE-object you have to tell Blender where the
mapping information should came from(Map Input) and which material
property should be influenced(Map To).
5 - Blender Map Input panel
6 - Blender Map To panel
- The default map input choosen by Blender is
Orco. For reflection maps that's OK, but for the
other used maps the Exporter only accept UV
mapping. As mapping target you can choose one or more of the
- Col, used for diffuse maps
- Alpha, used for opacity maps
- Ref, used for reflection maps
- Nor, used for normal(bump) maps
- You can assign other mapping targets and these textures will be
exported, but you will not notice the slightest effect in
- What's now left to do is of course loading the texture itself.
In Blender you define the content of a texture using the Texture
buttons window(Hotkey F6). The only texture type
you can export to Trainz is Image, so you can
ignore all other possibilities you have in Blender.
7 - Blender Texture buttons
- Now select the appropriate image by pressing
Load on the Image panel.
- There is only one option left, the option "no texture". The
Blender Exporter for Trainz allows you to export models without any
texture. This can speed up asset creation due to "quick checks" of
the pure mesh directly in Trainz. To export without any texture you
simply have to delete eventually assigned texture objects.
- Diffuse textures are the most used textures, they basically
define the surface of objects. To use them you have to select
button UV as input and button Col
as output. The texture amount you can adjust with slider
Col, located at the right middle of the Map To
- Alpha textures are used to simulate transparent materials or to
make parts of your object invisible. You can create dirty windows
or let a simple plane look like a bogey part. An alpha map normaly
comes together with a diffuse map, so the needed
UV mapping should already be done. As target
select Alpha. The texture amount is controled by
slider Var at the right side of Map To panel.
- You can combine diffuse and opacity texture if you use an image
with alpha layer. You need to select the option
UseAlpha at the Map Image panel and must select
Col and Alpha as targets at the
Map To panel.
- One little problem can occure if you work with opacity: Due to
a bug in Trainz not completely opaque or transparent areas may
overlap each other. You can take a look at the problem and one
possible work around by downloading the two related examples from
- These textures are a bit different in usage as the others,
because Trainz map them automatically using spherical mapping. How
this works you can imagine best if you create a smooth sphere and
assign a reflection map. Which map part is shown depend on the
direction in which the imaginary ray from the camera to the objects
surface would be reflected. That's why you see the whole map on the
surface of a smooth sphere.
- To use reflection maps you only need to press button
Refl in Map Input panel and button
Ref in the Map To panel of the designated texture.
You will notice that no colors appear neither in material preview
nor in render window. That's because Blender use reflective
textures to modify the strenght and not the color of reflection.
But no fear, in Trainz you get your colors back ;).
- You can assign hardness textures but you will be disappointed.
They don't affect hardness, instead they will be typed as
reflective texture during export. This behavior is copied from the
original exporter, as any attempt to influence the "shinestrength"
so far ends in a complete white unlighted object.
- A normal texture is used to fake highs and lows on an plain
surface. To use it you need an UV Map Input and a
Nor Map To. Please take care to use an normal map
and not a bump map. Both are used for the same purpose, but they
contain different data.
- How a texture influence the object appearance in Trainz is
controlled by so called "material name decorations". With one
exception the Blender Exporter for Trainz select the appropriate
decoration depending your assigned textures. This exception is
m.billboard, as this material decoration is used for
objects always face the camera. Because the Exporter has no chance
to detect if you want this behavior, you have to decorate the
material name for yourself with the ending m.billboard.
General the Exporter don't overwrite a known material decoration,
so if you want to ensure your material will be exported as
m.gloss, then simply append m.gloss for yourself
to the material name.
- a list of all currently supported texture combinations
- single textures:
- diffuse texture
- reflection texture
- hardness texture(will appear as reflection texture)
- double textures:
- diffuse & alpha texture
- diffuse & reflection texture
- diffuse & hardness texture(the same as diffuse &
- diffuse & normal texture
- triple textures:
- diffuse, reflection & alpha texture(in this case the alpha
texture affects the reflection texture and not the diffuse
- diffuse, alpha & normal texture(no reflection or hardness
- diffuse, reflection & normal texture(no alpha texture
- In case of animation export the original exporters ask you for
an event file to bind events to specific frames. To use events with
the Blender Exporter for Trainz is similar. Switching a Blender
window to Text Editor window and create a new TX object via
File > New (Hotkey Alt N).
Enter for every event a line with frame number, event type and
event name. If you finally rename this TX object to
events, then the Exporter will parse this text and create
the desired entries in your animation file.
- Examples you find as additional files at the download section