Page 1 of 16 12311 ... LastLast
Results 1 to 15 of 227

Thread: RubyTMIX: A TrainzXML Exporter for Google SketchUp

  1. #1

    Default RubyTMIX: A TrainzXML Exporter for Google SketchUp

    RubyTMIX is a plug-in for Google™ SketchUp® that provides direct export of SketchUp models to Trainz, with all geometry, materials and textures intact and the polygon count minimized. Using a combination of its own built-in functionality as well as fully-automated interaction with various freely-available external utility programs, the plug-in produces all files required to import a SketchUp model directly into Trainz Content Manager, where it is immediately available for use in Surveyor. The plug-in is compatible with Google SketchUp 7 and 8; with Windows XP and Windows 7; and with TS2009, TS2010 and TS12. An overview of the process with screen shots is provided in the next post.

    * Ruby plugin, runs inside Google SketchUp 7 or 8
    * Integrates into the SketchUp menu bar
    * User interface is provided via Ruby-SketchUp 'WebDialogs'
    * Requires Trainz Mesh Importer (included) and IrfanView (obtained separately)
    * Supports preview of produced IM file in PEV's Trainz Mesh Viewer (obtained separately) prior to import into CM

    Main Features
    * Automated production of all files required for use with TS2009, TS2010 and TS12
    * Immediate error- and warning-free import of all files into Content Manger from a single folder
    * Imported assets are ready for immediate use in Surveyor
    * No other content-creation tools required (e.g. Blender or G-Max)
    * Documented with PDF manuals
    * IT'S FREE

    How It Works
    * Requires each SketchUp model (SKP file) to be in its own folder
    * Automatically creates all required files and folders based on file name information from SketchUp
    * Exports geometry directly to TrainzXML format
    * Automatic geometry selection logic minimizes poly count by exporting only the faces required
    * Manual selection of front/back/both/textured-only geometry is also provided
    * Export full model or selection only
    * Correctly handles mirrored components and projected textures
    * Exports SketchUp colors as non-textured materials, fully defined in the TrainzXML file
    * Exports SketchUp textures as image files with auto-resizing to closest-power-of-2 dimensions and 1:8 max ratio as needed
    * Auto-converts JPG & TIF material and photo-texture files to TGA format
    * Auto-converts PNG textures with transparency to TGA format and maintains alpha information
    * Automatic creation of 'config.txt' file -- you specify the defaults for all required items
    * Creates a thumbnail from the SketchUp model and auto-resizes it to 240x180
    * Automatically runs Trainz Mesh Importer at conclusion of process (also creates CMD file for manual re-run)
    * All post-processing options can be turned on or off, so you can tweak the results yourself
    * Retains geometry-selection and post-processing options separately for every model
    * Creates a log file for each export run that documents the conversion process to aid in troubleshooting

    A huge thank-you goes out to Peter V (PEV) for graciously providing some valuable tips about materials and geometry in TrainzXML files, and for allowing me to reference his Trainz Mesh Viewer as the preview part of my tool. Thanks also to philskene for allowing me to use his routes as backdrops for my screen shots.
    Last edited by ModelerMJ; November 10th, 2011 at 08:47 PM.
    T:ANE SP3 (94916), TS12 SP1 HF4 (61388) / Win7HP SP1 64 bit / i5-2400 3.1GHz, 16GB, NVidia GeForce GTX 1050Ti

  2. #2

    Default Process Overview

    The following screen shots illustrate the RubyTMIX process.

    1. The Salty Dawg Saloon (by JCHarrist) - Downloaded from the Google 3D Warehouse, opened in Google SketchUp

    2. Starting the Export Process - Specify model KUID and lighting, select geometry to export, and set post-processing options

    3. Export In Progress - Status messages, progress bar and percent-complete display

    4. Export Complete - Summary of what was done, with options to preview the results before import into CM

    5. Previewing the IM File in PEV's Trainz Mesh Viewer

    6. Viewing/Editing the auto-generated config.txt file in Notepad

    7. Importing the Model into TS12 Content Manager

    (Auto-generated Thumbnail)

    8. Using the Model in TS12 Surveyor - Port Ogden & Northern as a backdrop, courtesy of philskene

    Last edited by ModelerMJ; November 1st, 2011 at 06:00 PM.
    T:ANE SP3 (94916), TS12 SP1 HF4 (61388) / Win7HP SP1 64 bit / i5-2400 3.1GHz, 16GB, NVidia GeForce GTX 1050Ti

  3. #3

    Default Legal Stuff

    RubyTMIX is being released FREE to the Trainz community and may be used for any purpose, personal or commercial, within the following terms:


    If you don’t agree to these terms... don’t use the software.

    Of somewhat greater importance is the way in which the Google SketchUp Terms Of Use apply to this tool. I have exchanged several e-mails with the correct person at Google regarding this, and the following list summarizes what we discussed.

    1. The free edition of Google SketchUp may not be used for commercial purposes. This means that you cannot sell the models you create with the free edition – it does not mean you cannot use it to create models for the Trainz environment. What this boils down to is that the only acceptable way of distributing Trainz models created with the free edition of Google SketchUp is to post them on the Trainz DLS so that they are freely available to everyone (the need for a First-Class-Ticket not withstanding).

    2. Payware items created for Trainz, e.g. routes, may reference models created with the free edition of Google SketchUp that have been posted on the DLS, but may not directly include any such models in the distributed payware package. This is (I believe) in line with the existing policies of N3V/Auran regarding the use of freeware within payware.

    3. Materials, textures, components and Google Street View or Google Earth images that are accessible from within Google SketchUp or other Google products may be used in the creation of Trainz models. However, all such materials must remain part of the model and may not be separated from it for use in any other content creation tool. This means that, even though individual images that represent textures and photos may be accessible at various points in the export/import process, those images must remain part of the single object asset that is held in Trainz and cannot be re-used in any other non-SketchUp-produced asset.

    4. Section 8.2 of the Google 3D Warehouse Terms of Service (which can be found at http://sketchup.google.com/intl/en/3dwh/tos.html) includes the statement “For the avoidance of doubt, you may modify, distribute, and create derivative works of Content uploaded by other users in 3D Warehouse.” I have interpreted this to mean that models can be downloaded from the Google 3D Warehouse, converted via RubyTMIX, and placed on the Trainz DLS in either altered or original unchanged form as desired. Proper etiquette dictates, of course, that the permission of the original author should be sought and that they (and the Google 3D Warehouse) should be named as the original sources.

    In summary, I was told that nothing I intended to do required a special agreement with Google; therefore I feel safe in saying that we are allowed to use the free edition of Google SketchUp to produce content for Trainz as outlined above.

    If you disagree with my assessment... don’t use the software.
    Last edited by ModelerMJ; October 22nd, 2011 at 06:13 PM.
    T:ANE SP3 (94916), TS12 SP1 HF4 (61388) / Win7HP SP1 64 bit / i5-2400 3.1GHz, 16GB, NVidia GeForce GTX 1050Ti

  4. #4

    Default Current Status

    Version 0.1.0 - BETA - Not yet ready for public release.
    Supports the processing of static scenery objects only (at the current time).
    There are no plans to make this tool compatible with any version of Trainz prior to TS2009.

    I am announcing the tool at this time in hopes of finding 3 or 4 serious content creators who are willing to put the tool through its paces, and provide feedback about its operation as well as how to broaden its scope such that it can be used for more than just static scenery objects. Personally the next feature I plan to add is support for object splines (roads and highways), as I have some unique needs in that area for my own route.

    Documentation is preliminary but complete to the current level of functionality; I expect to revise it during the Beta process. Google has requested a review cycle of the manuals to allow for approval of trademark usage and that is about to get underway; but I can issue the documents to Beta testers in the mean time without waiting for this to take place.

    Comments, thoughts and constructive criticism are welcome. Legal rhetoric and SketchUp-bashing are not... I fully realize that being able to convert a SketchUp model so that it 'works' in Trainz is only part of the battle - it doesn't mean the model is efficient and/or that it adheres to all the myriad content creation rules. On the other hand, what I don't know about content creation would fill a book just about the size of the CCG, so maybe with guidance from some of the more experienced folks here the tool can be improved to address the necessary issues.

    So, if you're a serious content creator who wants to be part of the beta test process and/or wants to help shape the future direction of this tool and make it truly useful, then please PM me and we'll go from there.



    STATUS UPDATE (01-Nov-11):
    - Corrected some bugs related to transparency and completed initial clean-up.
    - Updated TS12 screen shots in previous post to reflect fixes.
    - Software is now being issued to 2 Beta Testers.

    - An experiment was conducted related to creating a Texture Atlas as an attempt to reduce the number of textures associated with a SketchUp model. I was able to create the Atlas (see post later in this thread) but ultimately my initial attempt was defeated due to the inaccessibility of some necessary information from within my Ruby script; I also found that attempting to add this functionality to the exporter made the code very convoluted as I tried to deal with special cases and potentially conflicting options. Therefore I have set this effort aside for now in order to concentrate on getting the exporter itself completed and issued. I will revisit this later with an eye toward letting the exporter do its job and then treating texture reduction as a separate effort/tool that can be applied to optimize a model before the exporter is used.


    STATUS UPDATE (06-Nov-11):
    - Version 0.2.0, issued to 1 Beta Tester.
    - Reworked the exporter output section to eliminate a problem with running out of resources on very large models. Exporter can now handle models of any size.
    - Reworked code also reduces export time by about 35% vs the previous version.
    - An issue was reported with invalid file name characters in a non-"en-US" operating system. A temporary work-around was completed to allow testing to continue, but the resolution is far from an optimum solution and additional work is required to resolve this issue in a more robust fashion.


    STATUS UPDATE (07-Nov-11):

    - Version 0.2.1, issued to 2 Beta Testers.

    - The issue with invalid characters in file names is now fully resolved, in the proper fashion. The exporter now creates controlled file names (e.g. RTM_0001.jpg, RTM_0002.png, etc.) for all textures, and so Unicode characters in the actual SketchUp texture file names now have no effect on the export process or on the import into Trainz. Because of this, the exporter now also creates a folder with all the original texture files, with their original names (including Unicode characters if present), along with a cross-reference TXT file that indicates which controlled file names are associated with which actual textures; this also allows the original images to be manipulated manually by the user if desired. Many other clean-ups are also included in this iteration.

    - This version will be issued to additional Beta Testers as soon as updates to the User's Guide are completed, as this version has substantial differences from 0.1.0. To all those who have PM'd me asking to test the tool -- Thank you, and rest assured I am not ignoring you. I'm just trying to get the whole package back to the level it needs to be at so I can send it out in the right way.


    STATUS UPDATE (08-Nov-11):

    - Version 0.2.2, issued to 1 Beta Tester.

    - Added support for TIF/TIFF images. D'oh! My bad, I somehow overlooked the fact that SketchUp allowed this format. Also, TIF images can carry transparency, but the SketchUp API function that reports whether or not a texture has transparency is broken for TIF images and so I cannot auto-detect this. I will note this in my updated manual.


    STATUS UPDATE (13-Nov-11):

    - Version 0.2.2 issued to all other Beta testers.
    - Documentation sent to Google for trademark & copyright clearance (at their request); this should be forthcoming this week as I do not expect any major issues here.
    - The web site that will host the software is up and running and essentially ready to go. I'll be giving out the URL here and in the Freeware Announcements forum when it's time.
    - Beta testing continues; I want to make sure all of my testers have time to respond. So far V0.2.2 seems to be the best version for a release candidate.

    Thanks to everyone who has posted here for their continued interest and kind words, and of course to the Beta Testers for their time and comments.

    Last edited by ModelerMJ; November 13th, 2011 at 06:34 PM.
    T:ANE SP3 (94916), TS12 SP1 HF4 (61388) / Win7HP SP1 64 bit / i5-2400 3.1GHz, 16GB, NVidia GeForce GTX 1050Ti

  5. #5
    Join Date
    Dec 2007

  6. #6
    Join Date
    Nov 2006
    Burnside, Adelaide, Australia



    While I have never used Sketchup, I know it appears to be popular and I heartily congratulate you for making it a viable creation medium for Trainz.

    I5-6 Core CPU. 1070-Ti video card, 16GB memory

  7. #7
    Join Date
    Jun 2009
    Duna? Or was it Alaska?
    Blog Entries


    Quote Originally Posted by Kon1786 View Post
    sweet stuff
    BobCass can probably import his steamers but as static(Display) locos only.
    It's good to be back here...

  8. #8
    Join Date
    Feb 2008
    United States of America, Louisiana, Metairie In Jefferson Parish
    Blog Entries


    About Rolling Stock Creation.

    We need a way to add attachment points to a model. I want to try out this tool and see how good ploy-wise it is.

  9. #9
    Join Date
    Oct 2007
    South of Denver, Colorado
    Blog Entries


    This will open up the door for many new content creations. Can't wait for it.

    Also a TCR resident.
    Finally hit 1,000

  10. #10
    Join Date
    Sep 2009
    United States of America, Va, Woodbridge
    Blog Entries


    Wow, I guess this goes a long way to answering this question I posed...


    It looks like you have made huge strides to making this a viable alternative....

  11. #11
    Join Date
    Nov 2006
    United States of America


    This will open up so many opportunities to get prototypical buildings for routes! Thanks for your great work!

  12. #12
    Join Date
    Sep 2009
    United States of America, Va, Woodbridge
    Blog Entries


    Just knowing the amount of items in the Google Sketchup warehouse that could be brought into Trainz is mind numbing.....

  13. #13

    Default Wow!~!

    Chris --

    I agree.

    I've just visited Google Sketchup warehouse. There are masses of useful models there. Of particular use for me would be proper 3D people.


  14. #14
    Join Date
    Jan 2010
    United States of America, California, Los Angeles


    Well I found a P40 that looks pretty good
    This is for sketchup 8: http://www.mediafire.com/?pp31yc03w023821

    this is for sketchup7: http://www.mediafire.com/?pc8uccscnc6t1a6


  15. #15

    Default Denver Union Station?

    However... just because it can be used, doesn't mean it should . I know it's easy to get glassy-eyed when you look at all the cool stuff on the 3D warehouse, but during my testing - prowling around looking for really nasty models to throw at my exporter - I have found that a lot of them have monstrous numbers of polygons. On the other hand there are some models that you would swear have a gazillion that have only about 1000 or so.

    By the way, this model has 1891 polygons.


    P.S. I just went and grabbed the P42 - it weighs in at 11,016 polygons. A bit on the heavy side? But this is exactly what I'm talking about when I say I would like some knowledgeable collaborators to help me refine the tool. Then again a lot of the responsibility needs to be on the modeler to create a low-poly model in the first place.

    Last edited by ModelerMJ; October 23rd, 2011 at 05:00 PM.
    T:ANE SP3 (94916), TS12 SP1 HF4 (61388) / Win7HP SP1 64 bit / i5-2400 3.1GHz, 16GB, NVidia GeForce GTX 1050Ti

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts