Dev Tutorial Blender Tutorials, Tips and Tricks

Status
Not open for further replies.

Road-hog123

An Orange Bus
Administrator
UKDT
Dec 10, 2015
1,784
Blender Tutorials, Tips and Tricks
acz1X5XIME6kmwXe-iggcgkNT59mjetC.png
Here, sporadically, will Tutorials, Tips and Tricks for using Blender for the creation of Omsi content appear. Hopefully they'll be of some use. View attachment 4602
If you need help with the content contained here or have other Blender woes, please use this help desk topic where those that know the solution can present it to you.
Covered here by me (Road-hog123) will mostly be content based around Blender 2.49b because it's the version I use, whereas others will use versions closer to the current release. In many cases the two versions will have different UI layouts, but the same features will be present underneath.
To obtain Blender:
The latest version of Blender (at time of writing 2.78a) is available here: Download Blender
Blender 2.49b (the version that was used to create all of the default content in Omsi) is available here: Download Blender 2.49b
Note also that 2.49b is more complicated to install due to external Python requirements, this may well be covered in a later tutorial.​
Wiki, including Tutorials and User Manual:
Good luck! :)
 
Last edited:

Road-hog123

An Orange Bus
Administrator
UKDT
Dec 10, 2015
1,784
Exporting from Blender to Omsi
The basics of making sure your model is set up in a manner that avoids excess work, getting the mesh out of Blender and into Omsi's own *.o3d model format. For this tutorial (and much of developing for Omsi) you'll need the OMSI SDK-Tools available from this thread on the Official Forums.

Make sure you're using the correct coordinate axes!
Each point in the 3D world is represented by a set of 3 coordinates specifying how far from the origin (0, 0, 0) the point is. These are assigned the letters X, Y and Z. Different games and pieces of software decided to use different standards for which letter applies to which direction. In Omsi, positive X, Y and Z are right, forward and up respectively. By default Blender uses right, backwards and up; so you'll want to make sure you're modelling in the correct direction. :)

The difference between "local coordinates" and "global coordinates"
While in Edit Mode, a selector between "Local" and "Global" is visible in the Transform Properties panel (
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png
).
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png
Objects exist in the global space, with their positioning, scaling and rotation being measured with respect to the world centre. Meshes exist in the local space, with the positions of polygons, directions of axes and so on being relative to the centre of the object and the object's transformations. By default "Local" is selected, but I set this to global as this means the coordinates remain the same even when the object centre is moved. When a model is exported from Blender, the local mesh coordinates are used saved together with transform information for the position of the centre of the object. When viewed in Omsi, the world centre in Blender becomes the centre of the object (where the object grabs the cursor when placing a sceneryobject) and the mesh is translated using the position data. Object rotation and scaling data are lost when exporting to Omsi. This is important to note, as objects will end up out of scale in Omsi if there are scaling or rotational values associated with the object.

To apply these transforms to change the actual values of the mesh and reset the scale and rotation to 1 the Rotation and Scale need to be Applied. This can either done by navigating the menu or through the keyboard shortcut (
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png
) and choosing to apply the scale and rotation (more info).
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png
Having an object centre in another location to the world origin is essentially pointless (but won't do any harm) with static sceneryobjects, but can be useful for animated meshes. If you set it to the point that the mesh is to rotate about (e.g. the centre of the axle for a wheel) then you can use the origin_from_mesh entry in the animation configuration to avoid having to enter coordinates. This can make it easier to change the mesh as you can move the object without having to change the rotation centre coordinates in the model.cfg file. :)

Actually exporting from Blender to Omsi
Blender 2.49b:

With your the object(s) you wish to export selected in Object Mode, go to File > Export > DirectX (.x):
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png

This will then display the following in a scripts window:
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png

This allows the configuration of settings before exporting. The settings are as follows:
  • Anim - Where to export the in-Blender animations. Leave this off, animations are done inside Omsi.
  • Flip norm - Whether to flip the face normals (which direction they face). Again, leave this off.
  • Swap xy - Leave this off, if you'd modelled with the positive Y axis being up you could turn this on to fix orientation issues.
  • Flip z - Turn this off, otherwise the mesh will be flipped left/right in Omsi.
  • Speed - This isn't required to be touched for exporting to Omsi.
  • Bl.normals - Use Blender normals (keeps smoothing of mesh)
  • recalc.no - Recalculates normals (not sure why you'd want to do that...)
  • no smooth - turns off smoothing, ideal for junction objects.
  • Export All - Export all of the objects in the file.
  • Export Sel - Export just the selected objects.
Clicking either of the Export buttons brings up a file browser through which the mesh can be saved to a location.
Blender 2.7x:
When exporting for the first time, the DirectX (*.x) exporter must first be enabled. To do this, go to File > User Preferences > Add-ons and then search for and activate the DirectX import/export plugin.
Once this is done, select the object(s) you wish to export in Object Mode and then go to File > Export > DirectX (.x):
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png

This will then display a file browser where you can choose where to save the file and what to call it, but be aware of the settings panel on the bottom left:
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png

This allows configuration of the export:
  • Export Selected Objects Only - whether to only export those objects that have been selected or to export everything.
  • Coordinate System - choose "Right-handed" to avoid flipping the model left/right.
  • Up Axis - choose "Z" to avoid rotating the mesh.
  • Export meshes - leave this on, you do actually want to export a mesh. :tongueout:
  • Export normals - Leave this on for smoothing, turn it off to remove smoothing.
  • Export UV Coordinates - Leave this on so textures are mapped properly.
  • Export materials - Leave this on so textures are present.
  • Apply Modifiers - effects of modifiers will only be present on the output if this is on.
Once you have your *.x mesh file, you'll need to convert it to Omsi's own encrypted *.o3d format. You can do this with the OmsiXConv.exe program included in the SDK.
k3cBV8yeqlGXU4Q-FUDq07CEqj_4uJuw.png

  • X-File: z up - Keep this ticked, our mesh has the Z axis pointing up.
  • Separate Files - if you've exported several objects in one X file, you can separate them into individual o3d files with this option.
  • Show Details of X - puts info about the X file into the box on the right.
  • Remove Specular - removes the shine from objects. Recommended to leave this on, Omsi isn't too keen on specular.
  • Opt. Materials - not sure what this does, leave it on.
  • Opt. Vertices - again not sure, leave it on.
  • All Normals Up - if for some reason you want every polygon to render like it's pointing up?
  • Use Submesh Local Pos. as Global Pos. - will use the object centre as though it was the world centre (ignore transform exported with X file)
To convert the X file, select your desired settings, click Convert, select the X file and it will be converted.
(N.B.: If you're an advanced user, you can use this program with "Open with" to open an X file and it will automatically be converted with the default settings. You can also call it to do this action from a batch file. :))
Hopefully this helps those that are having difficulties getting objects into Omsi. :)
 
Last edited:

Road-hog123

An Orange Bus
Administrator
UKDT
Dec 10, 2015
1,784
Several months ago @whistlehead recorded a tutorial that explains the basics of object creation. While constructing a simple house, it covers acquiring textures from Streetview imagery, editing those textures to make effective textures, basic modelling in Blender, the basic Blender -> o3d conversion process (covered in more detail above) and making the object actually show up in game.
 
Status
Not open for further replies.