Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

IO

Python API functions
Read time 7 minutesLast updated 19 hours ago

configureFunctionLogger

io.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters

Type

Name

Description

StringfunctionName
BooleanenableFunction
BooleanenableParameters
BooleanenableExecutionTime

Asset paths

addAssetPaths

Add directory paths to search assets in.
io.addAssetPaths(path)
Parameters

Type

Name

Description

StringListpathThe paths to add.
See also:

clearAssetPaths

Clear all asset paths.
io.clearAssetPaths()
See also:

findInDirectories

Find the final path. This will search for the file in asset paths.
io.findInDirectories(filePath) -> core.String
Parameters

Type

Name

Description

StringfilePathThe (relative) file path to search for.
Returns

Type

Name

Description

StringfinalPathThe returned final path.
See also:

getAssetPaths

Get user defined paths to find assets.
io.getAssetPaths() -> core.StringList
Returns

Type

Name

Description

StringListassetPathsThe asset paths.
See also:

setAssetPaths

Replace paths to find assets.
io.setAssetPaths(assetPaths)
Parameters

Type

Name

Description

StringListassetPathsThe asset paths.
See also:

Debug

Import/Export

applyAutoTessellate

Handle auto tessellate options on given part, need to be complete.
io.applyAutoTessellate(part)
Parameters

Type

Name

Description

PartpartPart to be auto tessellated.
See also:

exportScene

Export a file.
io.exportScene(fileName, root=0)
Parameters

Type

Name

Description

OutputFilePathfileNamePath of the file to export.
OccurrencerootIdentifier of the root occurrence to export.
See also:

exportSelection

Export the selection to a file.
io.exportSelection(fileName, keepIntermediaryNodes=False)
Parameters

Type

Name

Description

OutputFilePathfileNamePath of the file to export.
BooleankeepIntermediaryNodesIf true, intermerdiary hierarchy is kept.
See also:

getExportFormats

Give all the format name and their extensions that can be exported in Pixyz.
io.getExportFormats(forRuntimeOS=True) -> core.FormatList
Parameters

Type

Name

Description

BoolforRuntimeOSGet format for the current OS or for all.
Returns

Type

Name

Description

FormatListformatsFormats that can be exported in Pixyz.
See also:

getFormatsDescriptions

Give all the formats description that can be imported/exported in Pixyz.
io.getFormatsDescriptions(forRuntimeOS=True) -> io.FileFormatList
Parameters

Type

Name

Description

BoolforRuntimeOSGet format for the current OS or for all.
Returns

Type

Name

Description

FileFormatListformatsFormats that can be imported/exported in Pixyz.
See also:

getImportFormats

Give all the format name and their extensions that can be imported in Pixyz.
io.getImportFormats(forRuntimeOS=True) -> core.FormatList
Parameters

Type

Name

Description

BoolforRuntimeOSIf true, gets formats for the current OS. If false, gets for all supported OSes.
Returns

Type

Name

Description

FormatListformatsFormats that can be imported in Pixyz.
See also:

importFiles

Import files.
io.importFiles(fileNames, root=0) -> scene.OccurrenceList
Parameters

Type

Name

Description

FilesListfileNamesList of files's paths to import.
OccurrencerootIdentifier of the destination occurrence.
Returns

Type

Name

Description

OccurrenceListdestThe root occurrences of each imported file.
See also:

importPicture

Imports a picture and applies is at as a texture on a 3D plane created in the scene.
io.importPicture(filename, root=0) -> scene.Occurrence
Parameters

Type

Name

Description

FilePathfilenamePath of the file to import.
OccurrencerootIdentifier of the destination occurrence.
Returns

Type

Name

Description

OccurrencedestThe root occurrence if defined, otherwise a new occurrence created by the importer.
See also:

importRemote3mxFile

Import a remote 3mx file.
io.importRemote3mxFile(filePath, origin="", root=0) -> scene.Occurrence
Parameters

Type

Name

Description

StringfilePathThe path of the temp file.
StringoriginRemote origin of the file.
OccurrencerootIdentifier of the destination occurrence.
Returns

Type

Name

Description

OccurrencedestThe root occurrence if defined, otherwise a new occurrence created by the importer.
See also:

importScene

Import a file.
io.importScene(fileName, root=0) -> scene.Occurrence
Parameters

Type

Name

Description

FilePathfileNamePath of the file to import.
OccurrencerootIdentifier of the destination occurrence.
Returns

Type

Name

Description

OccurrencedestThe root occurrence if defined, otherwise a new occurrence created by the importer.
See also:

listVariants

List all variants if file.
io.listVariants(fileName) -> io.VariantNameList
Parameters

Type

Name

Description

FilePathfileNamePath of the file to import.
Returns

Type

Name

Description

VariantNameListvariantsList all variants.
See also:

loadReferencedData

Load partial model.
io.loadReferencedData(component, recursively)
Parameters

Type

Name

Description

ReferencedDataComponentcomponentThe component to load.
BoolrecursivelyLoad it recursively or not.
See also:

unloadReferencedData

Unload partial model.
io.unloadReferencedData(component)
Parameters

Type

Name

Description

ReferencedDataComponentcomponentThe component to unload.
See also:

ImportCallbacks

registerIOCallbacks

Register import and export callbacks.
io.registerIOCallbacks(name, importCallback, exportCallback, fileFormats)
Parameters

Type

Name

Description

StringnameCallback name.
importFileCallbackimportCallbackCallback that import a file.
exportFileCallbackexportCallbackCallback that exports to a file.
FileFormatListfileFormatsGives the extension and parameters to Import/Export.

Point Cloud

splitPointCloud

io.splitPointCloud(files, outputDirectory, minVoxSize, useKDTree, aabb=None, density=-1)
Parameters

Type

Name

Description

FilePathListfilesPath of the point cloud files to process.
OutputDirectoryPathoutputDirectoryOutput directory.
DoubleminVoxSizeSize of minimum leaves (mm).
BooleanuseKDTreeIf true, uses a kd_tree, otherwise, uses an octree.
AABBaabbGlobal scene aabb.
DoubledensityPoint cloud density (-1 to compute).

Priorities

getExtensionPriority

Get the priority of an extension from the pixyz importer.
io.getExtensionPriority(extensionName) -> io.PriorityImportLevel
Parameters

Type

Name

Description

StringextensionNameThe name of the extension.
Returns

Type

Name

Description

PriorityImportLevelpriorityThe level of priority of the extension.