Skip To Content

Python scripting notes and changelog

CityEngine Scripting Interface

The CityEngine scripting interface is based on Jython, a Java implementation of Python. Current version is 2.7.0.

CityEngine comes with a special Jython module scripting containing CityEngine specific commands (see list of classes)

Jython supports almost all modules of the standard Python library. In addition, Jython can include arbitrary Java classes to extend its functionality. Please see the Jython website for more details.

2020.0 changelog

StatusCommands

New

Added MSPKExportSettings to export Mobile Scene Packages.

New

Added USDExportModelSettings to export Universal Scene Description files.

Changed

The methods UnrealExportModelSettings.get/setUseTextureAtlas were introduced to control creation of texture atlases in contrast to individual texture files.

Changed

The method ImageExportTerrainSettings.setFilename was renamed from setFileName for consistency.

Changed

The method TPKExportSettings.get/setOutputPath were renamed from get/setPath for consistency.

2019.1 changelog

StatusCommands

Changed

The return type of getAttribute for arrays was changed from dict to list.

New

The old behavior of getAttribute for arrays returning a dict can be obtained through the deprecated function CE.getAttributeArrayAsDict.

New

SPKMeshExportModelSettings has option get/setFileSize to influence the file size. Users familiar with the i3s specification can use get/setMaxDepth to directly set the maximum tree depth alternatively.

Removed

The option get/setLayerTextureEncoding was removed from SPKMeshExportModelSettings in favor of the size functions above.

2019.0 changelog

StatusCommands

New

glTF models can be imported using GLTFImportSettings in ce.importFile and exported using GLTFExportModelSettings in ce.export.

New

The scene rendering can be controlled using LightSettings with ce.get/setLighting, PanoramaSettings with ce.get/setPanorama, and RenderSettings with view3d.get/setRenderSettings.

New

The edge attributes of shapes can be computed using ce.computeEdgeAttributes and controlled using ComputeEdgeAttributesSettings.

New

The elevation offset of a layer can be controlled using ce.get/ce.setElevationOffset.

New

Terrain elevation limits can be controlled using ce.get/ce.setTerrainMinHeight and ce.get/ce.setTerrainMaxHeight.

New

Shapes can be boolean subtracted from each other using ce.subtractShapes.

New

Scenarios can now be controlled using the following functions:

New

TPKExportSettings now has get/setVerticalOffset functions.

New

UnrealExportModelSettings now has get/setMetadata functions.

New

RPKExportSettings has new functions get/setIncludeSourceFiles and getAddFilesAutomatically.

Changed

RPKExportSettings function addFilesAutomatically was renamed setAddFilesAutomatically and it takes an optional argument that allows deactivation of automatic file adding.

Changed

The method CE.get3DViews returns only Viewports.

Changed

The methods CE.isInspector and CE.isViewport were deprecated because CE.get3DViews only returns viewports.

Removed

The functions get/setWriteDDSTextures were removed from SPKMeshExportModelSettings.