Modding assets for trainz

Dedicated to showcase and discuss about all of your modded assets. (Mostly locomotives)

Example:
mesh edits
AMMs (additional mesh mods)
Reskins
And other things like config file editing
And kitbashing
 
Last edited by a moderator:
Let's start off with AMMs
Examples being my current 3 modded jnr c57.

Warning: this process involves config file editing, so for the people on Android I'm afraid this mod can only be done on PC

Anyways
What you'll need is "IM editor" https://contentcreation.trainzsimulator.com/im-editor-edit-im-files/

Process:
I can't explain it all here, but I'll make a full video about it the process on my YouTube channel. https://youtube.com/@war_department_j50_2?si=_lbruI6jXff6V-N-
But to break it down, you add attachment points in the loco mesh using IM editor. save it. Go into the loco config and add this

Code:
mesh-table
{
  default
  {
    mesh "example_loco_mesh.im"
    auto-create 1 
    }
  }
 
  Example_link
  {
    auto-create 1
    mesh "file_name/mesh_name.im"
    att "a.attachment_name"
    att-parent "default"
  }
}

Or using kuid

Example_link
Code:
  {
    kind "attachment"
    default-mesh <mesh kuid>
    att "a.attachment_name"
  }
Also note: I was inspired to do this after going through "keimei" config file. So keimei if your reading this your a big inspiration
 
Sorry for being gone (I've been busy with my personal life)

We're gonna talk about modelling and exporting
I use blender 4.2 as my main modelling software, and blender 2.79 for exporting and animation.
So the official documents for installing trainz blender IM Exporter for 2.79 is now outdated, here's how you should do it
You can get the files from blender Exporter 0.96 here https://sourceforge.net/projects/blenderextrainz/
And "trainzmeshimporter" https://online.ts2009.com/mediaWiki/index.php5/Downloads "meshimporterTS12.zip"

Step-by-step
1. Unzip both files
2. You can't just "install addon from files" you want to copy everything from the blender Exporter 0.96 files
3. Go into blender 2.79 files "scripts, addons"
4. paste the files from the blender Exporter 0.96 into it
5. Go to file "meshimporterTS12"
6. Copy "trainzmeshimporter"
7. Go back to 2.79 addons files
8. Paste"trainzmeshimporter" in
9. Done


As for modelling again I mainly use blender 4.2 because the controls are easier and works way smoother
I use trainz simulator 2009 SP4 (3.3)
So need to export it as "index mesh" (IM)
So I export to 2.79, How to export it into 2.79 is relatively simple.
In 4.2 I always add "shade auto smooth"
Then you want to export the mesh as a Wavefront .obj format (default settings)
Then in 2.79 import .obj (again default settings)
After you import it in you can add materials/textures
And this is important! Before exporting add "edge split" modifier otherwise after exporting the smoothing would look f*cked
If after exporting the mesh have invisible faces go back to blender add "solidify" modifier then "edge split" again then export it again
 
Last edited by a moderator:
So I finally got the proper documents, enough information and screenshots to show you how to do "Additional Mesh Mods" or "AMMs"

IMPORTANT WARNING: AMMs are different from "Attachment Effect"
(see this documentation: https://online.ts2009.com/mediaWiki/index.php/Attachment_Effect)
AMMs works with both separate mesh files inside the locomotives files itself, and kuid meshes. However they only with static meshes ONLY! The don't work with animated mesh or scripted lamps. For those you need to use "Attachment Effect"
 
Example: reskin br blue lner non-corridor tender, with the br crest being a sperate mesh
Br-blue-lner-non-corridor-tender-%28br-crest-is-a-separate-mesh%29.jpg
 
Walkthrough:

Adding attachment "a.crest" using 'IM Editor'
Adding-attachment-point-using-%22IM-Editor%22.jpg


Folder "br_crest"
Checking-the-files-to-make-sure-I-have-the-br-crest-mesh-ready.jpg


Mesh "br_crest.im" preview after exporting from blender
Mesh-%22br_crest.im%22-in-pevsoft-%27trainz-mesh-viewer%27.jpg


Adding "br_crest" to the mesh-table
Adding-%22br_crest.im%22-to-the-mesh-table.jpg
 
As for modelling again I mainly use blender 4.2 because the controls are easier and works way smoother
I use trainz simulator 2009 SP4 (3.3)
So need to export it as "index mesh" (IM)
So I export to 2.79, How to export it into 2.79 is relatively simple.
In 4.2 I always add "shade auto smooth"
Then you want to export the mesh as a Wavefront .obj format (default settings)
Then in 2.79 import .obj (again default settings)
After you import it in you can add materials/textures
And this is important! Before exporting add "edge split" modifier otherwise after exporting the smoothing would look f*cked
If after exporting the mesh have invisible faces go back to blender add "solidify" modifier then "edge split" again then export it again
Why not export directly from 4.2 there is both an .im exporter and you can export FBX which in more flexible.

John
 
Note: Eventually I want to make the files for doing these mods "open source" however I'm still constantly adding more stuff to the text document. So I'm not sure when I will release it.
The reason I want to release it in the first, is because it's "essential" and could be a massive help to new developers from typing everything by hand which trust me is painful
 
Why not export directly from 4.2 there is both an .im exporter and you can export FBX which in more flexible.

John
Unfortunately I can't use the .FBX format
Because I only have trainz simulator 2009 SP4 (3.3) that I got from a giveaway. I don't have the money to buy T:ANE or TRS19, I'm currently a 15 year old teenager from Thailand (graduating middle school next week) with no proper bank account.

And the other reason me and (some other small developers) still use .im is "compatibility" if the content is compatible with other versions of trainz like TS12, not locked to the newest version of trainz.
you will have a wider reach to share your content, and also prevent piracy, because some people want to use a TRS19 model in Trainz 2009

So I hope you understand MR.John

And also Riley's .im Exporter doesn't work for me
I want to make high detail model but with seamless compatibility so I'm sticking to my setup of blender 4.2 and 2.79

Ant (orangeengine69)
 
Last edited by a moderator:
And also Riley's .im Exporter doesn't work for me
I want to make high detail model but with seamless compatibility so I'm sticking to my setup of blender 4.2 and 2.79
Sometimes you can't go back from 4.2 to 2.79b and that's a problem. The .im exporter that works with 4.2 should work in TRS2009.

Cheerio John
 
Sometimes you can't go back from 4.2 to 2.79b and that's a problem. The .im exporter that works with 4.2 should work in TRS2009.

Cheerio John
Sorry. I don't just open the .blend file from 4.2 in 2.79!
It will not load!, Instead it will give a blank scene and an error message. As the 2 versions are too different from each other.
I will instead export the mesh as a .obj with "shade auto smooth" for the best looking effect. import it into 2.79 where I can add materials, attachments, rigging, etc
Finally (I learned from after exporting a mesh edited German engine) you need to apply the "edge split" modifier so the smoothing effect won't get f*ck up after exporting.
(I know some other modeller are gonna scream at me for this, but I don't care)
It's a streamline process for me, for amazing looking models with seamless compatibility. And it fun

Ant
 
Sorry. I don't just open the .blend file from 4.2 in 2.79!
It will not load!, Instead it will give a blank scene and an error message. As the 2 versions are too different from each other.
I will instead export the mesh as a .obj with "shade auto smooth" for the best looking effect. import it into 2.79 where I can add materials, attachments, rigging, etc
Finally (I learned from after exporting a mesh edited German engine) you need to apply the "edge split" modifier so the smoothing effect won't get f*ck up after exporting.
(I know some other modeller are gonna scream at me for this, but I don't care)
It's a streamline process for me, for amazing looking models with seamless compatibility. And it fun

Ant
Yes, well not perhaps the method I'd have chosen but if it works whatever. Normally when you export as .obj not everything gets carried across so just be aware of it and I suggest you at least try the .im exporter for blender 2.8 and above.
 
I did a tutorial (text) for the Trainz WiKi but it's a bit historical now. :) See How to export from Blender

I still keep a copy of Blender 2.79b as sometimes I need to repair older models for the CRG, create LODs for those models, etc. Torsten's XML exporter was pretty solid for its day and remains a valid exporter in conjunction with N3V's TrainzMeshImporter.exe. Riley's IM exporter is great for recent Blender versions but the current exporter will not work with some versions of Blender between 2.8 and 4.something. I haven't kept track of versions but I do know there is a problem.

Anyway, Blender 2.79b is just fine for what you are doing even though I have to do a brain reboot when returning to it. The interface is very different to 4.x.

In your set of tools you might try Andi/Pev's AssetX as it will work well with TS2009. I still use it as a project management/repair tool even though it's a bit busted for FBX/PBR and later Trainz requirements. AssetX was a shared project of Andi Smith and Peter Villaume (PEV). Unfortunately, after Andi's passing the copyright issue got in the way of become an open source project so it will slowly fade away. A real shame IMHO.
 
Sorry for being gone (I've been busy with my personal life)

We're gonna talk about modelling and exporting
I use blender 4.2 as my main modelling software, and blender 2.79 for exporting and animation.
So the official documents for installing trainz blender IM Exporter for 2.79 is now outdated, here's how you should do it
You can get the files from blender Exporter 0.96 here https://sourceforge.net/projects/blenderextrainz/
And "trainzmeshimporter" https://online.ts2009.com/mediaWiki/index.php5/Downloads "meshimporterTS12.zip"

Step-by-step
1. Unzip both files
2. You can't just "install addon from files" you want to copy everything from the blender Exporter 0.96 files
3. Go into blender 2.79 files "scripts, addons"
4. paste the files from the blender Exporter 0.96 into it
5. Go to file "meshimporterTS12"
6. Copy "trainzmeshimporter"
7. Go back to 2.79 addons files
8. Paste"trainzmeshimporter" in
9. Done


As for modelling again I mainly use blender 4.2 because the controls are easier and works way smoother
I use trainz simulator 2009 SP4 (3.3)
So need to export it as "index mesh" (IM)
So I export to 2.79, How to export it into 2.79 is relatively simple.
In 4.2 I always add "shade auto smooth"
Then you want to export the mesh as a Wavefront .obj format (default settings)
Then in 2.79 import .obj (again default settings)
After you import it in you can add materials/textures
And this is important! Before exporting add "edge split" modifier otherwise after exporting the smoothing would look f*cked
If after exporting the mesh have invisible faces go back to blender add "solidify" modifier then "edge split" again then export it again
*Edit if you have invisible faces after export go back into blender and flip the faces normals (shortcut shift+n or for more options alt+n) I've learned quite a bit since this was posted so yeah
 
Back
Top