IO
Python API functions
Read time 7 minutesLast updated 19 hours ago
configureFunctionLogger
io.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
Asset paths
addAssetPaths
Add directory paths to search assets in.
Parameters
Type | Name | Description |
|---|
| StringList | path | The paths to add. |
See also:
clearAssetPaths
Clear all asset paths.
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 |
|---|
| String | filePath | The (relative) file path to search for. |
Returns
Type | Name | Description |
|---|
| String | finalPath | The returned final path. |
See also:
getAssetPaths
Get user defined paths to find assets.
io.getAssetPaths() -> core.StringList
Returns
Type | Name | Description |
|---|
| StringList | assetPaths | The asset paths. |
See also:
setAssetPaths
Replace paths to find assets.
io.setAssetPaths(assetPaths)
Parameters
Type | Name | Description |
|---|
| StringList | assetPaths | The 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 |
|---|
| Part | part | Part to be auto tessellated. |
See also:
exportScene
Export a file.
io.exportScene(fileName, root=0)
Parameters
Type | Name | Description |
|---|
| OutputFilePath | fileName | Path of the file to export. |
| Occurrence | root | Identifier of the root occurrence to export. |
See also:
exportSelection
Export the selection to a file.
io.exportSelection(fileName, keepIntermediaryNodes=False)
Parameters
Type | Name | Description |
|---|
| OutputFilePath | fileName | Path of the file to export. |
| Boolean | keepIntermediaryNodes | If 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 |
|---|
| Bool | forRuntimeOS | Get format for the current OS or for all. |
Returns
Type | Name | Description |
|---|
| FormatList | formats | Formats 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 |
|---|
| Bool | forRuntimeOS | Get format for the current OS or for all. |
Returns
Type | Name | Description |
|---|
| FileFormatList | formats | Formats 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 |
|---|
| Bool | forRuntimeOS | If true, gets formats for the current OS. If false, gets for all supported OSes. |
Returns
Type | Name | Description |
|---|
| FormatList | formats | Formats that can be imported in Pixyz. |
See also:
importFiles
Import files.
io.importFiles(fileNames, root=0) -> scene.OccurrenceList
Parameters
Type | Name | Description |
|---|
| FilesList | fileNames | List of files's paths to import. |
| Occurrence | root | Identifier of the destination occurrence. |
Returns
Type | Name | Description |
|---|
| OccurrenceList | dest | The 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 |
|---|
| FilePath | filename | Path of the file to import. |
| Occurrence | root | Identifier of the destination occurrence. |
Returns
Type | Name | Description |
|---|
| Occurrence | dest | The 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 |
|---|
| String | filePath | The path of the temp file. |
| String | origin | Remote origin of the file. |
| Occurrence | root | Identifier of the destination occurrence. |
Returns
Type | Name | Description |
|---|
| Occurrence | dest | The 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 |
|---|
| FilePath | fileName | Path of the file to import. |
| Occurrence | root | Identifier of the destination occurrence. |
Returns
Type | Name | Description |
|---|
| Occurrence | dest | The 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 |
|---|
| FilePath | fileName | Path of the file to import. |
Returns
See also:
loadReferencedData
Load partial model.
io.loadReferencedData(component, recursively)
Parameters
See also:
unloadReferencedData
Unload partial model.
io.unloadReferencedData(component)
Parameters
See also:
ImportCallbacks
registerIOCallbacks
Register import and export callbacks.
io.registerIOCallbacks(name, importCallback, exportCallback, fileFormats)
Parameters
Point Cloud
splitPointCloud
io.splitPointCloud(files, outputDirectory, minVoxSize, useKDTree, aabb=None, density=-1)
Parameters
Type | Name | Description |
|---|
| FilePathList | files | Path of the point cloud files to process. |
| OutputDirectoryPath | outputDirectory | Output directory. |
| Double | minVoxSize | Size of minimum leaves (mm). |
| Boolean | useKDTree | If true, uses a kd_tree, otherwise, uses an octree. |
| AABB | aabb | Global scene aabb. |
| Double | density | Point 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 |
|---|
| String | extensionName | The name of the extension. |
Returns