Model Export Application Notes

  1. Format Recommendations
  2. Working with Expensive Assets
  3. Working with Large Models
  4. Memory Issues during Batch Export
  5. Known Interoperability Limitations and Issues
  6. Extending CityEngine with custom importers/exporters

Note #1: Format Recommendations

Please note that some of the listed tools require additional plugins to be able to load all formats.

Tool Format Mandatory Options
ArcGIS Earth KML
Autodesk Max OBJ, FBX (for obj, enable import of smoothing groups in max)
Autodesk Maya FBX, ABC, OBJ (Maya cannot import Alembic materials out-of-the-box.)
Autodesk MotionBuilder OBJ, FBX
Blender OBJ, FBX, ABC - Multi-Texturing
Cinema 4D OBJ, DAE - Multi-Texturing
Deep Exploration OBJ, FBX, DAE
SideEffects Houdini Alembic
The Foundry Katana Alembic
Lightwave OBJ
Polytrans OBJ, FBX, DAE
e-on Vue VOB, OBJ

Note #2: Working with Expensive Assets

If you work with expensive (i.e., large) assets, it is of advantage to create simplified proxy assets and switch between them with a global LOD (Level of Detail) attribute. To avoid scattering the LOD attribute all over the rules, it is useful to put the conditions into separate "asset loader" rules:

attr LOD = 0
...
Shaft -->
    s(diameter,'1,diameter) center(xz) color(shaftC) ShaftAsset 
    
ShaftAsset -->
	    case LOD == 0: primitiveCube()
	    else: i("path/to/expensive/asset.obj")
...

Note #3: Working with Large Models

If you plan to create large models, it is of great advantage to implement global CGA attributes into your rule sets that allow to selectively block the generation of polygon-intensive model features. For example, one could replace some high-polygon greek columns with simple cuboids by using an attribute LOD, together with a corresponding condition in the CGA rules.

Application Example

Let's assume you want to render a large scene with Renderman and you have a CityEngine scene ready with a LOD switch. By exporting the scene with LOD = 0 to a single obj file (without any textures) and importing it, for example, into Maya, you are able to quickly setup the lights and camera without overburdening Maya with heavy geometry. Once the environment is ready you can go back to CityEngine and export the whole scene with LOD = 1 to RIB files and link them to the render setup.

Implementation Example

Below you find a modified version of the Parthenon temple shape grammar example. Note the usage of the LOD attribute:

...

# ---------------------- model parameters ----------------------

@Group("Model Options", 0)
@Order(1)
@Enum("High","Low")
attr Level_of_Detail  = "Low"
const HighLOD         = Level_of_Detail == "High"

...

### Columns ###

...

ColumnTile --> 
    set(trim.vertical,false) 
    primitiveCube() s( Diameter ,'1, Diameter ) t('-0.5,0,'-0.5) 
    color(Column_Color) 

    [ case HighLOD : Column
      else : Column. ]

Column --> ...	  
	  
... 

The temple with LOD = Low, ~90k polygons
temple LOD = 0

The temple with LOD = High, ~675k polygons
temple LOD = 1

Note #4: Memory Issues during Batch Export

On 32bit systems, if you see low memory error messages during batch export, try to set the "File Size Limit" option to a lower value (eg. 200-300mb). A lower value will consume less memory when the geometry data is optimized for each exported file. With CityEngine 2013 and later, 32 bit systems are no more supported.

On 64bit systems, there is still enough address space to complete the export (although the system might start swapping memory, which will slow down the exporter).

Note #5: Known Interoperability Limitations and Issues

CityEngine Export Limitations

Esri FileGDB

Autodesk FBX

COLLADA

3rd Party Tool Import Limitations & Issues

Autodesk Maya

DeepExploration

3DSMax

Note #6: Extending CityEngine with custom importers/exporters

CityEngine can be extended with custom importers and exporters (together referred to as extensions) built with the CityEngine SDK. Extensions are deployed as shared libraries and can be loaded into CityEngine by two mechanisms:

  1. From the
    [CityEngine Installation Directory]/plugins/com.esri.prt.clients.ce.[your platform]_1.0.0/lib
    directory. To install the extension(s), simply copy the shared libraries into this directory.
  2. From any directory(s) specified via the
    CITYENGINE_EXTENSION_PATHS
    environment variable. You may specify multiple directory separated by colon (':') on macOS/Linux or by semi-colon (';') on Windows. Do not included the shared library itself in these paths - CityEngine will recursively traverse all directories specified and load all compatible extensions.

Further Reading

Copyright ©2008-2017 Esri R&D Center Zurich. All rights reserved.