Trainz Exporter for Blender 2.5

uschi0815

New member
Like Blender 2.5 also TrainzExporter for Blender 2.5 has reached alpha status. Don't expect too much, but it should just be possible to convert your Blender models into Trainz content. As every CC has it's own style of creating models I want to publish this first version to ensure that I don't mess up things someone rely on. So if you want you can download an actual Blender2.5 and the Trainz Exporter script and check if it works for your models. Please use only copies of your Blender files, as I can not guarantee that the script not mess up your creation and the new Blender version might leave the *.blend file unreadable for older Blender versions.

Simply extract the development build of Blender, copy export_trainz.py and TrainzMeshImporter.exe into subfolder .blender\scripts\io. At least after a Blender restart you should find the script under File->Export->Trainz Mesh and Animation....

There are two major changes in this version:

a) Beside the file selection dialog you'll find an options panel which let you specify the script behaviour. To store your settings check "save current configuration" and continue exporting.



b) It's now possible to use Armatures and it's Bones as exportable b.r.*-objects. Of course you can stay in using Lattices, but using Armatures/Bones gives you the possibility to influence single vertices by more than one Bone. This allows you to animate the shape of a mesh. You can take a look at my testobject to get an idea of a basic setup using Armatures. Don't judge to hard about it's appearance; I really build it only to check the script :wave:

Comments and suggestions are welcome.

Best regards,
Torsten
 
Just curious, and I apologize for my inexperience, but does this mean there presently is not any well-established, guaranteed-to-work way to make content in Blender for Trainz? I ask because I have been fiddling with Blender for a bit. I like it a lot, and I was under the impression that one could produce content for Trainz. I would much rather learn and develop for Blender rather than an out-of-support GMax. However, if Blender is not "ready for primetime" as a content-development tool for Trainz, then perhaps I'm better off putting on the brakes and learning GMax, maybe going back to Blender in the future.

Alternatively, is there a way to create in Blender, export to GMax, which then can be exported to Trainz?

But if you think your exporter will work and if it is going to be improved, I'm willing to stay with Blender. I just don't know what to do at this point.
 
RRSignal

Blender 2.49b and Torsten's existing exporter provides a solid and proven way to get Blender models into Trainz, and there are some good tutorials on how to get it all working. However, Blender is always evolving and many scripts are version-specific, and not guaranteed to work in later versions. Blender 2.5 is a big upgrade(?) but it is in fairly early stages of development and I don't think it will bring many 'must-have' features as far as Trainz content creating is concerned. I would recommend sticking at it with 2.49b for now- you'll find it far more powerful than Gmax once you get the hang of it, and a lot easier to model quickly.

Also many thanks to Torsten for the continuing development work here- it's great to know that this project is still moving forward. Blender is such a good creation tool and unlike some other sims we're really lucky to be able to use it so easily to get content into Trainz.

Cheers

R3
 
Just curious, and I apologize for my inexperience, but does this mean there presently is not any well-established, guaranteed-to-work way to make content in Blender for Trainz? I ask because I have been fiddling with Blender for a bit. I like it a lot, and I was under the impression that one could produce content for Trainz. I would much rather learn and develop for Blender rather than an out-of-support GMax. However, if Blender is not "ready for primetime" as a content-development tool for Trainz, then perhaps I'm better off putting on the brakes and learning GMax, maybe going back to Blender in the future.

Alternatively, is there a way to create in Blender, export to GMax, which then can be exported to Trainz?

But if you think your exporter will work and if it is going to be improved, I'm willing to stay with Blender. I just don't know what to do at this point.

The basic documentation for the 2.49b stuff is here:

http://en.wikibooks.org/wiki/Trainz/Tutorial_for_Blender#Newcomers_start_here

A number of us are using Blender to create and its quite stable. Paul Hobbs has some Blender tutorials for example. There aren't as many tutorials as there are for GMAX but its coming along quite nicely.

Cheerio John
 
Cool, now I'm gonna sleep better tonight! :) Again, I do see Blender as having a bright future, which is why I've stayed away from GMax. Thanks, guys. And thanks for your work, Torsten!
 
Normally I have to click on material then on the texture name before exporting. Probably because I have my materials set up incorrectly. I can't see how to do this in 2.5

I like the invalid faces warning rather than a mesh which asks me if I want to ignore them.

Cheerio John

08:54:51 WARNING: invisible face(s) in Mesh:Cube.014 used by Object:buckeye1 detected
08:54:51 INFO: vertices of invalid face(s) gathered in vertexgroup "ERROR_faceless_faces"
08:54:51 ERROR: generic or faulty texture assigned to material "Material", texture(s) "Tex.001"
08:54:51 ERROR: generic or faulty texture assigned to material "Material.001", texture(s) "Tex"
08:54:51 ERROR: generic or faulty texture assigned to material "Material.002", texture(s) "Tex.001"
 
The "mysterious" click in older versions was needed because I've used a Blender method to check if the image used to texture is not empty. Those method always return "is empty" until you force Blender to show it at least once during your Blender session. In the new Blender version those method has still the same problem(behaviour?!), so I decide now to check for myself. Or shorter:

You don't longer need to click on textures before exporting. :)

The downside of this is that I now check if the file referenced by the image exists:


If this is the case I would please you to send me a blend file to reproduce and hunt the error. Maybe I should drop those check completely?

Best regards,
Torsten
 
The folder I'm using is 236 mb so difficult to flip to you. I've now lost my blender 2.5, very embarrassing.

I'll have a dig and see what I can come up with using a simpler model.

Thanks John
 
I cannot get the exporter to show up in Blender 2.5
I have placed the files where you said to put them.

I tried to export the cube as it is displayed. When I clicked on export there was no Trainz exporter listed. I downloaded the export file export_trainz.py and put it in the blender/scripts/io folder. Also put the TrainzMeshImporter.exe importer file in the same folder.

Am I missing something here?

Thanks for any help here.


Dave
 
When I copied the folder it lost the texture files when I pointed them again it at least did an export.

I've managed to do it for one material but I have two others to find and repoint. 2.5 is a little different to the earlier versions.

Cheerio John
 
@timberdv

Which version of Blender 2.5 do you use? I've tested the script with version 29268(the one I've linked in the first post). You'll find in the version in the right upper corner of the splash screen. Do you have any error messages in the Blender console window after starting?


@john

If this check "s*cks" I can remove it. The worst case that could happen is a complaining CMP ore a strange looking asset.
 
@john

If this check "s*cks" I can remove it. The worst case that could happen is a complaining CMP ore a strange looking asset.

No its fine. I used it on a complex blend that I hadn't used for sometime. The folder used to be on I: but on the new machine it's f: drive. Once I'd picked up the two materials I use it works fine. One was a window the other was the main texture. I'm starting to roll on it now after putting it in abeyance for nearly six months whilst I sorted out how to do a brass handle but I have two promising leads now.

The bones looks interesting.

Thanks

Cheerio John
 
Torsten

Thanks for your help.

I am having trouble getting the textures into blender.

Could you possibly go through the procedure for 2.5 as it relates to 2.49.

I can get color on the object but it does not create a xml file or im file when I try to export.

I have the exporter file and the Trainzimporter file in the io folder.

Thanks again for any help here.

Dave
 
It's basicly the same procedure as in Blender 2.49, only the related buttons have moved. Create/select a material, create/select a texture for that material and assign an image file. Don't forget to unwrap your mesh.

If you're not familiar with content creation using Blender I really suggest to stay with Blender 2.49 for now. The new script & the new Blender are too much work in progress to make the first steps reliable.

Best regards,
Torsten
 
Torsten:

Thanks for your help.

I have discovered a couple of things about 2.5.

In order to get it to export you must tell it where to put the xml file. It will not create the XML folder buy itself. My error log showed it was trying to create a \trunk\.xml folder. I don't think Blender 2.5 likes the period.

Also make sure you use Folder names without any punctuation or spaces in their names. Blender doesn't like that either.

It seems to be working OK now. I have created over 100 items with blender 2.49 so I am not exactly new at this.

I like the new interface. It will be a lot of fun getting it all to work.

Thanks again for your help

Dave
 
Hi Dave,

thanks for your effort, I've eliminated a small bug which allow a wrong texture type to break the script. But I was not able to recreate problems using spaces and periods in file- or foldernames. Only if I tried to export an unsaved file the script failed. This is because the Blender default file name is currently <memory2> and I use the default name to name the export file(the script simply swap the extensions). As it is impossible to create files using < or > in it's name the script will fail later on. Please think about that the export file name is only a suggestion, you can change it to whatever please you. :)

Best regards,
Torsten

PS: OK, with over 100 assets you have clearly outnumbered me :wave:
 
Problem with bevels and smoothing

Torsten:

When I try to bevel cubes or smooth them , it shows alright when its rendered (F12) but when I export to trainz , it just shows square blocks. No curves. material attach OK. Am i missing something here. Could this be an exporter problem?

I love the interface. I don't want to go back to 2.49.


Thanks for any help here.

Dave
 
John

After you click on export to Trainz look on left side for Recent. It should show Blender folder. Click on that and then you will be saving it to the Blender folder. Your im file will be there as well as the texture. text files that were created. If you have your textures in their own folder they will not show in the blender folder. Pev's mesh viewer will not work unless all the needed files are in the same folder.

The folder C:Blender25\trunk\xmler does not exist.

You must designate one.

blender instead of xmler

If you click the blender in the recent , it will change to the correct location

C:\Blender25\trunk\blender


Then your export should work

Dave
 
Back
Top