5. IMPORT LINES AS BLUEPRINT SPLINES
To use the Import Lines as Blueprint Splines feature, you must first select a landscape to import the vector lines to – the Import Lines as Blueprint Splines button will be inactive (greyed out) until you select a landscape actor.
5.1. SPLINE BLUEPRINTS:
The most powerful and extensible feature of TerraForm is its ability to import GIS vector lines into UE4 Blueprints. This is because Blueprints give you the ability to write your own code to tell Unreal what to do with the GIS data you’re importing.
A few examples of what you can create include:
- Fields of crops
- Power lines, telephone wires, or fences
- Rows of buildings
- Rivers with flowing water
- Traffic on your roads
- Paths for cameras or AI
You can download many different types of spline blueprints from the Unreal Market Place. Epic provides a lot of information about how to create your own blueprints, and YouTube is another great resource for step by step instructions on this topic. We’ll also be making available a number of really useful blueprints we’ve created for you to use with TerraForm.
5.1.1. TerraForm Spline Actor:
Due to restrictions imposed by UE4, your blueprints will need to be parented the TerraForm Spline Actor Class and use the inherited Spline component to receive data from TerraForm. Further information about how to create your own blueprints or to re-parent existing blueprints is available in the Tutorials section.
5.3. SPLINE ACTOR IMPORT OPTIONS:
The Spline Actor Import Options window is used to select the blueprint you want to import your GIS line vector data to, and provides a limited number of import options for your imported spline data:
Source File: The name of the GIS vector line (.shp) file you’re importing.
Assets Path: The path to the folder to use to save any assets created during the import process.
5.3.2. Blueprint Spline Import Settings:
Spline Class: This is where to select the blueprint you’d like to import your GIS vector data to. Only blueprints that use the TerraForm Spline Actor class will be available.
Vertical Offset: Here you can set a vertical offset for your blueprint spline. Vertical Offsets are applied whether to Snap to Landscape checked or not. If checked, your blueprint will be vertically offset from the landscape by this value. If not checked, Vertical Offset becomes the height value for all control points.
Snap to Landscape: If checked, the z=value of your blueprint spline’s control points will be set to the terrain altitude. If unchecked, spline control points will be set to z=0.
5.4. IMPORTING VECTOR LINE DATA:
Here’s what actually happens when you import your vector line data into UE4 using TerraForm:
As with landscape spline, when you import vector line data as blueprint splines, TerraForm first reads the metadata from the Shapefile to be imported. It then reads the GIS Projection Asset and compares the values. If the imported Shapefile projection information is the same as that for the landscape, your data is imported without reprojection. If they differ, your GIS vector data is reprojected to the same projection system as your landscape, then imported.
5.4.2. Height Test:
If you’ve selected Snap to Landscape, once your vector data is in the same projection as your landscape, TerraForm checks the landscape’s terrain altitude at each of your control points and sets its z-value, applying your spline to the landscape’s surface. Like landscape spline import, if spline points fall outside the extent of your DTM data unusual behaviour can result, so make sure you clip the GIS data inside the DTM extents before importing.
If Snap to Landscape is unchecked, the height test will be skipped and all blueprint spline points will be set at the altitude of your Vertical Offset.
5.4.3. Apply Import Settings:
Following reprojection and height testing, a copy of the blueprint is added as an actor to your scene and the imported spline points are copied into it. Unlike landscape splines, blueprint splines are available as actors in the World Outliner.
If your GIS vector data contains multiple single-part lines, a new blueprint spline will be added for each individual line.