Skip To Content

Export DATASMITH (Unreal Engine)

The Unreal Engine (DATASMITH) exporter provides efficient data transfer from CityEngine to the Unreal Engine Editor. The main purpose of this exporter is for architectural and design visualization workflows, but will obviously also work for games and other tasks.

Note:
  • The Unreal exporter is only available on Windows.
  • To use the Unreal exporter in CityEngine, at least the Unreal Engine Launcher needs to be installed as a prerequisite.
  • To import a CityEngine scene into the Unreal Editor, it is recommended to use the "CityEngine Model Loader Project" for Unreal which is available in your Unreal Library Vault if you are subscribed to Unreal Studio. This template contains master materials with shading networks that automatically connect CityEngine material attributes to Unreal materials (See Materials).

Export settings

In addition to the general export options, the Unreal Engine DATASMITH has the following options:

Global Offset

Global offset for generated geometry for x, y and z axes (Cartesian coordinate values).

Mesh Merging

Different options on how the resulting meshes are merged:

  • Per Initial Shape: Meshes are merged by initial shapes.
  • Per Initial Shape by Material: Meshes are merged by initial shapes by material. This will result in one mesh per material for each initial shape.
  • Globally: Meshes are merged globally.
  • Globally by Material: Meshes are merged globally by material.

Instancing

Different options on how instancing is handled:

  • Disabled: Instancing is disabled.
  • Use Instancing: Instancing is enabled which results in meshes being shared between Actors if possible.
  • Use Instancing with Hierarchical Instanced Static Mesh Components: Instancing is enabled, and instances are added using hierarchical instanced static mesh (HISMC) actors.
    Note:

    Material overriding for instances of the same mesh is not supported with the HISMC actors. Normal instancing will be used of materials are overridden.

Metadata

Metadata can be exported when the Mesh Merging mode is set to either Per Initial Shape or Per Initial Shape by Material. Metadata export options:

  • All: Write both object attributes and reports to object metadata.
  • Attributes: Write object attributes to object metadata.
  • Reports: Write generated report data to object metadata.
  • None: Do not include object attributes nor report data.

The exported metadata is attached to the root object of each initial shape in Unreal.

Terrain Layers

Terrain layers can be exported to Unreal Engine Landscapes . The following options are supported:

  • Do not export any terrain layers
  • Export all visible terrain layers
  • Export all selected terrain layers
  • Export all terrain layers

Mapping between CityEngine and Unreal entities

Geometry

Each exported mesh is represented as an Actor in Unreal. Each unique mesh is exported as a Static Mesh and reused if instancing is enabled.

Materials

Materials are translated to Unreal by passing CGA material attributes to an Unreal material instance which is based on a certain master (or parent) material (see Instanced Materials).

A custom master material can be assigned by setting the material.shader CGA attribute to the corresponding Unreal material path, e.g. /Game/Materials/CityEngineMaterials/M_CE_MyMaterial. If material.shader is not set, a suitable master material will be chosen (see Default Master Materials).

Each CGA material attribute is exported and can be accessed in Unreal by using a material parameter with a specific name and data type. The following table lists the CGA material attributes and their respective Unreal parameter name and type:

CGA attributeUnreal Parameter NameUnreal TypeNote

material.color

Color

Vector3

material.opacity

Opacity

float

material.reflectivity

Reflectivity

float

material.shininess

Shininess

float

material.bumpValue

BumpValue

float

material.ambient

Ambient

Vector3

material.specular

Specular

Vector3

material.colormap

ColorMap

Texture2D

material.dirtmap

DirtMap

Texture2D

material.specularmap

SpecularMap

Texture2D

material.opacitymap

OpacityMap

Texture2D

<none>

OpacitySource

float

For OpacitySource value:

  • 0: Use color channels (gray level) from OpacityMap
  • 1: Use alpha channel from OpacityMap

material.bumpmap

BumpMap

Texture2D

material.normalmap

NormalMap

Texture2D

<none>

IsPBR

float

  • 1: if material.shader is set to CityEnginePBRShader
  • 0: Otherwise

material.metallic

Metallic

float

material.roughness

Roughness

float

material.emissivecolor

EmissiveColor

Vector3

material.metallicmap

MetallicMap

Texture2D

material.roughnessmap

RoughnessMap

Texture2D

material.occlusionmap

OcclusionMap

Texture2D

material.emissivemap

EmissiveMap

Texture2D

Default Master Materials

The CityEngine Model Loader project provides several master materials for opaque, transparent and masked transparent materials. If no material is specified using the material.shader CGA attribute, a material is chosen using the following rules:

  • If material.opacity is smaller than 1 or material.opacitymap is set
    • and the opacitymap.mode is blend the M_CE_Transparent material is selected
    • and the opacitymap.mode is masked the M_CE_MaskedOpacity is selected
  • Otherwise the M_CE_Opaque material is selected

Further documentation on the default materials can be found in the CityEngine Model Loader project in the Unreal Engine Vault.

Note:

The Unreal Engine sorts transparency per actor. Exporting overlapping transparent actors will lead to rendering artifacts. Masked binary opacity is not affected by this limitation.

Default Material Attribute Translation

The default master materials translate the CGA material attributes roughly to a physically based Unreal Material. If the material.shader is set to CityEnginePBRShader (this happens automatically if for example an inserted glTF model is exported), the default master materials in Unreal will use the PBR material attributes (roughness, metallic, and emissive).

Note:

The specular color is not used in Unreal. The specular color in Unreal depends on the base color and how metallic the material is.