GLTFExportModelSettings

Encodes geometry into the Khronos Group glTF 2.0 format.

@example:
# Settings class used to control parameters for exporting models to glTF
exportSettings = GLTFExportModelSettings()
exportSettings.setOutputPath(ce.toFSPath("/python/models/batchExportTests"))
exportSettings.setBaseName("gltf_batchexport")
ce.export(ce.selection()[0], exportSettings)

 

此处定义的方法如下:

getBaseName

getBaseName(self):

Gets BaseName field. The base name for all files.

@return: Value of BaseName field.  [str]

getExistingFiles

getExistingFiles(self):

Gets ExistingFiles field. Specifies how files should be written during the export run. The log file will be written anyways.

@return: Value of ExistingFiles field.  ["OVERWRITE", "SKIP"] [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]

getExportLog

getExportLog(self):

Returns a dictionary containing details of the export.

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

getFileGranularity

getFileGranularity(self):

Gets FileGranularity field. Specifies the partition of the generated geometry into files.

@return: Value of FileGranularity field.  ["MEMORY_BUDGET", "START_SHAPE"] [str]

getGlobalOffset

getGlobalOffset(self):

Gets GlobalOffset field. Global (= for all shapes/models) offset for exported geometry.

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

getIncludeMaterials

getIncludeMaterials(self):

Gets IncludeMaterials field. Exports material definitions (e.g. color, textures, ...).

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

getMemoryBudget

getMemoryBudget(self):

Gets MemoryBudget field. Specifies the size limit in megabytes per exported file (value 0 = unlimited). Please note: The size is measured on the unoptimized geometry, i.e. the final size may vary. The check is only performed per input shape.

@return: Value of MemoryBudget field.  [int]

getMeshGranularity

getMeshGranularity(self):

Gets MeshGranularity field. Specifies the processing of meshes.

@return: Value of MeshGranularity field.  ["AS_GENERATED", "PER_MATERIAL", "INSTANCED"] [str]

getOutputFormat

getOutputFormat(self):

Gets OutputFormat field. Specifies the output glTF format.

@return: Value of OutputFormat field.  ["GLTF_JSON_WITH_EXTERNAL_DATA", "GLTF_GLB_WITH_SINGLE_BUFFER"] [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]

getShapeNameDelimiter

getShapeNameDelimiter(self):

Gets ShapeNameDelimiter field. Delimiting character for resolution of shape name clashes.

@return: Value of ShapeNameDelimiter 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]

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. [GLTFExportModelSettings]

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. The base name for all files.

@param stringValue: the new value. [str]

setExistingFiles

setExistingFiles(self, stringValue):

Sets ExistingFiles field. Specifies how files should be written during the export run. The log file will be written anyways.

@param stringValue: the new value ["OVERWRITE", "SKIP"]. [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]

setFileGranularity

setFileGranularity(self, stringValue):

Sets FileGranularity field. Specifies the partition of the generated geometry into files.

@param stringValue: the new value ["MEMORY_BUDGET", "START_SHAPE"]. [str]

setGlobalOffset

setGlobalOffset(self, floatArrayValue):

Sets GlobalOffset field. Global (= for all shapes/models) offset for exported geometry.

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

setIncludeMaterials

setIncludeMaterials(self, booleanValue):

Sets IncludeMaterials field. Exports material definitions (e.g. color, textures, ...).

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

setMemoryBudget

setMemoryBudget(self, intValue):

Sets MemoryBudget field. Specifies the size limit in megabytes per exported file (value 0 = unlimited). Please note: The size is measured on the unoptimized geometry, i.e. the final size may vary. The check is only performed per input shape.

@param intValue: the new value. [int]

setMeshGranularity

setMeshGranularity(self, stringValue):

Sets MeshGranularity field. Specifies the processing of meshes.

@param stringValue: the new value ["AS_GENERATED", "PER_MATERIAL", "INSTANCED"]. [str]

setOutputFormat

setOutputFormat(self, stringValue):

Sets OutputFormat field. Specifies the output glTF format.

@param stringValue: the new value ["GLTF_JSON_WITH_EXTERNAL_DATA", "GLTF_GLB_WITH_SINGLE_BUFFER"]. [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]

setShapeNameDelimiter

setShapeNameDelimiter(self, stringValue):

Sets ShapeNameDelimiter field. Delimiting character for resolution of shape name clashes.

@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]

setWriteLog

setWriteLog(self, booleanValue):

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

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

常量

此类用于定义以下常量:

AS_GENERATED = 'AS_GENERATED'
GLTF_GLB_WITH_SINGLE_BUFFER = 'GLTF_GLB_WITH_SINGLE_BUFFER'
GLTF_JSON_WITH_EXTERNAL_DATA = 'GLTF_JSON_WITH_EXTERNAL_DATA'
INSTANCED = 'INSTANCED'
MEMORY_BUDGET = 'MEMORY_BUDGET'
MODEL_GEOMETRY = 'MODEL_GEOMETRY'
MODEL_GEOMETRY_FALLBACK = 'MODEL_GEOMETRY_FALLBACK'
OVERWRITE = 'OVERWRITE'
PER_MATERIAL = 'PER_MATERIAL'
SHAPE_GEOMETRY = 'SHAPE_GEOMETRY'
SKIP = 'SKIP'
START_SHAPE = 'START_SHAPE'
TERRAIN_ALL = 'TERRAIN_ALL'
TERRAIN_ALL_SELECTED = 'TERRAIN_ALL_SELECTED'
TERRAIN_ALL_VISIBLE = 'TERRAIN_ALL_VISIBLE'
TERRAIN_NONE = 'TERRAIN_NONE'