Keeping Data Alive Supporting reuse & repurposing of 3D data in the humanities

COLLADA Export Options in CityEngine Python Exporter

COLLADA Export Options in CityEngine Python Exporter
settings = DAEExportModelSettings()

####################
# GENERAL SETTINGS #
####################
# set the export path and name of associated files
settings.setOutputPath(directory)
settings.setBaseName(name)
# export the models but default to start shape if problem
settings.setExportGeometry("MODEL_GEOMETRY_FALLBACK")
# export associated terrain
settings.setTerrainLayers("TERRAIN_ALL_SELECTED")
# simplification of terrain
settings.setSimplifyTerrainMeshes(True)

########################
# GRANULARITY SETTINGS #
########################
# export to a single file (instead of one per material)
settings.setFileGranularity("MEMORY_BUDGET")
# memory budget set to default from export wizard
settings.setMemoryBudget(500)
# create a node with shape's name
settings.setCreateShapeGroups(True)
# "Reuse asset instances, merge generated meshes by material"
settings.setMeshGranularity("INSTANCED")

#####################
# GEOMETRY SETTINGS #
#####################
# allow vertices to be shared between faces
settings.setVertexIndexing("INDEXED")
# vertex normals set to "Write vertex normals"
settings.setVertexNormals("PASS")
# write all texture coordinates
settings.setTextureCoordinates("ALL")
# ignoring local offset
# "zero" the object(s) to remove geographic coordinates for global offset
position = ce.getPosition(toExport)
settings.setGlobalOffset([-position[0], -position[1], -position[2]])
# vertex precision set to default from export wizard
settings.setVertexPrecision(0.001)
# normal precision set to default from export wizard
settings.setNormalPrecision(0.001)
# texture coord precision set to default from export wizard
# settings.setTexcoordPrecision(1.0E-4)
# shares vertices within precision
settings.setMergeVertices(True)
# shares normals within precision
settings.setMergeNormals(True)
# shares texture coordinates within precision
settings.setMergeTexcoords(True)
# does not triangulate meshes, required for google earth
settings.setTriangulateMeshes(False)
# allow holes
settings.setFacesWithHoles("PASS")

#####################
# MATERIAL SETTINGS #
#####################
# include material information
settings.setIncludeMaterials(True)

####################
# TEXTURE SETTINGS #
####################
# include textures
settings.setCollectTextures(True)
# do not create texture atlases that combine texture atlases
settings.setCreateTextureAtlases(False)
# therefore do not need texture atlas max dimension
# therefore do not need texture atlas border dimensions

#####################
# ADVANCED SETTINGS #
#####################
# output log
settings.setWriteLog(True)
# beware, collada 1.5.x doesn't seem to work when exporting these
settings.setCOLLADAVersion(colladaVersion)
# delineater for shape name clashes
settings.setShapeNameDelimiter("_")
# overwrite any existing files at that location!!!
settings.setExistingFiles("OVERWRITE")
# no reports