How to get a printed track plan into Trainz as a Basemap
Very briefly, the process is as follows. Programs required are
IrfanView,
SketchUp and the
RubyTMIX plug-in for SketchUp - all freely available at the links provided.
1. Obtain an image of the track plan (i.e. scan it from a magazine). Try to get it as a bitmap as that will give you the best clarity; JPG and other compressed formats are lossy by definition.
2. Know the real size of the plan and its width/height relationship; i.e. is the layout 4x8 feet, 12x12 feet, etc. Also know the modeling scale of the plan (N, HO, etc.) Calculate the width-height ratio of the track plan area of the image as width divided by height, and write this number down.
3. Load the plan image into IrfanView and see if it is straight or crooked (skewed). If it is skewed you will need to use the "Custom / Fine Rotation" tool on the Image menu (Ctrl+U) to rotate the image very slightly until it is square. This will take some experimentation. Note that the value you type into the "Fine Rotation" dialog is cumulative, not a total rotation number; so if you need to make multiple adjustments, it is best to reload the image each time, since that will maintain the best image clarity (ie you are not rotating an image that has already had its quality reduced by a prior rotation).
4. When the image is square, use the selection tool in IrfanView to select the area that contains the actual track plan. As you resize and move the selection rectangle, watch the IrfanView title bar; it will show the size of the selection rectangle and the ratio of width vs height. It is critical that this ratio number matches the number you wrote down in step 2. If you need to tweak the selection rectangle to get the right ratio number, add extra space around the outside of the plan.
5. When the selection rectangle is the right size and ratio, use the Crop Selection function on the Edit menu (Ctrl+Y) and then save the result to a new file (Ctrl+S) - be sure to name this file differently (i.e. add "- Cropped" to the end of the name) so you don't overwrite the original scanned image. Again a bitmap is best to retain the highest quality.
6. Open SketchUp. Multiply the width and height of your track plan by the scale factor for the modeling scale; ie multiply by 160 for N, 87.1 for HO, etc. Draw a rectangle that matches the calculated size and which starts at the SketchUp origin. For example, if you have a 4x8 foot layout that you want to re-create in HO scale, your rectangle would be (4 x 87.1) by (8 x 87.1), or 348.4 feet by 696.8 feet. In the N-scale example I showed, the track plan was 12x12 feet so my rectangle in SketchUp was 1920x1920 feet.
7. Go to File->Import and import the track plan image you cropped and saved from IrfanView. Be sure the option 'Use as Texture' is selected in the Open File dialog. Apply the imported texture to the rectangle by clicking first at the lower left corner, then at the upper right corner. If you were careful to make sure the ratio number of your selection in IrfanView was correct, then the image of the plan should snap right into place at the opposite corners of the rectangle.
8. Use the drawing tools in SketchUp to remove any unwanted parts of the image. For example if you had an L-shaped plan, you would want to use the line tool to create new faces for the areas that fall outside the plan image, and then delete those faces. You can also use the arc tool for rounded corners.
9. EXTREMELY IMPORTANT: Once you have the track plan trimmed as desired, right-click the plan and choose 'Make Unique Texture' from the context menu.
10. Save the model in its own folder as you normally would for any RubyTMIX model. Export the track plan using RubyTMIX just as you would any other object, and import it into Trainz in the normal fashion. This is your custom-shaped "basemap".
11. Start a new route. In the Terrain tab, right-click the Add Terrain button and, in the dialog that appears, set the terrain to 5m resolution; this will help with terrain shaping later on. Next, go to the Layers tab and add a layer called 'Basemap', and leave that layer active. Now go to the Objects tab, find your basemap, and position it on the terrain in relation to the 10m gridlines so you can cut as close to the edges of the basemap as possible with your dig holes without having to actually chop away pieces of the plan (dig holes only operate on the 10m grid).
You should now have your track plan in Trainz, properly sized and positioned. From here, the process is the same as for any other "layout" as already discussed earlier in this forum.
Please note that this process will probably only work well for track plans that are less than 1 baseboard in size, as Trainz has trouble dealing with very large objects.
I hope this helps folks get started in the short term, as it is going to take a fair bit of time to create a proper tutorial with screen shots, and which also accounts for very large layouts and special cases like layouts that go through walls and so on. I also want to do some more experimentation with a few other ideas related to this and, if things work out as I hope they might, I will include that information in the formal tutorial as well.
Regards,
-Mike