News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

How to get scale measurements in Blender 2.79

Started by Matthew, August 31, 2019, 06:44:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

When creating models in Blender for pak128.Britain(-Ex), we need to work within a certain space so that the rendering script captures the model in the right place and at the correct scale. All the building blends that I have seen in the pakset's repository are therefore built upon a certain base.

Unfortunately, this base has idiosyncratic proportions and positioning:

It is approximately 8.31 x 8.31 Blender units and the X and Y axes are not exactly centred on Blender's (0,0) global origin values (so the red and green lines do not completely bisect the square). Notice also how none of the grid lines match up with the Edges of the base square. This clearly did not prevent the founding fathers of the pakset (Archon, James TheHood, James Petts, and Kieron) from producing many beautiful buildings. but it means producing buildings on an accurate scale involves considerable mathematical contortions. And I am not criticizing them at all: they had to work with Blender's appalling UI, which hides this information, so if anyone should be blamed it's the Blender devs.

Happily, Blender has moved on since the pakset was founded, and even though we are stuck with 2.79, we can now get Blender to provide helpful scale information.

A. Set the correct scale for the pakset
0. You should have opened the model you want to edit in Blender 2.79 and have the Properties window visible.

1. Change the Properties window to the 'Scene' tab.
2. Change the Units to 'Meters'.
3. Change the Unit Scale to 3.610107868819751. Blender will only display the scale to six decimal places, but you must use all fifteen decimal places to get an accurate scale, so cutting-and-pasting from this page is highly recommended.
NB: This assumes that you are using the 30m/tile scale specified for buildings in pak128.Britain(-Ex). For other paksets or Simutrans objects, you will need to calculate the correct scale.

The base square will now measure 30m x 30m and the grid lines will appear at 1m intervals. It will still not have (X=0,Y=0) at its centre, but this should not be a problem so long as we can see the lengths of our edges. We can do that by using the MeasureIt add-on.

B. Enabling the MeasureIt add-on
0. Open Blender 2.79 and go to File > User Preferences.... (<Ctrl>+<Alt>+U). You will see this screen:

1. Select the 3DView add-ons.
2. Tick the box to enable MeasureIt.
3. Click 'Save User Settings'
You may experience some visual glitches; I was able to fix these by reloading the model (File > Revert, hover the mouse, then click <OK> in the pop-up).

C. Make the properties panel visible
0. With your model still open, move the mouse pointer into the 3DView window, select an object and switch to Edit Mode (typically by pressing <TAB>). If you are not sure if you are in Edit Mode, please see the illustration for step D1.

1. Press <n> to open the properties panel, which by default appears on the right-hand side of your 3DView window.
NB: The properties panel is different from the Properties window discussed above (another Blender UI disaster  ::'( ).
2. Select 'Global' values if you have not already done so. You should note that they are now displayed in metres.
3. Scroll down the properties panel until you can see 'Edge Info' and 'Face Info'.

D. View edge lengths

1. You should still be in EDIT mode with an object selected. Select an Edge.
2. In the properties panel, tick the 'Length' box under 'Edge Info'
3. You should now see the length of the Edge, at the pakset's scale, displayed next to the Edge.
It always seems to be displayed in black small print, so you may need to zoom and/or pan in order to bring it into view.

The other options under 'Edge Info' and 'Face Info' do what you expect, though you may need to play around with them to figure out the UI:
- If you select a Face in Face mode, then you can see the area of the Face.
- If you select all the Edges of a Face, you can also see the area of the Face.
- If you select two Edges that join, you can in theory see the angles between them, though I have not yet figured out how to choose between X, Y, and Z angles.

I hope that helps someone.  :)
Credit goes to all the Blender Stack Exchange posters who taught me how to do this half-an-hour ago. :D
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

That is very helpful. I have set this to be a sticky for everyone's future reference.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.