Index  •  FAQ  •  Search   •   Register | Login  

It is currently Sat Sep 20, 2014 5:55 am




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
 Converting Sketchup models to Trainz 
Author Message
 Post subject: Converting Sketchup models to Trainz
PostPosted: Sat Jun 15, 2013 2:58 pm 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
This Topic is now obsolete. A full tutorial showing this method of converting Sketchup models in far more detail is now available on my website http://www.lutrainz.uphero.com




Hi guys

I see there are now a few of us involved in coverting Sketchup models from the Trimble 3D warehouse into Trainz. This may be of interest to those involved, or those who would like to get involved.

Until this afternoon I had never seen a method of getting these models into Blender/3DS/Gmax that didn't involve partial corruption (at least of the texture mapping) using the free version of Sketchup. However I have just found a rather interesting program that can convert from KMZ or DAE files (as exported by Sketchup) to 3DS format without any corruption whatsoever. Have a look at the following screenshot showing the model of the Putney Bridge (District Line) imported into Gmax.

Image

This took under an hour which includes downloading the program, learning how to use it and correcting a few problems. And yes this will be appearing on TPR some time soon (only 8420 polys before I start work trimming it).

The program Is called ModelConverterX and is available from http://www.scenerydesign.org/modelconverterx/ . It is really for Microsoft Flight simulator, but seems to make a really good job of converting to 3DS. There are options to automatically resize texture files to powers of 2, but I have not figured that bit out yet - it seems to involve calls to another program that I haven't tracked down (part of the Flight Simulator SDK I believe). The only problem I had with it was with texture file naming being truncated so you get file names like "TEXTUR~3.JPG" instead of "texture_16.jpg" after import into Gmax - not too hard to figure out which one is which, and for some reason some of the JPG files on this Sketchup model are named with a ".SAILBOAT" extension - lord knows why.

Dave Bird

_________________
http://lutrainz.uphero.com/


Last edited by bird_d00 on Sat Dec 14, 2013 10:53 am, edited 2 times in total.

Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Sat Jun 15, 2013 4:30 pm 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
OK, a bit of an update on this. For the texture file conversions you will indeed need the Microsoft Flight Simulator Terrain SDK. If you don't have this already, you can download it for free from http://download.microsoft.com/download/ ... _setup.exe . You will then need to install it and then point ModelConverterX to the imagetool.exe program. Use the menu "Options\Texture settings\ImageToolPath" and point it to the correct file (by default it will install to C:\Program Files\FS2004SDK\TERRAIN_SDK\Terrain_Tools\imagetool.exe).

Before you export your file from Sketchup don't forget you will need to explode all the components & groups. Export from Sketchup as a .KMZ file(so you have all the texture files). Run up ModelConverterX, select Import and select your .KMZ file. Select Export and name your output 3DS file, then finally select the "Mass Texture Editor" icon and tell it what format you want (don't use the default DDS) and where to put the texture files, click on "Update" and you are done.

Finally you can run up Gmax, import the 3DS file and then have fun renaming the texture files in the material editor (the names are wrong because the 3DS format only allows DOS format 8.3 character file names) and click the blue & white chequer world thingy to display each texture. Save your Gmax file and you are done. If you only have a few textures you should be able to do all of this in under 5 minutes (I just picked a bad one to test - Arnos Grove station - it has 60 texture files !)

Dave Bird

_________________
http://lutrainz.uphero.com/


Last edited by bird_d00 on Sat Jun 15, 2013 4:53 pm, edited 1 time in total.

Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Sat Jun 15, 2013 4:39 pm 
Past 250!
User avatar

Joined: Mon Sep 26, 2011 6:48 pm
Posts: 478
Location: That wee hilly place above England
Trainz Version: TS12
Trainz Build: 57825
Author KUID: 622162
Wow! Thanks a lot for this. I think I might just give it a go
Alex.

_________________
Please, call me Alex.
Formerly known as afleming97
No thanks, Mr. Salmond


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Sat Jun 15, 2013 9:20 pm 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
And just to prove how quick and easy this method makes it, here is the Fulham Bridge as above in Trainz and it has already been uploaded to TPR. I managed to get it down to 7186 polys without too much effort by deleteing the insides of some of the objects (Sketchup often seems to texture the outside and the inside of objects !). Most of the effort was in adding track attachment points, converting the texture files to TGAs and generating the config file & screenshots - simples.

Image

Dave Bird

_________________
http://lutrainz.uphero.com/


Last edited by bird_d00 on Sat Dec 14, 2013 10:54 am, edited 1 time in total.

Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Sun Jun 16, 2013 11:52 am 
Past 100!

Joined: Sun Dec 12, 2010 3:58 pm
Posts: 226
Location: North Devon
Trainz Version: TS12
Trainz Build: 57898
Author KUID: 475970
Excellent advice there, Dave. The Sketchup warehouse is a godsend for those of us creating real life routes (I've already got a few assets on the DLS) but like you say that poly count is always something to keep a very close eye on. One I have been looking at recently is Exeter's St James' Park stadium - there's a couple of pretty good models on there, but they currently come in at over 100,000 polys - work is definitely needed!!


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Sun Jun 16, 2013 12:27 pm 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
Sadly it isn't just the polycount that can be a crippler for Trainz. The other one to keep an eye out for is the number of textures, which is absolutely ridiculous for some of the models. The model of Fulham bridge shown above had 18 textures (which is low for a Sketchup model), but many of them were identical. Not a problem for Sketchup, but loading all those seperate textures can be a big problem in Trainz. Even some of the simpler models can have something like 60 textures.

There is also a lot of dross in the warehouse - I have downloaded most of the London Underground related stuff, and sad to say most of it isn't even worth the effort of converting. There is some nice stuff , but that generally is the ones with high poly and texture counts, and they need a good deal of effort. The Croydon Tramlink model looks very nice, and I was tempted, thinking it would be simple , but it's 70,000 polys and thats without an interior - ouch.

Dave Bird

_________________
http://lutrainz.uphero.com/


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Jun 17, 2013 8:20 am 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
A quick postscript, for those who download models that have lots of texture names that get truncated by the conversion. It isn't always obvious which filename is which (would you guess that "TE4883~1.PNG" refers to "texture_56.PNG"). The following method should allow you to decipher the names :

Firstly in ModelConverterX when you convert your textures, use the exact same name as the source. So if the source texture was Texture_5.JPG make sure that you have the JPG file type selected. Now convert your texture files as normal.

You should now open a DOS window (I believe it's called "command prompt" now), on Windows XP it's found at START\All Programs\Accessories\Command Prompt - the Icon is a black square with "C:\" in it. You should then navigate to where you stored your texture files using the "cd" command, for example "cd MyDocuments\Sketchup\Arnos Grove". Now type the command "dir /x" and it will list all the real filenames with their shortened equivalents. Type "Exit" when you're finished to close the window.

Hope that is of some help. These stupid names caused me a good deal of grief yesterday until I remembered this trick.

Dave Bird

_________________
http://lutrainz.uphero.com/


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Sun Jun 23, 2013 8:52 am 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
And some more further comments.

It seems there is a bug in the file renaming by ModelConverterX. For simple models with few textures it works fine, but if there are many textures it can get confused. After you have gotten your model into Gmax, if you followed the above advice and then open Material Navigator you will see it picks up most of the textures, but be very suspicous of any starting "TEXTUR~" it tends to assign these the wrong textures, and normally an equal number of textures will have a totally bogus filename, and so appear blank.

PLAIN COLOURS without a texture at all. Plenty of these in most models. I have found that Gmax will export these to Trainz if you add a "Unwrap UVW" to the mesh in question, and it seems that the correct "m.notex" material is used. They display fine in PEVs mesh viewer, but TRS2004 and TRS2006 render these as plain white. Can someone with a later version of Trainz please try this and let me know whether they display correctly in their version. Please see the screenshots below :

As rendered in Mesh Viewer :
Image

As displayed in Trainz - note tyres
Image

Dave Bird

_________________
http://lutrainz.uphero.com/


Last edited by bird_d00 on Sat Dec 14, 2013 10:55 am, edited 1 time in total.

Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Oct 07, 2013 7:29 am 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
Can people (presumably admins) please stop moving and retitling posts. As the search function (apparently) does not work at all this just means that not even the original author knows where his own posts are.

Dave Bird

_________________
http://lutrainz.uphero.com/


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Oct 07, 2013 8:32 am 
Past 100!
User avatar

Joined: Sun Dec 12, 2010 5:14 pm
Posts: 126
Location: Cambridge - The oscillations have been dampened
Trainz Version: 2004,2010,2012
Trainz Build: 0
Author KUID: 181246
Can this get stickied? It's pretty useful info.


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Oct 07, 2013 9:01 am 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
I was actually contemplating deleting the whole damned topic in anoyance at it having gone missing. An expanded and tidied version of this is being written up for my website as we speak.

And no-one has yet come back with an answer on whether the plain materials show in later versions of Trainz using the method shown.

Dave Bird

_________________
http://lutrainz.uphero.com/


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Oct 07, 2013 9:31 am 
SOTM Moderator
User avatar

Joined: Sun Jan 23, 2011 5:10 pm
Posts: 1188
Location: Droitwich Spa
Trainz Version: 06,09,12
Trainz Build: 61388
Author KUID: 485742
bird_d00 wrote:
Can people (presumably admins) please stop moving and retitling posts. As the search function (apparently) does not work at all this just means that not even the original author knows where his own posts are.

Dave Bird

Sorry, that was me. :oops: I moved it here (though never renamed it) as its more likely to be seen by people — let us know when your new thread is ready and I'll sticky it if you wish.

_________________
Screenshot of the Month co-ordinator.


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Oct 07, 2013 10:07 am 
The Enforcer
User avatar

Joined: Tue Jan 04, 2011 12:16 pm
Posts: 607
Location: NE Surrey/NW Kent border
Trainz Version: 1.3, UTC, 06, 10, 12
Trainz Build: 61388
Author KUID: 431172
Ive stickied this as it is relevant help to the forum.

_________________
British Rail class 73129 'City of Winchester'
Bring back slam-doors to the Southern Region!
Probably the only half-welsh person with a father from Pembrokeshire on this forum.

|Steam|tt-forums|UKTrainSim|
tommietomato2 on Auran forums
Currently recovering from an Italian stomach bug. Apologies for any inconvenience!


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Oct 07, 2013 5:08 pm 
Past 500!

Joined: Sun Dec 12, 2010 3:16 pm
Posts: 618
Location: Gnosall, Staffordshire
Trainz Version: TC3 TS2009, 10, TS12
Trainz Build: 61388
Author KUID: 425700
bird_d00 wrote:
I was actually contemplating deleting the whole damned topic in anoyance at it having gone missing. An expanded and tidied version of this is being written up for my website as we speak.

And no-one has yet come back with an answer on whether the plain materials show in later versions of Trainz using the method shown.

Dave Bird

Looks like you need to adjust the specular and ambient and diffuse for the materials that are showing whiteish, Pev's mesh viewer does not use the specular values. Not sure which exporter you are using for Gmax however if it is the one for max 4 / 5 try Ambient and diffuse White and specular black. If its still showing white back of slightly on the ambient and diffuse, you need to test in game as mesh viewer and CCP won't show the specular changes. If however you are using the standard TACs exporter, that doesn't handle specular settings, in which case try darkening the textures of the affected bits, again check in game not with a viewer.

_________________
Image


Offline
 Profile  
 
 Post subject: Re: Converting Sketchup models to Trainz
PostPosted: Mon Oct 07, 2013 5:39 pm 
Past 100!
User avatar

Joined: Mon Apr 11, 2011 8:49 am
Posts: 228
Location: Luton, UK
Trainz Version: UTC,TRS2004, TRS2006
Trainz Build: 0
Author KUID: 338848
Quote:
Looks like you need to adjust the specular and ambient and diffuse for the materials that are showing whiteish, Pev's mesh viewer does not use the specular values. Not sure which exporter you are using for Gmax however if it is the one for max 4 / 5 try Ambient and diffuse White and specular black. If its still showing white back of slightly on the ambient and diffuse, you need to test in game as mesh viewer and CCP won't show the specular changes. If however you are using the standard TACs exporter, that doesn't handle specular settings, in which case try darkening the textures of the affected bits, again check in game not with a viewer.


Please read the post properly. TRS2004 & 2006 CANNOT handle m.notex. The ambient, diffuse and specular settings are all black 0,0,0 and still these show as white in Trainz. PEV's text viewer may not handle specular settings but there are plenty of others that do and I did check with these before posting as I am well aware of the deficiences in that program - it's just Ithat happened to use that one for a screenshot as an example. The question was whether the later versions of Trainz have been altered to fix this problem.

Dave Bird

_________________
http://lutrainz.uphero.com/


Offline
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next


 Who is online 

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

 
Index  |  FAQ  |  Search

phpBB skin developed by: John Olson
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group