Export Terrains from CityEngine to Twinmotion

2534
0
12-20-2022 04:31 AM
ThomasFuchs
Esri Regular Contributor
4 0 2,534

This article was made with CityEngine 2022.1 and Twinmotion 2022.2.

Prepare your CE Terrain for Twinmotion

Before you start exporting the terrain layer, some preparations are needed.

Export all Models and Shapes to Unreal Datasmith

Export your scene geometry using the Datasmith Exporter

ThomasFuchs_0-1671536898140.png

  • IMPORTANT: Enable the Twinmotin compatibility mode. 
  • In the Geometry Settings section press Center. Note down the offset values. This will help you to align the terrain in the Twinmotion scene later.

Please consult the Export DATASMITH (Unreal and Twinmotion)—ArcGIS CityEngine Resources | Documentation for more details.

Setting the optimal Terrain resolution

Select the Terrain and open the Inspector. Increase the elevation resolution until the grid is approximately 1- by -1 meter. Additionally, write down the amplitude of the terrain (Maximum Height - Minimum Height value), since it is later needed for the import in Twinmotion.

ThomasFuchs_0-1670601536199.png

Water areas

Does your scene contain an ocean, lake, or slow-flowing river? Then use Twinmotion for realistic water visualization. Most likely your terrain data represents the surface of the water body. For the visualization in Twinmotion, water bodies need some depth to look good. Use the CityEngine terrain edit brush to increase the depth of the terrain in the water areas. 

ThomasFuchs_0-1670600572372.png

Export your CE Terrain

There are two methods to transfer terrain data from CityEngine to Twinmotion. You can either choose to export a heightmap image or terrain mesh.

Export as Heightmap image

Select the terrain in the Scene Editor and go to Menu > Export... > Export Selected Terrains as Image. Then choose the png (16 Bit Grey) format. 

ThomasFuchs_4-1670602449748.png

Export as Mesh

Select the terrain in the Scene Editor and go to Menu > Export Models... and select Autodesk FBX.

ThomasFuchs_2-1671537304069.png

  • Go to Geometry Settings and use the same offset values (the values you wrote down earlier) as you did for the Datasmith export (alternatively, click Center). This helps to align the terrain in your Twinmotion scene after import.

Prepare your Twinmotion Scene

First, make sure your Twinmotion scene is set to meters:
ThomasFuchs_7-1670602764886.png

Datasmith Import

Open the Twinmotion geometry import dialog to import your scene geometry stored int the Datasmith exchange format.
ThomasFuchs_0-1671539854984.png

  • Keep all default options

Import your Terrain in Twinmotion

In Twinmotion, terrains are called Landscapes. Open the import dialog and select the Landscape tab. On import, landscapes get materials assigned automatically. 

ThomasFuchs_2-1670601951780.png

You have three different options to add the terrain:

1: Landscape from a Heightmap image

ThomasFuchs_5-1670602501942.png

  • Set the Largest dimension to the largest dimension of the image file. Remember: the elevation resolution was set to 1-by-1 meters prior to export in CityEngine.
  • The amplitude is the Maximum Height - Minimum Height value in the CityEngine Inspector (The same amplitude values you wrote down earlier).
  • Optionally enable Smoothing.

2: Landscape from Mesh

ThomasFuchs_6-1670602630304.png

  • The up-axis and the distance unit are defined by the CE exporter.
    Keep both options set to Auto.
  • Optionally enable Smoothing.

3: Import Terrain Mesh as Geometry

The third option is to import the terrain mesh as geometry. This allows you to keep the texture (e.g., satellite image) of your CityEngine terrain.

ThomasFuchs_0-1671466705812.png

  • Keep the default settings

Add Water to the Landscape

Optionally, enable Water in the Twinmotion scene. 

  1. Settings > Weather > Effects > Ocean
    1. Enable
    2. Adjust the height
    3. In Aspect select the water type
      ThomasFuchs_8-1670603321680.png

Move all elements into place

Use the rotate/translate tool for aligning your building geometry to the terrain.

ThomasFuchs_9-1670603517158.png

____________________________________________________________________________
Get a 
Free 21-Day Trial of ArcGIS CityEngine | Sign Up Today (esri.com)
and try Twinmotion for free for as long as you need for non-commercial use, or upgrade to the full-featured version for yourself or your company.