6. Presets

MetaRoadPreset - a asset that allows you to store and use various user presets, such as:

  • Profiles for all procedurally generated objects (Road Surface, Sidewalk, markings, curbs, etc.)

  • The road lane attributes

  • Road profiles for drawing (number and types of lanes)

There can be many presets in a project, but logically they are all combined into one. Therefore, you need to be careful with the names of profiles in presets, because if two or more presets contain profiles with the same name, only one will be used at random.
To create a new preset, simply create a new Meta Road Preset asset in the Content Browser:
alt text

The MetaRoad plugin already has a default preset at /MetaRoad/DefaultPreset. It should not be changed for backward compatibility, but there may be cases when it is necessary (for example, to change left-hand traffic to right-hand traffic):
alt text

6.1. Driveable Material Profiles

Contains material profiles for Road Lane type RoadLaneDriving. You can specify the material and decals for driveable road lanes. These profiles are available in Build Mesh Modeling Tool:
alt text

6.2. Sidewalk Material Profiles

Contains material profiles for Road Lane type RoadLaneSidewalk. You can specify the material for sidewalk road lanes. These profiles will be available in Build Mesh Modeling Tool:
alt text

6.3. Curb Profiles

Contains curb type profiles for Road Lane type RoadLaneSidewalk. You can set the curb material and geometry. These profiles are available in Build Mesh Modeling Tool:
alt text

6.4. Lane Mark Profiles

Contains profiles of road marking types for Road Lane type RoadLaneDriving. You can specify the type (solid, dashed, double), dimensions, and color of the marking strip. These profiles are available in Road Mark Attribute:
alt text

6.5. Road Lanes Material Profiles

Contains road marking material profiles for Road Lane type RoadLaneDriving. You can specify the Road Marks material. These profiles will be available in Build Mesh Modeling Tool:
alt text

6.6. Road Lanes Profiles

Contains road section profiles for drawing in Draw/Add Spline Build Mesh Modeling Tool -> Road Profile:
alt text

6.7. Road Attribute Entries

Road Attribute Entry is a helper constructor object that allows you to quickly create presets for Lane Attribute and add them to Road Lane. All Road Attribute Entries from all presets are automatically available in Road Attribute Editor Mode:
alt text

There are 3 main types of Road Attribute Entries (Component Template, Spline Mesh, Custom Builder):
alt text

6.7.1. Component Template

Allows to generate arbitrary USceneComponent along Road Lane at a specified interval during the Build Mesh process.
Simply create a BP or C++ class inherited from USceneComponent:
alt text

Then, in Road Attribute Entry, specify the created class in Component Template and set LengthOfSegment. After that, the created preset will be available in the Lane Attribute:
alt text

And now it can be added to Road Lane:
alt text

This template is convenient to use for repeating objects along Road Lane, such as traffic cones, flagpoles, lampposts, and power lines.

6.7.2. Spline Mesh

Allows to generate USplineMeshComponent along Road Lane during the Build Mesh process. To do this, specify the desired Static Mesh in Road Attribute Entry and set LengthOfSegment, after which the created preset will be available in the Lane Attribute:
alt text

And now it can be added to Road Lane:
alt text

6.7.3. Custom Builder

Provides the ability to write a custom attribute handler in C++ or BP during the Build Mesh process. To do this, need to create a class inherited from UCustomSplineBuilder and override the Generate Asset function:
alt text

After that, you need to specify the created class in the preset, and it will become available in Lane Attribute:
alt text