UnrealExportModelSettings

Encodes geometry into the Datasmith (5.1.0) format.

@example:
lots = ce.getObjectsFrom(ce.scene, ce.withName("'Lots'"))
exportSettings = UnrealExportModelSettings()
exportSettings.setOutputPath(ce.toFSPath("data/batchExportTests/"))
exportSettings.setBaseName("Lots")
ce.export(lots, exportSettings)

 

Methods defined here:

getBaseName

getBaseName(self):

Gets BaseName field. Sets the name of the written udatasmith file.

@return: Value of BaseName field.  [str]

getExportGeometry

getExportGeometry(self):

Gets ExportGeometry field. Choose what geometry is exported. 'Models with Shape Fallback' writes the Start Shape if the Model generation fails. 'Models' skips to the next export item if the Model generation fails. 'Shapes' always writes the Start Shape and disregards the Model generation.

@return: Value of ExportGeometry field.  ["MODEL_GEOMETRY_FALLBACK", "MODEL_GEOMETRY", "SHAPE_GEOMETRY"] [str]

getExportLod

getExportLod(self):

Gets ExportLod field. Export level of details (LOD) based on an attribute with an @Enum annotation specifying the different LODs.

@return: Value of ExportLod field.  [True/False]

getExportLog

getExportLog(self):

Returns a dictionary containing details of the export.

@return: A dictionary containing details about the finished export.

getGlobalOffset

getGlobalOffset(self):

Gets GlobalOffset field.

@return: Value of GlobalOffset field.  [sequence of float]

getInstancing

getInstancing(self):

Gets Instancing field. Options on how to handle instances.

@return: Value of Instancing field.  ["disabled", "useInstancing", "instancingHISM"] [str]

getLODAttribute

getLODAttribute(self):

Gets LODAttribute field. The name of the CGA attribute (needs to have an @Enum annotation) which specifies the LOD. Note that if multiple CGA files define the same LOD attribute they all need to have an @Enum annotation with the same number of parameters (LODs).

@return: Value of LODAttribute field.  [str]

getLODOrder

getLODOrder(self):

Gets LODOrder field. Semantic order of the LODs from the "LOD Attribute" enum Annotation. Ascending meaning the lowest level of detail (the one with the least detail) first, e.g. @Enum("low", "medium", "high"). And Descending the highest level of detail (the one of the most detail) first. e.g. @Enum("high", "medium", "low").

@return: Value of LODOrder field.  ["ASCENDING", "DESCENDING"] [str]

getMeshMerging

getMeshMerging(self):

Gets MeshMerging field. Options to merge meshes.

@return: Value of MeshMerging field.  ["perInitialShape", "perInitialShapeByMaterial", "globally", "globallyByMaterial"] [str]

getMetadata

getMetadata(self):

Gets Metadata field. Export metadata for all initial shapes. This is only possible if Mesh Merging is set to Per Initial Shape and Instancing is Disabled.

@return: Value of Metadata field.  ["none", "attributes", "reports", "all"] [str]

getOutputPath

getOutputPath(self):

Gets OutputPath field. Output directory for all exported files.

@return: Value of OutputPath field.  [str]

getScript

getScript(self):

Gets Script field. Python script to use for export callbacks.

@return: Value of Script field.  [str]

getSimplifyTerrainMeshes

getSimplifyTerrainMeshes(self):

Gets SimplifyTerrainMeshes field. Perform geometry simplification on terrains.

@return: Value of SimplifyTerrainMeshes field.  [True/False]

getTerrainLayers

getTerrainLayers(self):

Gets TerrainLayers field. Choose how terrain layers are exported.

@return: Value of TerrainLayers field.  ["TERRAIN_ALL_VISIBLE", "TERRAIN_ALL_SELECTED", "TERRAIN_ALL", "TERRAIN_NONE"] [str]

getTerrainMeshResolution

getTerrainMeshResolution(self):

Gets TerrainMeshResolution field. Resolution of the generated terrain mesh. In the Python API this is an integer list [x-Resolution, y-Resolution]. A Python integer value of -1 will be replaced with the highest resolution of the selected terrains but limited at 1024.

@return: Value of TerrainMeshResolution field.  [sequence of int]

getTwinmotionCompatible

getTwinmotionCompatible(self):

Gets TwinmotionCompatible field. Exports the scene with Twinmotion compatible settings.

@return: Value of TwinmotionCompatible field.  [True/False]

getUseTextureAtlas

getUseTextureAtlas(self):

Gets UseTextureAtlas field. Creates texture atlases which combine a set of textures into one, thus reducing the number of textures and materials.

@return: Value of UseTextureAtlas field.  [True/False]

getUseUnrealBaseMaterials

getUseUnrealBaseMaterials(self):

Gets UseUnrealBaseMaterials field. Use the predefined Unreal Engine Base Materials as parent material for all exported materials.

@return: Value of UseUnrealBaseMaterials field.  [True/False]

getWriteLog

getWriteLog(self):

Gets WriteLog field. Write log file with statistics about this export session.

@return: Value of WriteLog field.  [True/False]

load

load(self, name):

Load the named settings from the current scene file.

@param name: The name of the settings to load.  [str]
@return: result. [UnrealExportModelSettings]

save

save(self, name):

Save the named settings to the current scene file.

@param name: The name of the settings to save.  [str]

setBaseName

setBaseName(self, stringValue):

Sets BaseName field. Sets the name of the written udatasmith file.

@param stringValue: the new value. [str]

setExportGeometry

setExportGeometry(self, enumValue):

Sets ExportGeometry field. Choose what geometry is exported. 'Models with Shape Fallback' writes the Start Shape if the Model generation fails. 'Models' skips to the next export item if the Model generation fails. 'Shapes' always writes the Start Shape and disregards the Model generation.

@param enumValue: the new value ["MODEL_GEOMETRY_FALLBACK", "MODEL_GEOMETRY", "SHAPE_GEOMETRY"]. [str]

setExportLod

setExportLod(self, booleanValue):

Sets ExportLod field. Export level of details (LOD) based on an attribute with an @Enum annotation specifying the different LODs.

@param booleanValue: the new value. [True/False]

@example:
exportSettings = UnrealExportModelSettings()
exportSettings.setOutputPath(ce.toFSPath("data/batchExportTests/"))
exportSettings.setBaseName("Lods")
exportSettings.setInstancing(UnrealExportModelSettings.DISABLED);
exportSettings.setExportLod(True)
exportSettings.setLODAttribute("LoD")
exportSettings.setLODOrder(UnrealExportModelSettings.ASCENDING)
ce.export(ce.scene, exportSettings)

setGlobalOffset

setGlobalOffset(self, floatArrayValue):

Sets GlobalOffset field.

@param floatArrayValue: the new value. [sequence of float]

setInstancing

setInstancing(self, stringValue):

Sets Instancing field. Options on how to handle instances.

@param stringValue: the new value ["disabled", "useInstancing", "instancingHISM"]. [str]

setLODAttribute

setLODAttribute(self, stringValue):

Sets LODAttribute field. The name of the CGA attribute (needs to have an @Enum annotation) which specifies the LOD. Note that if multiple CGA files define the same LOD attribute they all need to have an @Enum annotation with the same number of parameters (LODs).

@param stringValue: the new value. [str]

@example:
exportSettings = UnrealExportModelSettings()
exportSettings.setOutputPath(ce.toFSPath("data/batchExportTests/"))
exportSettings.setBaseName("Lods")
exportSettings.setInstancing(UnrealExportModelSettings.DISABLED);
exportSettings.setExportLod(True)
exportSettings.setLODAttribute("LoD")
exportSettings.setLODOrder(UnrealExportModelSettings.ASCENDING)
ce.export(ce.scene, exportSettings)

setLODOrder

setLODOrder(self, enumValue):

Sets LODOrder field. Semantic order of the LODs from the "LOD Attribute" enum Annotation. Ascending meaning the lowest level of detail (the one with the least detail) first, e.g. @Enum("low", "medium", "high"). And Descending the highest level of detail (the one of the most detail) first. e.g. @Enum("high", "medium", "low").

@param enumValue: the new value ["ASCENDING", "DESCENDING"]. [str]

@example:
exportSettings = UnrealExportModelSettings()
exportSettings.setOutputPath(ce.toFSPath("data/batchExportTests/"))
exportSettings.setBaseName("Lods")
exportSettings.setInstancing(UnrealExportModelSettings.DISABLED);
exportSettings.setExportLod(True)
exportSettings.setLODAttribute("LoD")
exportSettings.setLODOrder(UnrealExportModelSettings.ASCENDING)
ce.export(ce.scene, exportSettings)

setMeshMerging

setMeshMerging(self, stringValue):

Sets MeshMerging field. Options to merge meshes.

@param stringValue: the new value ["perInitialShape", "perInitialShapeByMaterial", "globally", "globallyByMaterial"]. [str]

setMetadata

setMetadata(self, stringValue):

Sets Metadata field. Export metadata for all initial shapes. This is only possible if Mesh Merging is set to Per Initial Shape and Instancing is Disabled.

@param stringValue: the new value ["none", "attributes", "reports", "all"]. [str]

setOutputPath

setOutputPath(self, stringValue):

Sets OutputPath field. Output directory for all exported files.

@param stringValue: the new value. [str]

setScript

setScript(self, stringValue):

Sets Script field. Python script to use for export callbacks.

@param stringValue: the new value. [str]

setSimplifyTerrainMeshes

setSimplifyTerrainMeshes(self, booleanValue):

Sets SimplifyTerrainMeshes field. Perform geometry simplification on terrains.

@param booleanValue: the new value. [True/False]

setTerrainLayers

setTerrainLayers(self, enumValue):

Sets TerrainLayers field. Choose how terrain layers are exported.

@param enumValue: the new value ["TERRAIN_ALL_VISIBLE", "TERRAIN_ALL_SELECTED", "TERRAIN_ALL", "TERRAIN_NONE"]. [str]

setTerrainMeshResolution

setTerrainMeshResolution(self, intArrayValue):

Sets TerrainMeshResolution field. Resolution of the generated terrain mesh. In the Python API this is an integer list [x-Resolution, y-Resolution]. A Python integer value of -1 will be replaced with the highest resolution of the selected terrains but limited at 1024.

@param intArrayValue: the new value. [sequence of int]

setTwinmotionCompatible

setTwinmotionCompatible(self, booleanValue):

Sets TwinmotionCompatible field. Exports the scene with Twinmotion compatible settings.

@param booleanValue: the new value. [True/False]

setUseTextureAtlas

setUseTextureAtlas(self, booleanValue):

Sets UseTextureAtlas field. Creates texture atlases which combine a set of textures into one, thus reducing the number of textures and materials.

@param booleanValue: the new value. [True/False]

setUseUnrealBaseMaterials

setUseUnrealBaseMaterials(self, booleanValue):

Sets UseUnrealBaseMaterials field. Use the predefined Unreal Engine Base Materials as parent material for all exported materials.

@param booleanValue: the new value. [True/False]

setWriteLog

setWriteLog(self, booleanValue):

Sets WriteLog field. Write log file with statistics about this export session.

@param booleanValue: the new value. [True/False]

Constants

This class defines the following constants:

ASCENDING = 'ASCENDING'
DESCENDING = 'DESCENDING'
MODEL_GEOMETRY = 'MODEL_GEOMETRY'
MODEL_GEOMETRY_FALLBACK = 'MODEL_GEOMETRY_FALLBACK'
SHAPE_GEOMETRY = 'SHAPE_GEOMETRY'
TERRAIN_ALL = 'TERRAIN_ALL'
TERRAIN_ALL_SELECTED = 'TERRAIN_ALL_SELECTED'
TERRAIN_ALL_VISIBLE = 'TERRAIN_ALL_VISIBLE'
TERRAIN_NONE = 'TERRAIN_NONE'
ALL = 'all'
ATTRIBUTES = 'attributes'
DISABLED = 'disabled'
GLOBALLY = 'globally'
GLOBALLYBYMATERIAL = 'globallyByMaterial'
INSTANCINGHISM = 'instancingHISM'
NONE = 'none'
PERINITIALSHAPE = 'perInitialShape'
PERINITIALSHAPEBYMATERIAL = 'perInitialShapeByMaterial'
REPORTS = 'reports'
USEINSTANCING = 'useInstancing'