Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

Scene

Python API functions
Read time 109 minutesLast updated 19 hours ago

addComponent

Add a component to an occurrence.
scene.addComponent(occurrence, componentType) -> scene.Component
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to add the new component.
ComponentTypecomponentTypeType of the component.
Returns

Type

Name

Description

ComponentcomponentThe new component added to occurrence.

addComponents

Add a components to each occurrence in the array.
scene.addComponents(occurrences, componentType) -> scene.ComponentList
Parameters

Type

Name

Description

OccurrenceListoccurrencesOccurrences that need the component to be added.
ComponentTypecomponentTypeType of the component.
Returns

Type

Name

Description

ComponentListcomponentsComponent that were added or retrieved.

addInParentInstances

Add an instance of prototype's child as child in current occurrence recursively.
scene.addInParentInstances(root)
Parameters

Type

Name

Description

OccurrencerootThe occurrence to test.

cleanUnusedImages

Remove unused images from texture library.
scene.cleanUnusedImages() -> core.Int
Returns

Type

Name

Description

IntnbTextureDeletedThe number of texture deleted by the clean.

cleanUnusedMaterials

Remove unused materials from material library.
scene.cleanUnusedMaterials(cleanImages=False) -> core.Int
Parameters

Type

Name

Description

BooleancleanImagesCall cleanUnusedImages if true.
Returns

Type

Name

Description

IntnbMaterialDeletedThe number of material deleted by the clean.

computeSubTreeChecksum

Compute the checksum of a sub-tree.
scene.computeSubTreeChecksum(root=None) -> core.String
Parameters

Type

Name

Description

OccurrencerootOccurrence to compute.
Returns

Type

Name

Description

Stringchecksum

configureFunctionLogger

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

Type

Name

Description

StringfunctionName
BooleanenableFunction
BooleanenableParameters
BooleanenableExecutionTime

convertMaterialsToColor

Convert all materials to materials with a color pattern, trying to keep the visual aspect as similar as possible.
scene.convertMaterialsToColor(materials=[])
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to merge (merge all materials if empty).

convertMaterialsToPBR

Convert all materials to materials with a PBR pattern, trying to keep the visual aspect as similar as possible.
scene.convertMaterialsToPBR(materials=[])
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to merge (merge all materials if empty).

createOBBMesh

scene.createOBBMesh(occurrence) -> scene.Occurrence
Parameters

Type

Name

Description

Occurrenceoccurrence
Returns

Type

Name

Description

OccurrenceobbOccurrenceThe create occurrence.

createOccurrence

Create a new occurrence.
scene.createOccurrence(name, parent=None) -> scene.Occurrence
Parameters

Type

Name

Description

StringnameName of the new occurrence.
OccurrenceparentCreate the occurrence as a child of parent, if not set the parent will be root.
Returns

Type

Name

Description

OccurrenceoccurrenceCreated occurrence.

createOccurrenceFromSelection

Create a new occurrence and add the given occurrences as children.
scene.createOccurrenceFromSelection(name, children, parent, keepMaterialAssignment=True) -> scene.Occurrence
Parameters

Type

Name

Description

StringnameName of the new occurrence.
OccurrenceListchildrenAdd given occurrence as children (if any).
OccurrenceparentIf defined, the new occurrence will be created as a child of this parent. Else if children are defined, the first common parent of children will be used as a parent for this new occurrence. Last resort will be to use the root as parent.
BooleankeepMaterialAssignmentIf defined, material assignation will be updated to keep the visual same aspect.
Returns

Type

Name

Description

OccurrenceoccurrenceCreated occurrence.

createOccurrenceFromText

Creates an occurrence from string.
scene.createOccurrenceFromText(text, font="ChicFont", fontSize=64, color=None, heigth3D=40) -> scene.Occurrence
Parameters

Type

Name

Description

StringtextThe occurrence's name.
StringfontThe font to use.
IntfontSizeThe font size.
ColorAlphacolorThe occurrence color.
Doubleheigth3D3D height of text.
Returns

Type

Name

Description

Occurrenceoccurrence

createOccurrences

Create one new occurrence under each given parent.
scene.createOccurrences(name, parents=None) -> scene.OccurrenceList
Parameters

Type

Name

Description

StringnameName of the new occurrence.
OccurrenceListparentsCreate the occurrences as a child of each parent. If empty, one occurrence will be created with root as parent.
Returns

Type

Name

Description

OccurrenceListoccurrencesCreated occurrences.

createPartsFromMeshes

Create a set of Parts given meshes and occurrences.
scene.createPartsFromMeshes(occurrences, meshes) -> scene.PartList
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrence which will contains the part component of the mesh at the same index.
MeshListmeshesList of mesh to create part, if the mesh is invalid (e.g 0) no part will be created and 0 will be returned in the parts list at this index.
Returns

Type

Name

Description

PartListpartsList of created parts components, if there is no mesh at an index, no part is created and the identifier is 0.

createSceneFromMeshes

Create a scene tree with a list of meshes, all meshes becomes part occurrences with the same root. The same mesh Id can be used several times to handle create instances (prototypes).
scene.createSceneFromMeshes(meshes, matrices, centerPartPivots=True) -> scene.Occurrence
Parameters

Type

Name

Description

MeshListmeshesList of input meshes.
Matrix4ListmatricesList of matrices of input meshes (if empty Identity will be used).
BooleancenterPartPivotsIf True, the input meshes will be centered in their local coordinate system and the translation will be set as part matrix. If you want to rollback the meshes to their initial pivots use 'resetPartTransform' function.
Returns

Type

Name

Description

OccurrencerootThe created root occurrence.

deleteComponentByType

Delete component from type.
scene.deleteComponentByType(componentType, occurrence, followPrototypes=True)
Parameters

Type

Name

Description

ComponentTypecomponentTypeType of the component.
OccurrenceoccurrenceThe occurrence to remove components from.
BoolfollowPrototypesIf true and if the component is not set on the occurrence, try to find it on its prototyping chain.

deleteComponentsByType

Delete all components on subtree from type.
scene.deleteComponentsByType(componentType, rootOccurrence=None)
Parameters

Type

Name

Description

ComponentTypecomponentTypeType of the component.
OccurrencerootOccurrenceThe root occurrence to remove components from.

deleteEmptyOccurrences

Delete all empty assemblies.
scene.deleteEmptyOccurrences(root=0)
Parameters

Type

Name

Description

OccurrencerootRoot occurrence for the process.

deleteOccurrences

Delete a liste of occurrences.
scene.deleteOccurrences(occurrences)
Parameters

Type

Name

Description

OccurrenceListoccurrencesOccurrences to delete.

generateOctaViews

scene.generateOctaViews(radius, XFrames, YFrames, hemi=False) -> scene.Occurrence
Parameters

Type

Name

Description

Doubleradius
IntXFrames
IntYFrames
Boolhemi
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.

getAABB

Returns the axis aligned bounding box of a list of occurrences.
scene.getAABB(occurrences, precise=False) -> geom.AABB
Parameters

Type

Name

Description

OccurrenceListoccurrencesList of occurrences to retrieve the AABB.
BooleanpreciseIf true, will take more time but returns the minimal AABB and use the current animation pose. If false, fast but the AABB is approximated and multiple rotation matrices in the tree structure may extend it a lot, also the static pose of the meshes will be used.
Returns

Type

Name

Description

AABBaabbThe axis aligned bounding box of all given occurrences.

getActiveMaterial

Get the active material on occurrence.
scene.getActiveMaterial(occurrence) -> material.Material
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

MaterialmaterialThe material.

getActiveMaterials

Get the active materials on multiple occurrences.
scene.getActiveMaterials(occurrences) -> material.MaterialList
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrences to retrieve active material on.
Returns

Type

Name

Description

MaterialListmaterialsThe active material for each given occurrence.

getActivePropertyValue

Get the value of a property on the first parent that own it.
scene.getActivePropertyValue(occurrence, propertyName, cacheProperty=False) -> core.String
Parameters

Type

Name

Description

OccurrenceoccurrenceAn occurrence.
StringpropertyNameProperty name.
BooleancachePropertyIf true, the property will be copied on all ancestor of occurrence below the property owner to speed up future calls.
Returns

Type

Name

Description

StringvalueProperty value.

getActivePropertyValues

Get the value of a property on the first parent that own it for each given occurrence.
scene.getActivePropertyValues(occurrences, propertyName, cacheProperty=False) -> core.StringList
Parameters

Type

Name

Description

OccurrenceListoccurrencesList of occurrences.
StringpropertyNameProperty name.
BooleancachePropertyIf true, the property will be copied on all ancestor of occurrence below the property owner to speed up future calls.
Returns

Type

Name

Description

StringListvaluesProperty value for each occurrence.

getAncestors

Returns the list of ancestors for one occurrence.
scene.getAncestors(occurrence) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to test.
Returns

Type

Name

Description

OccurrenceListancestorListThe list of ancestors.

getBrepShape

Returns the Brep shape of a part.
scene.getBrepShape(part) -> scene.BRepShape
Parameters

Type

Name

Description

PartpartThe Part.
Returns

Type

Name

Description

BRepShapebrepShapeThe brep shape of the part.

getComponent

Returns a component on an occurrence.
scene.getComponent(occurrence, componentType, followPrototypes=True) -> scene.Component
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
ComponentTypecomponentTypeType of the component.
BoolfollowPrototypesIf true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns

Type

Name

Description

ComponentcomponentThe component.

getComponentByOccurrence

Returns one component of the specified type by occurrence if it exists.
scene.getComponentByOccurrence(occurrences, componentType, followPrototypes=True) -> scene.ComponentList
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrences list.
ComponentTypecomponentTypeType of the component.
BoolfollowPrototypesIf true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns

Type

Name

Description

ComponentListcomponentsList of component synchronized with occurrences.

getComponentOccurrence

Get the occurrence that own a component.
scene.getComponentOccurrence(component) -> scene.Occurrence
Parameters

Type

Name

Description

ComponentcomponentThe component.
Returns

Type

Name

Description

OccurrenceoccurrenceThe occurrence.

getComponentType

Get the type of a component.
scene.getComponentType(component) -> scene.ComponentType
Parameters

Type

Name

Description

ComponentcomponentThe component.
Returns

Type

Name

Description

ComponentTypecomponentTypeType of the component.

getComponents

Returns one component of the specified type by occurrence if it exists.
scene.getComponents(occurrences, componentType, followPrototypes=True) -> scene.ComponentList
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrences list.
ComponentTypecomponentTypeType of the component.
BoolfollowPrototypesIf true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns

Type

Name

Description

ComponentListcomponentsList of component synchronized with occurrences.

getGlobalMatrices

Returns the global matrix for each given occurrence.
scene.getGlobalMatrices(occurrences) -> geom.Matrix4List
Parameters

Type

Name

Description

OccurrenceListoccurrencesNodes to get the local matrix.
Returns

Type

Name

Description

Matrix4ListmatricesThe global matrix for each given node.

getGlobalMatrix

Returns the global matrix on an occurrence.
scene.getGlobalMatrix(occurrence) -> geom.Matrix4
Parameters

Type

Name

Description

OccurrenceoccurrenceOccurrence to get the global matrix.
Returns

Type

Name

Description

Matrix4matrixThe global matrix of the occurrence.

getGlobalVisibility

Returns the global visibility of a given occurrence.
scene.getGlobalVisibility(occurrence) -> core.Boolean
Parameters

Type

Name

Description

OccurrenceoccurrenceOccurrence to get the global visibility.
Returns

Type

Name

Description

BooleanvisibleTrue if the occurrence is visible, else False.

getLocalMatrices

Returns the local matrix for each given occurrence.
scene.getLocalMatrices(occurrences) -> geom.Matrix4List
Parameters

Type

Name

Description

OccurrenceListoccurrencesNodes to get the local matrix.
Returns

Type

Name

Description

Matrix4ListmatricesThe local matrix for each given node.

getLocalMatrix

Returns the local matrix on an occurrence.
scene.getLocalMatrix(occurrence) -> geom.Matrix4
Parameters

Type

Name

Description

OccurrenceoccurrenceNode to get the local matrix.
Returns

Type

Name

Description

Matrix4matrixThe node local matrix.

getMBB

Returns the Minimum Bounding Box of a list of occurrences.
scene.getMBB(occurrences, forcedAxis=geom.Vector3(0,0,0)) -> geom.MBB
Parameters

Type

Name

Description

OccurrenceListoccurrencesList of occurrences to retrieve the MBB.
Vector3forcedAxisForced axis of the mbb.
Returns

Type

Name

Description

MBBmbbThe minimum bounding box of all given occurrences.

getMaterialsFromSubtree

scene.getMaterialsFromSubtree(occurrence) -> material.MaterialList
Parameters

Type

Name

Description

OccurrenceoccurrenceRoot occurrence of the subtree on which to get the materials and images.
Returns

Type

Name

Description

MaterialListmaterialsThe retrieved materials.

getOBB

Returns the Oriented Bounding Box of a list of occurrences (works only on meshes, fast method, not the Minimum Volume Box).
scene.getOBB(occurrences) -> geom.OBB
Parameters

Type

Name

Description

OccurrenceListoccurrencesList of occurrences to retrieve the OBB.
Returns

Type

Name

Description

OBBobbThe oriented bounding box of all given occurrences.

getOccurrenceActiveMaterial

Returns the active material on a given occurrence.
scene.getOccurrenceActiveMaterial(occurrence) -> material.Material
Parameters

Type

Name

Description

OccurrenceoccurrenceOccurrence to get the active material.
Returns

Type

Name

Description

MaterialmaterialThe active material of the occurrence.

getOccurrenceName

Returns the name of an occurrence.
scene.getOccurrenceName(occurrence) -> core.String
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to get the name.
Returns

Type

Name

Description

StringnameThe occurrence name.

getOccurrencesWithComponent

Recursively get all the occurrences containing a component of the specified type.
scene.getOccurrencesWithComponent(componentType, fromOcc=None) -> scene.OccurrenceList
Parameters

Type

Name

Description

ComponentTypecomponentTypeThe component type.
OccurrencefromOccSource occurrence of the recursion.
Returns

Type

Name

Description

OccurrenceListoccurrencesResult occurrences.

getPartActiveShape

Returns the active shape of a part.
scene.getPartActiveShape(part) -> scene.Shape
Parameters

Type

Name

Description

PartpartThe part.
Returns

Type

Name

Description

ShapeshapeThe active shape of a part.

getPartOccurrences

Recursively get all the occurrences containing a part component.
scene.getPartOccurrences(fromOcc=None) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrencefromOccSource occurrence of the recursion.
Returns

Type

Name

Description

OccurrenceListoccurrencesResult occurrences.

getPartShapeType

Get the part's shape type.
scene.getPartShapeType(part) -> scene.ShapeType
Parameters

Type

Name

Description

PartpartThe part to test.
Returns

Type

Name

Description

ShapeTypeshapeTypeShape's type.

getPolygonCount

Returns the number of polygon in the parts meshes.
scene.getPolygonCount(occurrences, asTriangleCount=False, countOnceEachInstance=False, countHidden=False) -> core.ULong
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe part occurrences.
BoolasTriangleCountIf true count the equivalent of triangles for each polygon.
BoolcountOnceEachInstanceIf true ignore multiple instance of each tessellation.
BoolcountHiddenIf true, also count hidden components.
Returns

Type

Name

Description

ULongpolygonCountThe number of polygons.

getSubTreeStats

Returns some stats of a sub tree.
scene.getSubTreeStats(roots) -> core.ULong, core.ULong, core.ULong, core.ULong, core.ULong, core.ULong, core.ULong, core.ULong, core.ULong, core.ULong, core.ULong
Parameters

Type

Name

Description

OccurrenceListrootsThe root occurrences to get stats on.
Returns

Type

Name

Description

ULongpartCountNumber of parts in the sub-tree (instances are counted once).
ULongpartOccurrenceCountNumber of part occurrence in the sub-tree (instances are counted multiple times).
ULongtriangleCountNumber of triangles in the sub-tree (instances are counted once, quadrangle count for 2 triangles).
ULongtriangleOccurrenceCountNumber of triangles in the sub-tree (instances are counted multiples times, quadrangle count for 2 triangles).
ULongvertexCountNumber of surfacic vertices in the sub-tree (instances are counted once).
ULongvertexOccurrenceCountNumber of surfacic vertices in the sub-tree (instances are counted multiples times).
ULongpointCountNumber of free vertices (points) in the sub-tree (instances are counted once).
ULongpointOccurrenceCountNumber of free vertices (points) in the sub-tree (instances are counted multiples times).
ULonglineCountNumber of free edges (line) in the sub-tree (instances are counted once).
ULonglineOccurrenceCountNumber of free edges (line) in the sub-tree (instances are counted multiples times).
ULongpatchesCountNumber of patches in the sub-tree (instances are counted multiples times).

getVertexCount

Returns the number of vertices in the parts meshes.
scene.getVertexCount(occurrences, countOnceEachInstance=False, countHidden=False, countPoints=False, countMergedVertices=False) -> core.ULong
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe part occurrences.
BoolcountOnceEachInstanceIf true ignore multiple instance of each tessellation.
BoolcountHiddenIf true, also count hidden components.
BoolcountPointsIf true, also count points (for points cloud).
BoolcountMergedVerticesIf true count all merged vertices in each tessellation.
Returns

Type

Name

Description

ULongvertexCountThe number of vertices.

getViewpointsFromCavities

Returns viewpoints from model cavities.
scene.getViewpointsFromCavities(voxelSize, minCavityVolume) -> geom.Point3List, geom.Point3List
Parameters

Type

Name

Description

DistancevoxelSizePrecision for cavities detection.
DistanceminCavityVolumeMinimum volume for a cavity to be returned.
Returns

Type

Name

Description

Point3ListpositionsList of viewpoint positions.
Point3ListdirectionsList of viewpoint directions.

getVolume

Return the volume of the occurrence.
scene.getVolume(occurrence) -> core.Double
Parameters

Type

Name

Description

OccurrenceoccurrenceEntry occurrence.
Returns

Type

Name

Description

DoublevolumeThe computed volume.

getVolumes

Return the volume of a set of root occurrences.
scene.getVolumes(iRoots) -> core.DoubleList
Parameters

Type

Name

Description

OccurrenceListiRootsList of roots.
Returns

Type

Name

Description

DoubleListvolumesThe computed volumes.

hasComponent

Returns True if the given occurrence has the given component type.
scene.hasComponent(occurrence, componentType, followPrototypes=True) -> core.Boolean
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
ComponentTypecomponentTypeType of the component.
BoolfollowPrototypesIf true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns

Type

Name

Description

BooleanhasComp

hide

Hide the given occurrences.
scene.hide(occurrences)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe list of occurrences to hide.

inverseVisibility

Inverse the visibility of the given occurrences.
scene.inverseVisibility(occurrences)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe list of occurrences.

isAncestorOf

Test if an occurrence is an ancestor of another one.
scene.isAncestorOf(maybeAncestor, occurrence) -> core.Bool
Parameters

Type

Name

Description

OccurrencemaybeAncestorThe potential ancestor of the occurrence.
OccurrenceoccurrenceThe occurrence to test.
Returns

Type

Name

Description

BoolisAncestorIf occurrences are ancestor to one another.

keepAncestors

Filter a list of occurrences by removing all occurrences which have an ancestor inside the list.
scene.keepAncestors(occurrences) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe list that shall be filtered.
Returns

Type

Name

Description

OccurrenceListfilteredListThe list without descendants of members.

listComponent

List all components on a type on the whole tree.
scene.listComponent(componentType) -> scene.ComponentList
Parameters

Type

Name

Description

ComponentTypecomponentTypeThe component type.
Returns

Type

Name

Description

ComponentListcomponentsThe component list of the type chosen.

listComponents

List all components on an occurrence.
scene.listComponents(occurrence, followPrototypes=True) -> scene.ComponentList
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to list the components.
BoolfollowPrototypesIf true list also components owned by the prototype.
Returns

Type

Name

Description

ComponentListcomponentsThe components owned by the occurrence.

mergeImages

Merge all equivalent images (i.e. with same pixels).
scene.mergeImages(images=[]) -> core.Int
Parameters

Type

Name

Description

ImageListimagesImages to merge (merge all images if empty).
Returns

Type

Name

Description

IntnbTextureThe number of texture after the merge.

mergeMaterials

Merge all equivalent materials (i.e. with same appearance).
scene.mergeMaterials(materials=[], evaluateNames=False) -> core.Int
Parameters

Type

Name

Description

MaterialListmaterialsMaterials to merge (merge all materials if empty).
BooleanevaluateNamesIf true, materials names will be taken into consideration (on top of other properties). It means that materials having same properties but different names won't be merged together.
Returns

Type

Name

Description

IntnbMaterialThe number of material after the merge.

removeMaterials

Recursively remove all materials.
scene.removeMaterials(roots=None)
Parameters

Type

Name

Description

OccurrenceListrootsIf specified, remove materials only from the given occurrences and their descendants.

renameLongOccurrenceName

Truncate names of occurrence with too long names.
scene.renameLongOccurrenceName(maxLength=128)
Parameters

Type

Name

Description

IntmaxLengthMaximum name length.

replaceMaterial

Replace a material by another everywhere it is used.
scene.replaceMaterial(originalMaterial, newMaterial, occurrences=None)
Parameters

Type

Name

Description

MaterialoriginalMaterialThe material to replace everywhere.
MaterialnewMaterialThe new material to set in place of originalMaterial.
OccurrenceListoccurrencesThe occurrences on which replacing the materials.

resizeTextures

Resizes the textures from a selection of occurrences (resizes all textures used by these occurrences), or from a selection of textures.
scene.resizeTextures(inputMode, resizeMode, replaceTextures=True)
Parameters

Type

Name

Description

ResizeTexturesInputModeinputModeDefines if the textures to resize are textures used by a selection of Occurrences, or a selection among the textures available in the scene.
ResizeTexturesResizeModeresizeModeDefines if the textures are resized following a ratio or following a maximum size/resolution (only textures above the defined maximum are downsized).
BoolreplaceTexturesIf True, overwrites textures from the selection.

setComponentOccurrence

Move a component to an occurrence.
scene.setComponentOccurrence(component, occurrence)
Parameters

Type

Name

Description

ComponentcomponentThe component.
OccurrenceoccurrenceThe occurrence.

setDefaultVariant

Set the default variant.
scene.setDefaultVariant()

setOccurrenceMaterial

Set the material on a occurrence.
scene.setOccurrenceMaterial(occurrence, material)
Parameters

Type

Name

Description

OccurrenceoccurrenceOccurrence to set the material.
MaterialmaterialThe new occurrence material.

setOccurrenceName

Returns the name of an occurrence.
scene.setOccurrenceName(occurrence, name)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to get the name.
StringnameThe occurrence name.

show

Show the given occurrences.
scene.show(occurrences)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe list occurrences to show.

showOnly

Show only the given occurrences.
scene.showOnly(occurrences)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe list occurrences to show.

transferCADMaterialsOnPartOccurrences

Set all materials on part occurrences.
scene.transferCADMaterialsOnPartOccurrences(rootOccurrence=None)
Parameters

Type

Name

Description

OccurrencerootOccurrenceRoot occurrence.

transferMaterialsOnPatches

Take the first instance material and set it one the mesh patches.
scene.transferMaterialsOnPatches(rootOccurrence=None)
Parameters

Type

Name

Description

OccurrencerootOccurrenceRoot occurrence.

Clustering

createHierarchicalClusters

Reorganize a sub tree with hierarchical clustering.
scene.createHierarchicalClusters(root, childrenCountByNode=2, minFitting=-1) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrencerootRoot of the sub-tree to reorganize.
IntchildrenCountByNodeOrder of the hierarchical tree.
CoeffminFittingMinimal fitting coefficient to allow 2 nodes to be merged/clustered.
Returns

Type

Name

Description

OccurrencerootHierarchical clustering root.
See also:

generateOctree

Generate a loose octree from the given sub-tree.
scene.generateOctree(occurrence, maxDepth=5, looseFactor=2) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceRoot occurrence of the sub-tree.
IntmaxDepthDefines the depth maximum of the octree.
DoublelooseFactorDefines the loose factor of the octree.
Returns

Type

Name

Description

OccurrencerootOctreeId
See also:

getClusters

Get groups of occurrences based on spatial proximity.
scene.getClusters(occurrences, strategy) -> scene.OccurrenceListList
Parameters

Type

Name

Description

OccurrenceListoccurrencesInput occurrences.
MergeByRegionsStrategystrategyNumber: number of groups
Returns

Type

Name

Description

OccurrenceListListclustersGroups of occurrences.
See also:

getPartOccurrencesGroupedBySimilarity

Get groups of occurrences based on various criteria (see parameters). Returns a list of groups ; each group is either a list of parts considered similar (depending on criteria) or is a singleton that has no similar parts.
scene.getPartOccurrencesGroupedBySimilarity(root=0, acceptVolumeRatio=0.01, acceptPolycountRatio=0.1, acceptAABBAxisRatio=0.01, acceptAABBCenterDistance=0.1) -> scene.OccurrenceListList
Parameters

Type

Name

Description

OccurrencerootRoot occurrence for the process.
RealacceptVolumeRatioIf the ratio of volumes of two parts is lower than acceptVolumeRatio, they will be considered duplicated.
RealacceptPolycountRatioIf the ratio of polygon counts of two parts is lower than acceptPolycountRatio, they will be considered duplicated.
RealacceptAABBAxisRatioIf the ratio of AABB axis of two parts is lower than acceptAABBAxisRatio, they will be considered duplicated.
DistanceacceptAABBCenterDistanceIf the distance between AABB centers of two parts is lower than acceptAABBCenterDistance, they will be considered duplicated.
Returns

Type

Name

Description

OccurrenceListListpartOccurrencesGroupedBySimilarityAll part occurrences grouped by similarity: each element in the list is a list of similar parts (as defined by parameters) or a singleton having no similar parts.
See also:

Create primitives

createCapsule

Create a new capsule.
scene.createCapsule(radius=250, height=250, subdivisionLatitude=16, subdivisionLongitude=16, generateUV=True) -> scene.Occurrence
Parameters

Type

Name

Description

DoubleradiusRadius of the Capsule.
DoubleheightHeight of the Capsule (excluding the two size of half spheres).
IntsubdivisionLatitudeSubdivision of the Capsule on the Latitude.
IntsubdivisionLongitudeSubdivision of the Capsule (two half spheres) on the Longitude.
BooleangenerateUVGeneration of the UV.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

createCone

Create a new cone.
scene.createCone(bottomRadius=250, height=500, sides=16, generateUV=True) -> scene.Occurrence
Parameters

Type

Name

Description

DoublebottomRadiusRadius of the bottom of the cone .
DoubleheightHeight of the cone.
IntsidesNumber of sides of the cone.
BooleangenerateUVGeneration of the UV.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

createCube

Create a new cube.
scene.createCube(sizeX=1000, sizeY=1000, sizeZ=1000, subdivision=1, generateUV=True) -> scene.Occurrence
Parameters

Type

Name

Description

DoublesizeXSize of the Cube on the x axis.
DoublesizeYSize of the Cube on the y axis.
DoublesizeZSize of the Cube on the z axis.
IntsubdivisionSubdivision of the Cube on all the axis.
BooleangenerateUVGeneration of the UV.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

createCylinder

Create a new cylinder.
scene.createCylinder(radius=250, height=1000, sides=16, generateUV=True) -> scene.Occurrence
Parameters

Type

Name

Description

DoubleradiusRadius of the Cylinder.
DoubleheightHeight of the Cylinder.
IntsidesNumber of Sides of the Cylinder.
BooleangenerateUVGeneration of the UV.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

createImmersion

Create a new bagel klein.
scene.createImmersion(radius=2.5, subdivisionX=100, subdivisionY=15) -> scene.Occurrence
Parameters

Type

Name

Description

DoubleradiusRadius of the Immersion.
IntsubdivisionXSubdivision of the Immersion on the Latitude.
IntsubdivisionYSubdivision of the Immersion on the Longitude.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

createPlane

Create a new plane.
scene.createPlane(sizeX=1000, sizeY=1000, subdivisionX=1, subdivisionY=1, generateUV=True) -> scene.Occurrence
Parameters

Type

Name

Description

DoublesizeXSize of the Plane on the x axis.
DoublesizeYSize of the Plane on the y axis.
IntsubdivisionXSubdivision of the Plane on the x axis.
IntsubdivisionYSubdivision of the Plane on the y axis.
BooleangenerateUVGeneration of the UV.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

createSphere

Create a new sphere.
scene.createSphere(radius=500, subdivisionLatitude=16, subdivisionLongitude=16, generateUV=True) -> scene.Occurrence
Parameters

Type

Name

Description

DoubleradiusRadius of the Sphere.
IntsubdivisionLatitudeSubdivision of the Sphere on the Latitude.
IntsubdivisionLongitudeSubdivision of the Sphere on the Longitude.
BooleangenerateUVGeneration of the UV.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

createTorus

Create a new torus.
scene.createTorus(majorRadius=250, minorRadius=75, subdivisionLatitude=16, subdivisionLongitude=16, generateUV=True) -> scene.Occurrence
Parameters

Type

Name

Description

DoublemajorRadiusMajor Radius.
DoubleminorRadiusMinor Radius.
IntsubdivisionLatitudeSubdivision of the Torus on the Latitude.
IntsubdivisionLongitudeSubdivision of the Torus on the Longitude.
BooleangenerateUVGeneration of the UV.
Returns

Type

Name

Description

OccurrenceoccurrenceThe created Occurrence.
See also:

FindBy

findDuplicatedPartOccurrences

Get parts that are duplicated. This does not include each first occurrence of a set of duplicates.
scene.findDuplicatedPartOccurrences(root=0, acceptVolumeRatio=0.01, acceptPolycountRatio=0.1, acceptAABBAxisRatio=0.01, acceptAABBCenterDistance=0.1) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrencerootRoot occurrence.
RealacceptVolumeRatioIf the ratio of volumes of two parts is lower than acceptVolumeRatio, they will be considered duplicated.
RealacceptPolycountRatioIf the ratio of polygon counts of two parts is lower than acceptPolycountRatio, they will be considered duplicated.
RealacceptAABBAxisRatioIf the ratio of AABB axis of two parts is lower than acceptAABBAxisRatio, they will be considered duplicated.
DistanceacceptAABBCenterDistanceIf the distance between AABB centers of two parts is lower than acceptAABBCenterDistance, they will be considered duplicated.
Returns

Type

Name

Description

OccurrenceListduplicatedPartOccurrencesThe duplicated part occurrences. Contains only the duplicates: it excludes the first occurrence of each set of duplicates.
See also:

findOccurrencesByMaterial

Get occurrences for which the property "Material" is the given material.
scene.findOccurrencesByMaterial(material) -> scene.OccurrenceList
Parameters

Type

Name

Description

MaterialmaterialA material.
Returns

Type

Name

Description

OccurrenceListfilteredThe list of occurrences meeting the criteria.
See also:

findOccurrencesByMetadata

Returns all occurrences which a metadata property value matches the given regular expression (ECMAScript).
scene.findOccurrencesByMetadata(property, regex, roots=None, caseInsensitive=False) -> scene.OccurrenceList
Parameters

Type

Name

Description

StringpropertyProperty name.
RegexregexRegular expression (ECMAScript).
OccurrenceListrootsIf specified, restrict the search from the given roots.
BoolcaseInsensitiveIf True, the regex will be insensitive to upper and lower cases.
Returns

Type

Name

Description

OccurrenceListoccurrencesOccurrences which matches the given regular expression.
See also:

findOccurrencesByMetadataValue

Returns all occurrences with a metadata value matching the given regular expression (ECMAScript).
scene.findOccurrencesByMetadataValue(regex, roots=None, caseInsensitive=False) -> scene.OccurrenceList
Parameters

Type

Name

Description

RegexregexRegular expression (ECMAScript).
OccurrenceListrootsIf specified, restrict the search from the given roots.
BoolcaseInsensitiveIf True, the regex will be insensitive to upper and lower cases.
Returns

Type

Name

Description

OccurrenceListoccurrencesOccurrences which matches the given regular expression.
See also:

findOccurrencesByProperty

Returns all occurrences which a property value matches the given regular expression (ECMAScript).
scene.findOccurrencesByProperty(property, regex, roots=None, caseInsensitive=False) -> scene.OccurrenceList
Parameters

Type

Name

Description

StringpropertyProperty name.
RegexregexRegular expression (ECMAScript).
OccurrenceListrootsIf specified, restrict the search from the given roots.
BoolcaseInsensitiveIf True, the regex will be insensitive to upper and lower cases.
Returns

Type

Name

Description

OccurrenceListoccurrencesOccurrences which matches the given regular expression.
See also:

findPartOccurrencesByActiveMaterial

Find all part occurrence with a given material as active material (i.e. as seen in the rendering).
scene.findPartOccurrencesByActiveMaterial(material, roots=None) -> scene.OccurrenceList
Parameters

Type

Name

Description

MaterialmaterialA material.
OccurrenceListrootsIf specified, restrict the search from the given roots.
Returns

Type

Name

Description

OccurrenceListoccurrenceOccurrences of parts with the given material as active material.
See also:

findPartOccurrencesByMaximumSize

Get part occurrences by size.
scene.findPartOccurrencesByMaximumSize(roots, maxDiagLength=150, maxSize=-1, getHidden=False) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListrootsRoots occurrences for the process.
DistancemaxDiagLengthIf the diagonal axis of the bounding box is less than maxDiagLength, part will be filtered. -1 to ignore.
DistancemaxSizeIf the longer axis of the box is less than maxLength, part will be filtered. -1 to ignore.
BooleangetHiddenIf true, hidden part occurrences meeting the criteria will be filtered as well.
Returns

Type

Name

Description

OccurrenceListfilteredThe list of occurrences meeting the criteria.
See also:

findPartOccurrencesByMinimumNumberOfInstances

Get part occurrences with more than "minInstanciationCount" occurrence on the scene.
scene.findPartOccurrencesByMinimumNumberOfInstances(minInstanciationCount=2) -> scene.OccurrenceList
Parameters

Type

Name

Description

IntminInstanciationCountMin occurrence count.
Returns

Type

Name

Description

OccurrenceListfilteredThe list of occurrences meeting the criteria.
See also:

findPartOccurrencesByVisibleMaterial

Get part occurrences for which the given material is visible in the viewer.
scene.findPartOccurrencesByVisibleMaterial(material) -> scene.OccurrenceList
Parameters

Type

Name

Description

MaterialmaterialA material.
Returns

Type

Name

Description

OccurrenceListfilteredThe list of occurrences meeting the criteria.
See also:

FindIn

findPartOccurrencesInAABB

Find part occurrences in the scene in a given axis aligned bounding box.
scene.findPartOccurrencesInAABB(aabb) -> scene.OccurrenceList
Parameters

Type

Name

Description

AABBaabbThe axis aligned bounding box.
Returns

Type

Name

Description

OccurrenceListoccurrencesOccurrences found in the given axis aligned bounded box.
See also:

findPartOccurrencesInBox

Get part occurrences contained in a given box.
scene.findPartOccurrencesInBox(box, strictlyIncludes) -> scene.OccurrenceList
Parameters

Type

Name

Description

ExtendedBoxboxThe extension box.
BooleanstrictlyIncludesIf false, parts only need to intersect the box to be selected.
Returns

Type

Name

Description

OccurrenceListoccurrencesPart occurrences contained in the box.
See also:

Hierarchy

createSubTree

Create a complete scene tree.
scene.createSubTree(tree, root=0, replaceRoot=True) -> scene.OccurrenceList
Parameters

Type

Name

Description

PackedTreetree
OccurrencerootSpecify the root occurrence of the scene.
BoolreplaceRootIf true, the root occurrence will be replaced by the root of the given tree, else it will be added as a child.
Returns

Type

Name

Description

OccurrenceListoccurrencesCreate occurrences (equivalent to tree.occurrences).
See also:

getChildren

Get the children of an occurrence.
scene.getChildren(occurrence) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

OccurrenceListchildrenChildren occurrences.
See also:

getChildrenCount

Get the children count of an occurrence.
scene.getChildrenCount(occurrence) -> core.Int
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

IntchildrenCountChildren count.
See also:

getCurrentVariantRoot

Get the current active root. Returns active variant's root if one or global root.
scene.getCurrentVariantRoot() -> scene.Occurrence
Returns

Type

Name

Description

OccurrencerootThe active variant root occurrence or global root if no active variant.
See also:

getFirstChild

Get the children of an occurrence.
scene.getFirstChild(occurrence) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

OccurrencechildChild occurrence.
See also:

getNextSibling

Get the next occurrence in parent children.
scene.getNextSibling(occurrence) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

OccurrencenextSiblingNext sibling occurrence.
See also:

getOccurrenceAncestors

Get all ancestors from occurrence until root (occurrence is not included).
scene.getOccurrenceAncestors(occurrence) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to find ancestors.
Returns

Type

Name

Description

OccurrenceListancestorsList of ancestors (start with the root and end with occurrence parent). Empty if occurrence is a root.
See also:

getOccurrencesAncestors

Batch version of getOccurrenceAncestors.
scene.getOccurrencesAncestors(occurrences) -> scene.OccurrenceListList
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe list of occurrences to find ancestors.
Returns

Type

Name

Description

OccurrenceListListancestorsListFor each given occurrence, the list of ancestors (start with the root and end with occurrence parent). Empty if occurrence is a root.
See also:

getParent

Get the parent of an occurrence.
scene.getParent(occurrence) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

OccurrenceparentThe parent occurrence.
See also:

getPreviousSibling

Get the previous occurrence in parent children.
scene.getPreviousSibling(occurrence) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

OccurrencepreviousSiblingPrevious sibling occurrence.
See also:

getRoot

Get the root occurrence of the product structure.
scene.getRoot() -> scene.Occurrence
Returns

Type

Name

Description

OccurrencerootThe root occurrence.
See also:

getSubTree

Returns a packed version of the whole scene tree.
scene.getSubTree(root=0, visibilityMode=1, depth=-1) -> scene.PackedTree
Parameters

Type

Name

Description

OccurrencerootSpecify the root of the returned scene.
VisibilityModevisibilityModeThe visibility mode.
IntdepthMaximum depth.
Returns

Type

Name

Description

PackedTreetree
See also:

moveOccurrences

Move an occurrence, adjusting the transformation to keep objects at the same place in the world space.
scene.moveOccurrences(occurrences, destination, insertBefore=0)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrences to move.
OccurrencedestinationDestination occurrence (the new parent).
OccurrenceinsertBeforeOccurrence before witch to move, if null append to destination children.
See also:

setParent

Set the parent of an occurrence.
scene.setParent(occurrence, parent, addInParentInstances=False, insertBefore=None, worldPositionStays=False)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
OccurrenceparentThe parent occurrence.
BooleanaddInParentInstancesIf True, each occurrence whose prototype is the target parent will generate a child whose prototype is the occurrence itself.
OccurrenceinsertBeforeAdd before this child occurrence in the children list of the parent occurrence.
BooleanworldPositionStaysIf true, the parent-relative position, scale and rotation are modified such that the object keeps the same world space position, rotation and scale as before.
See also:

Lights

addLightComponent

Add a light component to an occurrence.
scene.addLightComponent(occurrence, lightType, color=core.Color(1,1,1,1), power=1.0, cutOff=20.0) -> scene.Component
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to add the new component.
LightTypelightTypeThe type of the light.
ColorcolorColor of the light.
DoublepowerThe power of the light.
AnglecutOffThe cutoff angle of the light.
Returns

Type

Name

Description

ComponentcomponentThe new component added to occurrence.
See also:

createLight

Create an occurrence with a light component.
scene.createLight(name, lightType, color=core.Color(1,1,1,1), power=1.0, cutOff=20.0, parent=0) -> scene.Occurrence
Parameters

Type

Name

Description

StringnameName of the light.
LightTypelightTypeThe type of the light.
ColorcolorColor of the light.
DoublepowerThe power of the light.
AnglecutOffThe cutoff angle of the light.
OccurrenceparentThe parent of the light occurrence.
Returns

Type

Name

Description

OccurrenceoccurrenceThe light created.
See also:

Metadata

addMetadata

Add a new metadata property to a metadata component.
scene.addMetadata(metadata, name, value)
Parameters

Type

Name

Description

MetadatametadataThe metadata component.
StringnameThe new property name.
StringvalueThe new property value.
See also:

addMetadataBlock

Add a new metadata property to a metadata component.
scene.addMetadataBlock(metadata, names, values)
Parameters

Type

Name

Description

MetadatametadataThe metadata component.
StringListnamesThe new properties names.
StringListvaluesThe new properties values.
See also:

createMetadatasFromDefinitions

Create Metadata components from definitions.
scene.createMetadatasFromDefinitions(occurrences, definitions) -> scene.MetadataList
Parameters

Type

Name

Description

OccurrenceListoccurrencesList of occurrences to add the metadata components.
MetadataDefinitionListdefinitionsList of metadata definition.
Returns

Type

Name

Description

MetadataListmetadatasList of metadata components created from definitions (if definition is empty no component is created).
See also:

getMetadata

Get a metadata property value from a metadata component.
scene.getMetadata(metadata, name) -> core.String
Parameters

Type

Name

Description

MetadatametadataThe metadata component.
StringnameThe metadata property name.
Returns

Type

Name

Description

StringcomponentThe property value.
See also:

getMetadatasDefinitions

Returns definition of Metadata components.
scene.getMetadatasDefinitions(metadatas) -> scene.MetadataDefinitionList
Parameters

Type

Name

Description

MetadataListmetadatasList of metadata component to retrieve definition.
Returns

Type

Name

Description

MetadataDefinitionListdefinitionsList of metadata definition for each given metadata component.
See also:

removeMetadata

Remove a property from a metadata.
scene.removeMetadata(metadata, name)
Parameters

Type

Name

Description

MetadatametadataThe occurrence.
StringnameThe name of the property.
See also:

Subpart materials

getSubpartMaterial

Get a subpart material assignment according to overrides on the scene tree with SubpartMaterial components.
scene.getSubpartMaterial(occurrence, subpartIndex) -> material.Material
Parameters

Type

Name

Description

OccurrenceoccurrenceThe Occurrence.
UIntsubpartIndexThe subpart index.
Returns

Type

Name

Description

MaterialmaterialThe assigned material.
See also:

listActiveShapeMaterials

List all the materials used in the part shape.
scene.listActiveShapeMaterials(part) -> material.MaterialList
Parameters

Type

Name

Description

PartpartThe part which contains sub materials.
Returns

Type

Name

Description

MaterialListmaterialsUsed materials.
See also:

listSubpartMaterials

List all the materials used in the part shape or overrided with a SubpartMaterial component.
scene.listSubpartMaterials(occurrence) -> material.MaterialList
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence which contains sub materials.
Returns

Type

Name

Description

MaterialListmaterialsUsed materials.
See also:

listSubpartVariantMaterials

List all the materials variants in subpart .
scene.listSubpartVariantMaterials(occurrence) -> scene.VariantMaterialList
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence which contains variants.
Returns

Type

Name

Description

VariantMaterialListvariantMaterialsList of variant and materials.
See also:

setSubpartMaterial

Set a subpart material assignment using a SubpartMaterial component.
scene.setSubpartMaterial(occurrence, subpartIndex, material)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe Occurrence.
UIntsubpartIndexThe subpart index.
MaterialmaterialThe material.
See also:

setSubpartMaterials

Set multiple subpart materials at once using a SubpartMaterial component.
scene.setSubpartMaterials(occurrence, materials, startIndex=0)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe Occurrence on which to apply the materials.
MaterialListmaterialsMaterials to set.
UIntstartIndexThe subpart start index.
See also:

setSubpartVariantMaterials

Set materials in variant .
scene.setSubpartVariantMaterials(occurrence, variantMaterials)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence which contains variants.
VariantMaterialListvariantMaterialsList of variant and materials.
See also:

setSubpartVariantMaterialsList

Set all the materials list in variants .
scene.setSubpartVariantMaterialsList(variants, materialListList) -> scene.VariantMaterialList
Parameters

Type

Name

Description

VariantListvariantsThe part which contains variants.
MaterialListListmaterialListListThe part which contains the list of material variant list.
Returns

Type

Name

Description

VariantMaterialListmaterialsVariantList of variant and materials.
See also:

transferSubpartMaterialsOnPatches

Assign SubpartMaterialComponent materials on the occurrence's part shapes. This might affect other Part in the scene if not singularized before.
scene.transferSubpartMaterialsOnPatches(occurrence)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence which has sub materials assigned.
See also:

alternative trees

createAlternativeTree

Create a new alternative tree.
scene.createAlternativeTree(name, root=None) -> scene.AlternativeTree
Parameters

Type

Name

Description

StringnameThe name of the new alternative tree.
OccurrencerootThe root occurrence.
Returns

Type

Name

Description

AlternativeTreetreeThe new alternative tree.
See also:

getAlternativeTreeRoot

Returns the root occurrence associated with the given AlternativeTree.
scene.getAlternativeTreeRoot(tree) -> scene.Occurrence
Parameters

Type

Name

Description

AlternativeTreetreeTargeted alternative tree.
Returns

Type

Name

Description

OccurrencerootThe root occurrence.
See also:

listAlternativeTrees

Returns all the available alternative trees.
scene.listAlternativeTrees() -> scene.AlternativeTreeList
Returns

Type

Name

Description

AlternativeTreeListtreesAll alternative trees.
See also:

animations

addAnimation

Add an animation in Animation library.
scene.addAnimation(animation)
Parameters

Type

Name

Description

AnimationanimationAnimation to add.
See also:

addKeyframe

Adds a keyframe in the curve.
scene.addKeyframe(channel, time, value) -> scene.Keyframe
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants to add a keyframe in.
AnimationTimetimeThe time.
DoublevalueThe value.
Returns

Type

Name

Description

KeyframekeyframeThe corresponding keyframe.
See also:

addKeyframeFromCurrentPosition

Adds keyframes in a given AnimChannel based on current position.
scene.addKeyframeFromCurrentPosition(channel, time)
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants to add a keyframe in.
AnimationTimetimeThe time.
See also:

animatesThisOccurrence

Does this Animation animates this Occurrence - or one of its parents (thus animating it indirectly) ?.
scene.animatesThisOccurrence(animation, occurrence) -> core.Bool
Parameters

Type

Name

Description

AnimationanimationThe Animation.
OccurrenceoccurrenceThe supposedly animated occurrence.
Returns

Type

Name

Description

BoolisAnimatedThe answer to this question.
See also:

bakeAnimation

Bake an animation. The values are now precalculated and no longer interpolated.
scene.bakeAnimation(animation, occurrence, end, interval)
Parameters

Type

Name

Description

AnimationanimationThe Animation.
OccurrenceoccurrenceThe occurrence.
OccurrenceendThe parent occurrence.
AnimationTimeintervalThe interval.
See also:

createAnimation

Creates an animation, need to use addAnimation when animation is filled.
scene.createAnimation(name) -> scene.Animation
Parameters

Type

Name

Description

StringnameName of the animation.
Returns

Type

Name

Description

AnimationanimationThe created animation.
See also:

createSkeletonMesh

Create a skeleton mesh from a joint component tree.
scene.createSkeletonMesh(root) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrencerootRoot joint component node.
Returns

Type

Name

Description

OccurrenceskeletonOccNew occurrence containing the skeleton mesh.
See also:

decimateAnimChannelBySegment

Decimates by segment a given AnimChannel.
scene.decimateAnimChannelBySegment(channel, precision)
Parameters

Type

Name

Description

AnimChannelchannelThe channel.
DoubleprecisionThe precision.
See also:

deleteAnimation

Deletes an animation.
scene.deleteAnimation(animation)
Parameters

Type

Name

Description

AnimationanimationThe created animation.
See also:

deleteEmptyAnimation

Delete all animation that contain 0 keyframes.
scene.deleteEmptyAnimation()
See also:

displayAllKeyframesFromAnimChannel

Displays info on the selected AnimChannel.
scene.displayAllKeyframesFromAnimChannel(channel)
Parameters

Type

Name

Description

AnimChannelchannelThe channel.
See also:

displayAllKeyframesFromAnimation

Displays info on the selected animation.
scene.displayAllKeyframesFromAnimation(animation)
Parameters

Type

Name

Description

AnimationanimationThe animation.
See also:

displayValueFromAnimChannelAtTime

Displays the value.
scene.displayValueFromAnimChannelAtTime(channel, time, defaultValue=False)
Parameters

Type

Name

Description

AnimChannelchannelThe channel.
AnimationTimetimeThe time.
BooldefaultValueShow default instead ?.
See also:

getAnimChannelIfExists

Returns the main AnimChannel of an Occurrence according to a given Animation.
scene.getAnimChannelIfExists(animation, occurrence) -> scene.AnimChannel
Parameters

Type

Name

Description

AnimationanimationThe Animation.
OccurrenceoccurrenceThe Occurrence.
Returns

Type

Name

Description

AnimChannelchannelThe channel.
See also:

getAnimChannelInfo

Get an animation channel informations.
scene.getAnimChannelInfo(channel) -> scene.AnimChannelInfo
Parameters

Type

Name

Description

AnimChannelchannelAnimation to get info of.
Returns

Type

Name

Description

AnimChannelInfochannelInfo
See also:

getAnimChannelOccurrence

Returns the Occurrence related to a given AnimChannel.
scene.getAnimChannelOccurrence(channel) -> scene.Occurrence
Parameters

Type

Name

Description

AnimChannelchannelThe channel.
Returns

Type

Name

Description

OccurrenceoccurrenceThe corresponding occurrence.
See also:

getAnimationComponentPropertyBinderLists

Packs all animation-related info in an object.
scene.getAnimationComponentPropertyBinderLists(animationComponent) -> scene.AnimPropertyBinderList
Parameters

Type

Name

Description

AnimationComponentanimationComponentAnimation to get info of.
Returns

Type

Name

Description

AnimPropertyBinderListanimPropertyBinderList
See also:

getAnimationInfo

Packs all animation-related info in an object.
scene.getAnimationInfo(animation) -> scene.AnimationInfo
Parameters

Type

Name

Description

AnimationanimationAnimation to get info of.
Returns

Type

Name

Description

AnimationInfoanimationInfo
See also:

getAnimationPropertyBinderLists

Packs all animation-related info in an object.
scene.getAnimationPropertyBinderLists(animation) -> scene.AnimPropertyBinderList
Parameters

Type

Name

Description

AnimationanimationAnimation to get info of.
Returns

Type

Name

Description

AnimPropertyBinderListanimPropertyBinderList
See also:

getJointDefinition

Get joint definition from id.
scene.getJointDefinition(joint) -> scene.JointDefinition
Parameters

Type

Name

Description

JointjointId of the joint.
Returns

Type

Name

Description

JointDefinitionjointDefinitionThe jointDefinition matching the id provided.
See also:

getJointDefinitions

Get joint definition from id.
scene.getJointDefinitions(joints) -> scene.JointDefinitionList
Parameters

Type

Name

Description

JointListjointsIds of joints.
Returns

Type

Name

Description

JointDefinitionListjointDefinitionsAn array of all jointDefinition matching joint provided.
See also:

getKeyframeParentAnimChannel

Returns the parent AnimChannel of a given Keyframe.
scene.getKeyframeParentAnimChannel(keyframe) -> scene.AnimChannel
Parameters

Type

Name

Description

KeyframekeyframeThe keyframe one wants the parent of.
Returns

Type

Name

Description

AnimChannelanimChannelThe Parent.
See also:

getKeyframes

Returns a list of all keyframes of a simple animChannel.
scene.getKeyframes(channel) -> scene.KeyframeList
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants to extract the keyframs from.
Returns

Type

Name

Description

KeyframeListkeyframelistThe list of keyframes.
See also:

getMainChannel

Returns the main AnimChannel of a given AnimChannel.
scene.getMainChannel(channel) -> scene.AnimChannel
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants the main of.
Returns

Type

Name

Description

AnimChannelmainChannelThe corresponding main Channel.
See also:

getOccurrenceJoint

Returns the Joint assigned to an occurrence if any.
scene.getOccurrenceJoint(occurrence) -> polygonal.Joint
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

JointjointThe joint assigned to the given occurrence.
See also:

getParentChannel

Returns (if exists) the parent AnimChannel of a given AnimChannel.
scene.getParentChannel(channel) -> scene.AnimChannel
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants the parent of.
Returns

Type

Name

Description

AnimChannelparentChannelThe corresponding parent Channel.
See also:

getSubChannel

Returns the subchannel of a given name from an AnimChannel.
scene.getSubChannel(channel, name) -> scene.AnimChannel
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants the subchannel of.
StringnameThe name of the subchannel.
Returns

Type

Name

Description

AnimChannelsubChannelThe corresponding subchannel.
See also:

getSubChannels

Returns all the sub channel of an AnimChannel.
scene.getSubChannels(channel) -> scene.AnimChannelList
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants the subchannel of.
Returns

Type

Name

Description

AnimChannelListsubChannelsThe list of direct sub channels.
See also:

linkPropertyToAnimation

Creates a Binder in an Animation stack to animate an entity's property.
scene.linkPropertyToAnimation(animation, entity, propertyName) -> scene.AnimChannel
Parameters

Type

Name

Description

AnimationanimationThe Animation stack where to put a animated property.
EntityentityThe entity object to animate.
StringpropertyNameThe name of the property to animate.
Returns

Type

Name

Description

AnimChannelmainChannelThe main channel of the binder.
See also:

listAnimations

List all Animations from the scene.
scene.listAnimations() -> scene.AnimationList
Returns

Type

Name

Description

AnimationListanimListThe list containing animations.
See also:

listMainChannels

List all main AnimChannel from a given Animation.
scene.listMainChannels(animation) -> scene.AnimChannelList
Parameters

Type

Name

Description

AnimationanimationThe Animation one wants to list the channels from.
Returns

Type

Name

Description

AnimChannelListchannelListThe list containing the AnimChannels.
See also:

makeDefaultKeyframe

Creates keyframes with the default values of the channel at time 0.
scene.makeDefaultKeyframe(channel)
Parameters

Type

Name

Description

AnimChannelchannelThe channel.
See also:

moveAnimation

Moving animation.
scene.moveAnimation(animation, target, newParent, interval)
Parameters

Type

Name

Description

AnimationanimationThe Animation.
OccurrencetargetThe target occurrence.
OccurrencenewParentThe new parent occurrence.
AnimationTimeintervalThe interval.
See also:

removeKeyframe

Removes a keyframe in the curve.
scene.removeKeyframe(channel, time)
Parameters

Type

Name

Description

AnimChannelchannelThe channel one wants to remove a keyframe from.
AnimationTimetimeThe time.
See also:

unlinkPropertyToAnimation

Unlinks a binder.
scene.unlinkPropertyToAnimation(animation, entity, propertyName)
Parameters

Type

Name

Description

AnimationanimationThe Animation stack where to put a animated property.
EntityentityThe entity object to animate.
StringpropertyNameThe name of the property to animate.
See also:

debug

getBRepInfos

Get BRep info.
scene.getBRepInfos() -> core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Double, core.Int, core.Int, core.Int
Returns

Type

Name

Description

IntpartCountThe part count.
InttotalPartCountThe total part count.
IntvertexCountThe vertex count.
InttotalVertexCountThe total vertex count.
IntedgeCountThe edge count.
InttotalEdgeCountThe total edge count.
IntopenShellCountThe open shell count.
InttotalOpenShellCountThe total open shell count.
IntbodyCountThe body count.
InttotalBodyCountThe total body count.
Doublearea2DsumThe 2D area sum.
IntboundaryCountThe boundary count.
IntboundaryEdgeCountThe boundary edge count.
IntnonManifoldEdgeCountThe non manifold edge count.
See also:

getTessellationInfos

Get tessellation info.
scene.getTessellationInfos(root=0) -> core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int, core.Int
Parameters

Type

Name

Description

OccurrencerootOccurrence tree root.
Returns

Type

Name

Description

IntpartCountThe part count.
InttotalPartCountThe total part count.
IntvertexCountThe vertex count.
InttotalVertexCountThe total vertex count.
IntedgeCountThe edge count.
InttotalEdgeCountThe total edge count.
IntpolygonCountThe polygon count.
InttotalPolygonCountThe total polygon count.
IntpatchCountThe patch count.
InttotalPatchCountThe total patch count.
IntboundaryCountThe boundary count.
IntboundaryEdgeCountThe boundary edge count.
IntnonManifoldEdgeCountThe non manifold edge count.
See also:

getTessellationParameters

Get tessellation parameters.
scene.getTessellationParameters(part) -> core.Double, core.Double, core.Double, core.Bool, scene.UVGenerationMode, core.Int, core.Double, core.Bool, core.Bool
Parameters

Type

Name

Description

PartpartThe tessellated part.
Returns

Type

Name

Description

DoublemaxSagThe MaxSag value in mm.
DoublemaxLengthThe maximum length in mm.
DoublemaxAngle
BoolcreateNormalsWhether normals were created.
UVGenerationModeuvGenerationModeThe uv generation mode.
IntuvChannelThe UV channel.
DoubleuvPaddingThe UV padding.
BoolcreateTangentsWhether tangents were created.
BoolcreateFreeEdgesWhether free edges were created.
See also:

print

Print an occurrence tree on log.
scene.print(root=0)
Parameters

Type

Name

Description

OccurrencerootOccurrence tree root.
See also:

filters

addFilterToLibrary

Add a filter to the filters library.
scene.addFilterToLibrary(name, expr) -> core.Ident
Parameters

Type

Name

Description

StringnameName of the filter.
FilterExpressionexprThe filter expression.
Returns

Type

Name

Description

IdentfilterIdIdentifier of the created filter.
See also:

evaluateExpression

Evaluate the given filter expression.
scene.evaluateExpression(filter) -> core.String
Parameters

Type

Name

Description

FilterExpressionfilterThe filter expression.
Returns

Type

Name

Description

StringresultResult of the given expression.
See also:

evaluateExpressionOnOccurrences

Evaluate the given filter expression on all occurrences under the given occurrence and returns the result.
scene.evaluateExpressionOnOccurrences(occurrences, filter) -> core.StringList
Parameters

Type

Name

Description

OccurrenceListoccurrencesOccurrences on which to evaluate the expression.
FilterExpressionfilterThe filter expression.
Returns

Type

Name

Description

StringListevaluationsThe evaluation of the expression on the occurrence at the same index in given occurrences.
See also:

evaluateExpressionOnSubTree

Evaluate the given filter expression on all occurrences under the given occurrence and returns the result.
scene.evaluateExpressionOnSubTree(filter, fromOcc=None) -> scene.OccurrenceList, core.StringList
Parameters

Type

Name

Description

FilterExpressionfilterThe filter expression.
OccurrencefromOccSource occurrence of the recursion.
Returns

Type

Name

Description

OccurrenceListoccurrences
StringListevaluationsThe evaluation of the expression on the occurrence at the same index in occurrences.
See also:

exportFilterLibrary

Export filters from a given file.
scene.exportFilterLibrary(file)
Parameters

Type

Name

Description

FilePathfileFile path to export.
See also:

findFilterByName

Returns the first filter in the filter library with the given name.
scene.findFilterByName(name) -> scene.Filter
Parameters

Type

Name

Description

StringnameName of the filter to retrieve (case sensitive).
Returns

Type

Name

Description

FilterfilterThe retrieved filter.
See also:

getFilterExpression

Returns the filter expression (string) from a filter id stored in the library.
scene.getFilterExpression(filterId) -> scene.FilterExpression
Parameters

Type

Name

Description

IdentfilterIdIdentifier of the filter to fetch.
Returns

Type

Name

Description

FilterExpressionexprFilter expression.
See also:

getFilterFromLibrary

Retrieve a filter from the library with its identifier.
scene.getFilterFromLibrary(filterId) -> scene.Filter
Parameters

Type

Name

Description

IdentfilterIdIdentifier of the filter to retrieve.
Returns

Type

Name

Description

FilterfilterThe retrieved filter.
See also:

getFilteredOccurrences

Recursively get all the occurrences validating the given filter expression.
scene.getFilteredOccurrences(filter, fromOcc=None) -> scene.OccurrenceList
Parameters

Type

Name

Description

FilterExpressionfilterThe filter expression.
OccurrencefromOccSource occurrence of the recursion.
Returns

Type

Name

Description

OccurrenceListoccurrencesResult occurrences.
See also:

importFilterLibrary

Import filters from a given file.
scene.importFilterLibrary(file)
Parameters

Type

Name

Description

FilePathfileFile containing the filter library.
See also:

listFilterLibrary

Returns all the filter stored in the filter library.
scene.listFilterLibrary() -> scene.FilterList
Returns

Type

Name

Description

FilterListfiltersAll the filters stored in the filter library.
See also:

removeFilterFromLibrary

Remove a filter from the filters library.
scene.removeFilterFromLibrary(filterId)
Parameters

Type

Name

Description

IdentfilterIdIdentifier of the filter to remove.
See also:

isolate

getIsolatedOccurrences

Get Occurrences currently being isolated.
scene.getIsolatedOccurrences() -> scene.OccurrenceList
Returns

Type

Name

Description

OccurrenceListoccurrencesThe list of occurrences isolated.
See also:

isIsolated

Is in isolate mode.
scene.isIsolated() -> core.Boolean
Returns

Type

Name

Description

BooleanisolatedReturns is it in isolated mode.
See also:

isolate

Enter isolate mode by isolating a subset of the scene for process, export, viewer, ...
scene.isolate(occurrences)
Parameters

Type

Name

Description

OccurrenceListoccurrencesOccurrences to isolate.
See also:

unisolate

Exit the isolate mode.
scene.unisolate()
See also:

locks

sceneReadLock

Lock the scene to prevent modification while allowing reading from other threads.
scene.sceneReadLock()
See also:

sceneReadUnlock

Unlock the scene for modification.
scene.sceneReadUnlock()
See also:

sceneTryReadLock

Try lock the scene to prevent modification while allowing reading from other threads.
scene.sceneTryReadLock() -> core.Boolean
Returns

Type

Name

Description

BooleansceneLockedReturns if the scene has been locked.
See also:

sceneWriteLock

Lock the scene from being read/write by other threads.
scene.sceneWriteLock()
See also:

sceneWriteUnlock

Unlock the scene for modification and reading.
scene.sceneWriteUnlock()
See also:

merging

findPartOccurrencesWithUnstitchedOpenShells

Find Part occurrences containing multiple unstitched openShell entities.
scene.findPartOccurrencesWithUnstitchedOpenShells(root) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrencerootRoot occurrence.
Returns

Type

Name

Description

OccurrenceListunstitchedFacesOccurrencesUnstitched faces occurrences.
See also:

mergeOccurrencesByTreeLevel

Merge all parts over maxLevel level.
scene.mergeOccurrencesByTreeLevel(roots, maxLevel=5, mergeHiddenPartsMode=2)
Parameters

Type

Name

Description

OccurrenceListrootsRoots occurrences for the process.
IntmaxLevelMaximum tree level.
MergeHiddenPartsModemergeHiddenPartsModeHidden parts handling mode, Destroy them, make visible or merge separately.
See also:

mergePartOccurrences

Merge a set of parts.
scene.mergePartOccurrences(partOccurrences, mergeHiddenPartsMode=2) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListpartOccurrencesOccurrence of the parts to merge.
MergeHiddenPartsModemergeHiddenPartsModeHidden parts handling mode, Destroy them, make visible or merge separately.
Returns

Type

Name

Description

OccurrenceListmergedOccurrencesResulting merged occurrences.
See also:

mergePartOccurrencesByAssemblies

Merge all parts under each assembly together (grouped by shape type: BRep, Tesselled surface, Joint).
scene.mergePartOccurrencesByAssemblies(roots=None, mergeHiddenPartsMode=2)
Parameters

Type

Name

Description

OccurrenceListrootsRoots occurrences for the process (will not be removed).
MergeHiddenPartsModemergeHiddenPartsModeHidden parts handling mode, Destroy them, make visible or merge separately.
See also:

mergePartOccurrencesByFinalAssemblies

Merge all final-level parts (ie occurrences having for children exclusively occurrences with part components) under each assembly together (grouped by shape type: BRep, Tesselled surface, Joint).
scene.mergePartOccurrencesByFinalAssemblies(roots=None, mergeHiddenPartsMode=0, CollapseToParent=True)
Parameters

Type

Name

Description

OccurrenceListrootsRoots occurrences for the process (will not be removed).
MergeHiddenPartsModemergeHiddenPartsModeHidden parts handling mode, Destroy them, make visible or merge separately.
BooleanCollapseToParentIf true, final level unique merged part will replace it's parent.
See also:

mergePartOccurrencesByMaterials

Merge a set of parts by materials.
scene.mergePartOccurrencesByMaterials(partOccurrences, mergeNoMaterials=True, mergeHiddenPartsMode=2, combineMeshes=True) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListpartOccurrencesOccurrence of the parts to merge.
BooleanmergeNoMaterialsIf true, merge all parts with no active material together, else do not merge them.
MergeHiddenPartsModemergeHiddenPartsModeHidden parts handling mode, Destroy them, make visible or merge separately.
BooleancombineMeshesIf true, explode and remerge the input parts by visible materials.
Returns

Type

Name

Description

OccurrenceListmergedOccurrencesResulting merged occurrences.
See also:

mergePartOccurrencesByName

Merge all parts by occurrences names.
scene.mergePartOccurrencesByName(root=0, mergeHiddenPartsMode=2)
Parameters

Type

Name

Description

OccurrencerootRoot occurrence of the subtree to process.
MergeHiddenPartsModemergeHiddenPartsModeHidden parts handling mode, Destroy them, make visible or merge separately.
See also:

mergePartOccurrencesByRegions

Merge all parts within the same area.
scene.mergePartOccurrencesByRegions(roots, mergeBy, strategy) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListrootsRoots occurrences for the process (will not be removed).
MergeByRegionsStrategymergeByNumber: number of output parts (or regions of parts)
MergeStrategystrategyChoose the regions merging strategy.
Returns

Type

Name

Description

OccurrenceListmergedOccurrencesResulting merged occurrences.
See also:

mergePartOccurrencesWithSingleOpenShellByAssemblies

Merge Part occurrences containing a single openShell entity, by assemblies.
scene.mergePartOccurrencesWithSingleOpenShellByAssemblies(root) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrencerootRoot of the main assembly to merge.
Returns

Type

Name

Description

OccurrenceListmergedOccurrencesList of the merged occurrence that contained only openShell.
See also:

modification

applyTransformation

Apply a transformation to the local matrix of an occurrence.
scene.applyTransformation(occurrence, matrix)
Parameters

Type

Name

Description

OccurrenceoccurrenceOccurrence to apply the matrix on.
Matrix4matrixTransformation to matrix.
See also:

createSymmetry

Create symmetries from selection.
scene.createSymmetry(occurrences, plane)
Parameters

Type

Name

Description

OccurrenceListoccurrencesSelection of occurrences.
AxisPlaneplaneSymmetry plane.
See also:

rotate

Modify the local matrix of the scene node to apply a rotation.
scene.rotate(occurrence, axis, angle)
Parameters

Type

Name

Description

OccurrenceoccurrenceOccurrence to rotate.
Vector3axisAxis of rotation.
AngleangleAngle of rotation.
See also:

setLocalMatrices

Change the local matrices on a list of occurrences.
scene.setLocalMatrices(occurrencesIds, matrices, batchSize)
Parameters

Type

Name

Description

OccurrenceListoccurrencesIdsList of occurrences on which to set the local matrices.
Matrix4ListmatricesThe occurrences' new local matrices.
UIntbatchSizeNumber of matrices to be set per thread.
See also:

setLocalMatrix

Change the local matrix on an occurrence.
scene.setLocalMatrix(occurrence, matrix)
Parameters

Type

Name

Description

OccurrenceoccurrenceOccurrence to set the local matrix.
Matrix4matrixThe new occurrence local matrix.
See also:

part

getPartMesh

Return the mesh of the TesselatedShape.
scene.getPartMesh(part) -> polygonal.Mesh
Parameters

Type

Name

Description

PartpartThe part component.
Returns

Type

Name

Description

MeshmeshThe mesh of the tessellated shape of the part.
See also:

getPartModel

Return the model of the BRepShape.
scene.getPartModel(part) -> cad.Model
Parameters

Type

Name

Description

PartpartThe part component.
Returns

Type

Name

Description

ModelmodelThe model of the BRep shape of the part.
See also:

getPartsMeshes

Return the meshes of the TesselatedShape for each given parts if any.
scene.getPartsMeshes(parts) -> polygonal.MeshList
Parameters

Type

Name

Description

PartListpartsThe list of part component.
Returns

Type

Name

Description

MeshListmeshesThe list of mesh of the tessellated shape of each part.
See also:

getPartsModels

Return the models of the BRepShape for each given parts if any.
scene.getPartsModels(parts) -> cad.ModelList
Parameters

Type

Name

Description

PartListpartsThe list of part component.
Returns

Type

Name

Description

ModelListmodelsThe list of models of the BRep shape of each part.
See also:

getPartsTransforms

Returns the transform matrix of each given parts.
scene.getPartsTransforms(parts) -> geom.Matrix4List
Parameters

Type

Name

Description

PartListpartsThe parts to retrieve transform.
Returns

Type

Name

Description

Matrix4ListtransformsThe transform matrix of each part.
See also:

getPartsTransformsIndexed

Returns the transform matrix of each given parts (indexed mode).
scene.getPartsTransformsIndexed(parts) -> core.IntList, geom.Matrix4List
Parameters

Type

Name

Description

PartListpartsThe parts to retrieve transform.
Returns

Type

Name

Description

IntListindicesThe transform matrix index for each parts (0 for Identity).
Matrix4ListtransformsThe list of transform matrices (the first is always Identity).
See also:

setPartMesh

Add a mesh to a part (create a TessellatedShape on the part).
scene.setPartMesh(part, mesh)
Parameters

Type

Name

Description

PartpartThe part component.
MeshmeshThe mesh to add to the part.
See also:

setPartModel

Add a model to a part (create a BRepShape on the part).
scene.setPartModel(part, model)
Parameters

Type

Name

Description

PartpartThe part component.
ModelmodelThe model to add to the part.
See also:

setPartsTransforms

Set the transform matrix of each given parts.
scene.setPartsTransforms(parts, transforms)
Parameters

Type

Name

Description

PartListpartsThe parts to retrieve transform.
Matrix4ListtransformsThe transform matrix of each part.
See also:

setPartsTransformsIndexed

Set the transform matrix of each given parts (indexed mode).
scene.setPartsTransformsIndexed(parts, indices, transforms)
Parameters

Type

Name

Description

PartListpartsThe parts to retrieve transform.
IntListindicesThe transform matrix index for each parts.
Matrix4ListtransformsThe list of transform matrices.
See also:

partialLoading

getPartialLoadingStatus

Get the current status of a partial loading component.
scene.getPartialLoadingStatus(component) -> scene.PartialLoad_Status
Parameters

Type

Name

Description

ReferencedDataComponentcomponentReferenced Data component.
Returns

Type

Name

Description

PartialLoad_StatusstatusThe current status.
See also:

setReferencedDataComponentParent

Defines which referenced data is parent to the given component.
scene.setReferencedDataComponentParent(component, parent)
Parameters

Type

Name

Description

ReferencedDataComponentcomponentThe referenced data component to alter.
ReferencedDataComponentparentThe parent.
See also:

setReferencedDataComponentPath

Defines which path the referenced data is at.
scene.setReferencedDataComponentPath(component, filePath)
Parameters

Type

Name

Description

ReferencedDataComponentcomponentThe referenced data component to alter.
StringfilePathThe filepath.
See also:

pivots

alignPivotPointToWorld

Re-orient the Pivot Point straight to world origin (the grid).
scene.alignPivotPointToWorld(occurrences, applyToChildren=False)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrences to modify.
BoolapplyToChildrenIf True, all the pivot of the descending occurrences from occurrence will be affected.
See also:

movePivotPointToOccurrenceCenter

Move the pivot point of each occurrence listed in the function input, to the center of its bounding box (and of its children if the parameter is True).
scene.movePivotPointToOccurrenceCenter(occurrences, applyToChildren=False)
Parameters

Type

Name

Description

OccurrenceListoccurrencesOccurrences (or the roots occurrences if recursively=True).
BoolapplyToChildrenIf True, all the pivot of the descending occurrences from occurrence will be affected.
See also:

movePivotPointToOrigin

Move the pivot point of an occurrence (and its descendants if recursively) to the origin (0,0,0).
scene.movePivotPointToOrigin(occurrence, applyToChildren=False)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence (or the root occurrence if recursively=True).
BoolapplyToChildrenIf True, all the pivot of the descending occurrences from occurrence will be affected.
See also:

movePivotPointToSelectionCenter

Move the pivot point of all given occurrences to the center of all occurrences.
scene.movePivotPointToSelectionCenter(occurrences)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrences to modify.
See also:

movePivotPointToTargetedOccurrenceCenter

Move the pivot point of each occurrence listed in the function input, to the center of the targeted occurrence Center (and of its children if the parameter is True).
scene.movePivotPointToTargetedOccurrenceCenter(occurrences, target, applyToChildren=False)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrence (or the root occurrence if recursively=True).
OccurrencetargetThe target occurrence.
BoolapplyToChildrenIf True, all the pivot of the descending occurrences from occurrence will be affected.
See also:

setPivotOnly

Set the pivot of an occurrence to the given transformation matrix, the geometry will not be moved (warning: do not confuse with property Transform which actually move the occurrence).
scene.setPivotOnly(occurrence, pivot)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence to move the pivot.
Matrix4pivotThe new transformation matrix for the occurrence (pivot).
See also:

pmi

addAnnotationGroup

Add a Annotation Group to the pmi component.
scene.addAnnotationGroup(component, name) -> scene.AnnotationGroup
Parameters

Type

Name

Description

PMIComponentcomponentComponent to add the Annotation Group.
StringnameName of the annotation group.
Returns

Type

Name

Description

AnnotationGroupgroupAnnotation group created.
See also:

addMeshToAnnotation

Add a mesh and its material to a annotation.
scene.addMeshToAnnotation(annotation, material, staticmesh)
Parameters

Type

Name

Description

Annotationannotation
Materialmaterial
StaticMeshstaticmesh
See also:

convertPMIToOccurrences

Convert each PMI component into a set of occurrences with mesh geometries.
scene.convertPMIToOccurrences(occurrences, convertVisibility=False)
Parameters

Type

Name

Description

OccurrenceListoccurrencesOccurrence selection.
BooleanconvertVisibilityIf True, the visibility will be converted (useful to select a specific view/variant), else all occurrences will be visible.
See also:

createAnnotationFromDefinition

Create Annotation from definition.
scene.createAnnotationFromDefinition(definition) -> scene.Annotation
Parameters

Type

Name

Description

AnnotationDefinitiondefinitionAnnotation definition.
Returns

Type

Name

Description

AnnotationmetadataAnnotation created from definition.
See also:

createOccurrenceFromAnnotation

Convert a single annotation on an occurrence into an occurrence with mesh geometry.
scene.createOccurrenceFromAnnotation(annotation, convertVisibility=False) -> scene.Occurrence
Parameters

Type

Name

Description

AnnotationannotationAnnotation that shall be converted to an occurrence with mesh geometry.
BooleanconvertVisibilityIf True, the visibility will be converted (useful to select a specific view/variant), else all occurrences will be visible.
Returns

Type

Name

Description

OccurrencenewOccurrenceAnnotation as occurrence with mesh geometry.
See also:

createProductView

Create a productview from definition.
scene.createProductView(definition) -> scene.ProductView
Parameters

Type

Name

Description

ProductViewDefinitiondefinition
Returns

Type

Name

Description

ProductViewviewThe product view.
See also:

getAnnotationDefinition

Get definition of given annotation.
scene.getAnnotationDefinition(annotation) -> scene.AnnotationDefinition
Parameters

Type

Name

Description

Annotationannotation
Returns

Type

Name

Description

AnnotationDefinitiondefinition
See also:

getAnnotationGroups

Returns the list of the AnnotationGroup from a PMIComponent.
scene.getAnnotationGroups(pmiComponent) -> scene.AnnotationGroupList
Parameters

Type

Name

Description

ComponentpmiComponentThe pmi component.
Returns

Type

Name

Description

AnnotationGroupListgroupsList of AnnotationGroup.
See also:

getAnnotationListAABB

Get the AABB of the annotation list.
scene.getAnnotationListAABB(annotationList) -> geom.AABB
Parameters

Type

Name

Description

AnnotationListannotationList
Returns

Type

Name

Description

AABBaabbThe axis aligned bounding box of the given annotation list.
See also:

getAnnotations

Returns the list of the Annotation from a AnnotationGroup.
scene.getAnnotations(group) -> scene.AnnotationList
Parameters

Type

Name

Description

AnnotationGroupgroupThe AnnotationGroup.
Returns

Type

Name

Description

AnnotationListannotationsList of Annotation.
See also:

getOccurrenceAnnotationDefinitions

Get all annotations definition of given occurrence.
scene.getOccurrenceAnnotationDefinitions(occurrence) -> scene.AnnotationDefinitionList
Parameters

Type

Name

Description

Occurrenceoccurrence
Returns

Type

Name

Description

AnnotationDefinitionListdefinitions
See also:

getProductViewDefinition

Get productview definition.
scene.getProductViewDefinition(view) -> scene.ProductViewDefinition
Parameters

Type

Name

Description

VariantviewThe product view.
Returns

Type

Name

Description

ProductViewDefinitiondefinition
See also:

getProductViewDefinitions

Get all productviews definitions.
scene.getProductViewDefinitions() -> scene.ProductViewDefinitionList
Returns

Type

Name

Description

ProductViewDefinitionListdefinitions
See also:

setAnnotationToGroup

Set Annotation to a Annotation Group.
scene.setAnnotationToGroup(annotation, group)
Parameters

Type

Name

Description

Annotationannotation
AnnotationGroupgroup
See also:

prototype

cleanInstances

Clean prototypes and instances (lonely instances, overriding their prototypes hierarchies...).
scene.cleanInstances(removeUselessInstances=True, removeHierarchyOverridingInstances=False, occurrence=0)
Parameters

Type

Name

Description

BooleanremoveUselessInstancesRemove instances where they are not needed (prototype referenced once, ...).
BooleanremoveHierarchyOverridingInstancesRemove instances overriding their prototypes sub-hierarchies.
OccurrenceoccurrenceRoot occurrence for the process.
See also:

getDirectInstances

Returns all the occurrences prototyping the given occurrence.
scene.getDirectInstances(prototype) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceprototypeThe prototype occurrence.
Returns

Type

Name

Description

OccurrenceListinstancesThe instances.
See also:

getFinalPrototype

Returns the final prototype of an occurrence (ie. The very first one of prototype tree).
scene.getFinalPrototype(occurrence) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

OccurrenceprototypeThe final prototype (if any).
See also:

getInstances

Get occurrences sharing the same prototype as the given one.
scene.getInstances(occurrence) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceoccurrenceReference part occurrence.
Returns

Type

Name

Description

OccurrenceListinstancesThe list of occurrences sharing the same prototype.
See also:

getPrototype

Returns the prototype of an occurrence.
scene.getPrototype(occurrence) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
Returns

Type

Name

Description

OccurrenceprototypeThe prototype (if any).
See also:

getPrototypes

Returns the prototype for each given occurrence.
scene.getPrototypes(occurrences) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrence.
Returns

Type

Name

Description

OccurrenceListprototypesThe prototype of each occurrence.
See also:

prototypeSubTree

Create occurrences that prototype the given occurrence and all its subtree.
scene.prototypeSubTree(prototype) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceprototypeThe root occurrence of the sub-tree to prototype.
Returns

Type

Name

Description

OccurrenceoccurrenceThe root occurrence of the prototyped sub-tree.
See also:

setPrototype

Sets the prototype of an occurrence.
scene.setPrototype(occurrence, prototype)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
OccurrenceprototypeThe prototype.
See also:

setPrototypes

Sets the prototype for each given occurrence.
scene.setPrototypes(occurrences, prototypes)
Parameters

Type

Name

Description

OccurrenceListoccurrencesThe occurrences.
OccurrenceListprototypesThe prototypes.
See also:

updateChildrenPrototypes

Update children prototypes of the given occurrence.
scene.updateChildrenPrototypes(occurrence)
Parameters

Type

Name

Description

OccurrenceoccurrenceThe occurrence.
See also:

selection

clearSelection

Clear the current selection.
scene.clearSelection(selectionId=1)
Parameters

Type

Name

Description

IdentselectionIdID of the selection to clear, or current selection (id = 1) will be cleared.
See also:

createSelectionSnapshot

Get the ID of a copy of the current selection to use it later.
scene.createSelectionSnapshot() -> core.Ident
Returns

Type

Name

Description

IdentselectionIdSelection ID of the state of the current selection.
See also:

deleteSelection

Delete all selected occurrences, and/or sub-occurrence elements.
scene.deleteSelection(selectionId=1)
Parameters

Type

Name

Description

IdentselectionIdID of the selection to delete, or current selection (id = 1) will be deleted.
See also:

deleteSelectionSnapshot

Delete a selection snapshot using its id.
scene.deleteSelectionSnapshot(selectionId)
Parameters

Type

Name

Description

IdentselectionIdSelection ID of the snapshot to delete.
See also:

getSelectedOccurrences

Returns all the selected occurrences.
scene.getSelectedOccurrences(keepAncestors=False, selectionId=1) -> scene.OccurrenceList
Parameters

Type

Name

Description

BooleankeepAncestorsIf True, occurrences with ancestors selected will be remove from the list.
IdentselectionIdID of the selection to use, or current selection (id = 1) will be used.
Returns

Type

Name

Description

OccurrenceListselectionThe list of selected occurrences.
See also:

getSelectedPolygonCount

Returns the number of selected polygons.
scene.getSelectedPolygonCount(selectionId=1) -> core.ULong
Parameters

Type

Name

Description

IdentselectionIdID of the selection to use, or current selection (id = 1) will be used.
Returns

Type

Name

Description

ULongpolygonCountNumber of selected Polygons.
See also:

invertOrientationSelection

Invert the orientation of each selected item (occurrences and/or sub-occurrence elements.
scene.invertOrientationSelection(selectionId=1)
Parameters

Type

Name

Description

IdentselectionIdID of the selection to invert, or current selection (id = 1) will be inverted.
See also:

invertSelect

Invert occurrences to selection.
scene.invertSelect(occurrence, selectionId=1)
Parameters

Type

Name

Description

OccurrenceListoccurrenceOccurrences to invert from the selection.
IdentselectionIdID of the selection to use, or current selection (id = 1) will be used.
See also:

invertSelection

Replace the selection by all unselected part occurrences.
scene.invertSelection(selectionId=1)
Parameters

Type

Name

Description

IdentselectionIdID of the selection to invert, or current selection (id = 1) will be inverted.
See also:

select

Add occurrences to selection.
scene.select(occurrences, selectionId=1)
Parameters

Type

Name

Description

OccurrenceListoccurrencesOccurrences to add to the selection.
IdentselectionIdID of the selection to use, or current selection (id = 1) will be used.
See also:

separateSelection

Separate all polygons from their original parts into a new one or new ones depending on the parameters.
scene.separateSelection(createSingleOccurrence=True, selectionId=1) -> scene.OccurrenceList
Parameters

Type

Name

Description

BooleancreateSingleOccurrenceOnly create a single occurrence, or create occurrences corresponding to every part containing selected elements, at the same place in the hierarchical tree.
IdentselectionIdID of the selection to separate, or current selection (id = 1) will be separated.
Returns

Type

Name

Description

OccurrenceListnewOccurrencesThe new occurrence(s) created.
See also:

unselect

Remove occurrences to selection.
scene.unselect(occurrence, selectionId=1)
Parameters

Type

Name

Description

OccurrenceListoccurrenceOccurrences to remove from the selection.
IdentselectionIdID of the selection to use, or current selection (id = 1) will be used.
See also:

simplification

compress

Compress a sub-tree by removing occurrence containing only one Child or empty, and by removing useless instances (see removeUselessInstances).
scene.compress(occurrence=0) -> scene.Occurrence
Parameters

Type

Name

Description

OccurrenceoccurrenceRoot occurrence for the process.
Returns

Type

Name

Description

OccurrenceresultingOccurrencesThe resulting occurrences of compression.
See also:

convertToOldSchoolVisibility

Modify the visible properties of the sub-tree to look like old school visibility (only hidden/inherited).
scene.convertToOldSchoolVisibility(root=0)
Parameters

Type

Name

Description

OccurrencerootRoot occurrence.
See also:

getHiddenPartOccurrences

Get hidden part occurrences.
scene.getHiddenPartOccurrences(roots=None) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListrootsRoots occurrences for the process.
Returns

Type

Name

Description

OccurrenceListfilteredThe list of hidden occurrences (visibility status).
See also:

getVisiblePartOccurrences

Get visible part occurrences.
scene.getVisiblePartOccurrences(roots=None) -> scene.OccurrenceList
Parameters

Type

Name

Description

OccurrenceListrootsRoots occurrences for the process.
Returns

Type

Name

Description

OccurrenceListfilteredThe list of visible part occurrences (visibility status).
See also:

makeInstanceUnique

Singularize all instances on the sub-tree of an occurrence.
scene.makeInstanceUnique(occurrences=0, keepOnlyPartInstances=False)
Parameters

Type

Name

Description

OccurrenceListoccurrencesRoot occurrence for the process.
BooleankeepOnlyPartInstancesIf true, instances of part will not be singularized.
See also:

rake

Set the same parent to all descending parts (all parts will be singularized).
scene.rake(occurrence=0, keepInstances=False)
Parameters

Type

Name

Description

OccurrenceoccurrenceRoot occurrence for the process.
BooleankeepInstancesIf false, the part will be singularized.
See also:

removeSymmetryMatrices

Remove symmetry matrices (apply matrices on geometries on nodes under an occurrence with a symmetry matrix.
scene.removeSymmetryMatrices(occurrence=0)
Parameters

Type

Name

Description

OccurrenceoccurrenceRoot occurrence for the process.
See also:

resetPartTransform

Set all part transformation matrices to identity in a sub-tree, transformation will be applied to the shapes.
scene.resetPartTransform(root=0)
Parameters

Type

Name

Description

OccurrencerootRoot occurrence for the process.
See also:

resetTransform

Set all transformation matrices to identity in a sub-tree.
scene.resetTransform(root, recursive=True, keepInstantiation=True, keepPartTransform=False)
Parameters

Type

Name

Description

OccurrencerootRoot occurrence for the process.
BooleanrecursiveIf False, transformation will be applied only on the root and its components.
BooleankeepInstantiationIf False, all occurrences will be singularized.
BooleankeepPartTransformIf False, transformation will be applied to the shapes (BRepShape points or TessellatedShape vertices).
See also:

spatialRequest

createRayProber

Creates a ray prober.
scene.createRayProber() -> core.Ident
Returns

Type

Name

Description

Identid
See also:

createSphereProber

Creates a sphere prober.
scene.createSphereProber() -> core.Ident
Returns

Type

Name

Description

Identid
See also:

rayCast

scene.rayCast(ray, root) -> scene.RayHit
Parameters

Type

Name

Description

RayrayThe ray to cast.
OccurrencerootThe root occurrence to cast from.
Returns

Type

Name

Description

RayHithitInformation of the first ray hit.
See also:

rayCastAll

scene.rayCastAll(ray, root) -> scene.RayHitList
Parameters

Type

Name

Description

RayrayThe ray to cast.
OccurrencerootThe root occurrence to cast from.
Returns

Type

Name

Description

RayHitListhitsInformation of the first ray hit.
See also:

updateRayProber

Updates the designed ray prober.
scene.updateRayProber(proberID, ray)
Parameters

Type

Name

Description

IdentproberIDThe ray prober Id.
RayrayUpdate the prober's ray values.
See also:

updateSphereProber

Updates the designed sphere prober.
scene.updateSphereProber(proberID, sphereCenter, sphereRadius)
Parameters

Type

Name

Description

IdentproberIDThe sphere prober Id.
Vector3sphereCenterThe new prober center.
DoublesphereRadiusThe new prober radius.
See also:

userData

getMultipleOccurrenceUserData

Batch version of getOccurrenceUserData.
scene.getMultipleOccurrenceUserData(userDataId, occurrences) -> core.PtrList
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceListoccurrencesOccurrences that store the user data.
Returns

Type

Name

Description

PtrListuserDataListUser data stored for each given occurrence.
See also:

getOccurrenceUserData

Set or replace a userdata stored on an occurrence.
scene.getOccurrenceUserData(userDataId, occurrence) -> core.Ptr
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceoccurrenceOccurrence that store the user data.
Returns

Type

Name

Description

PtruserDataUser data stored in the given occurrence.
See also:

hasMultipleOccurrenceUserData

Batch version of hasOccurrenceUserData.
scene.hasMultipleOccurrenceUserData(userDataId, occurrences) -> core.BoolList
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceListoccurrencesOccurrences that potentially store the user data.
Returns

Type

Name

Description

BoolListresultsReturns an array of bool that are true if a userdata is stored on the occurrence at the same index for the given userDataId.
See also:

hasOccurrenceUserData

Set or replace a userdata stored on an occurrence.
scene.hasOccurrenceUserData(userDataId, occurrence) -> core.Bool
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceoccurrenceOccurrence that potentially store the user data.
Returns

Type

Name

Description

BoolresultReturns true if a userdata is stored on this occurrence for the given userDataId.
See also:

setMultipleOccurrenceUserData

Batch version of setOccurrenceUserData.
scene.setMultipleOccurrenceUserData(userDataId, occurrences, userDataList)
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceListoccurrencesOccurrences that will store the user data.
PtrListuserDataListUser data to store on each occurrence.
See also:

setOccurrenceUserData

Set or replace a userdata stored on an occurrence.
scene.setOccurrenceUserData(userDataId, occurrence, userData)
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceoccurrenceOccurrence that will store the user data.
PtruserDataUser data to store in the given occurrence.
See also:

subscribeToOccurrenceUserData

Subscribe to occurrence user data. multiple different userdata can be stored on the same occurrences if subscribeToOccurrenceUserData is called multiple times.
scene.subscribeToOccurrenceUserData() -> scene.OccurrenceUserData
Returns

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier to pass to setUserData/getUserData functions.
See also:

unsetMultipleOccurrenceUserData

Batch version of unsetOccurrenceUserData.
scene.unsetMultipleOccurrenceUserData(userDataId, occurrences)
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceListoccurrencesOccurrences that will store the user data.
See also:

unsetOccurrenceUserData

Unset the userdata stored on an occurrence.
scene.unsetOccurrenceUserData(userDataId, occurrence)
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier provided by subscribeToOccurrenceUserData.
OccurrenceoccurrenceOccurrence that will store the user data.
See also:

unsubscribeFromOccurrenceUserData

scene.unsubscribeFromOccurrenceUserData(userDataId)
Parameters

Type

Name

Description

OccurrenceUserDatauserDataIdUserData identifier to unsubscribe.
See also:

variant

addVariant

Create a new variant.
scene.addVariant(name) -> scene.Variant
Parameters

Type

Name

Description

StringnameThe name of the new variant.
Returns

Type

Name

Description

VariantvariantThe new variant.
See also:

duplicateVariant

Create a new variant which is a copy of an existing variant.
scene.duplicateVariant(variant, name) -> scene.Variant
Parameters

Type

Name

Description

VariantvariantThe variant to duplicated.
StringnameName of the new variant.
Returns

Type

Name

Description

VariantnewVariantThe created variant.
See also:

endModifyAllVariants

Call this function to disable the modifications of all variants at the same time.
scene.endModifyAllVariants()
See also:

getVariantComponentsDefinitions

Returns the definitions of multiple variant components.
scene.getVariantComponentsDefinitions(variantComponents) -> scene.VariantDefinitionListList
Parameters

Type

Name

Description

VariantComponentListvariantComponentsThe list of variant components to retrieve definitions.
Returns

Type

Name

Description

VariantDefinitionListListdefinitionsFor each variant component, returns one list of variant definition (one by variant).
See also:

getVariantTree

Get the alternative tree used by this variant.
scene.getVariantTree(variant) -> scene.AlternativeTree
Parameters

Type

Name

Description

VariantvariantThe variant.
Returns

Type

Name

Description

AlternativeTreetreeThe alternative tree used by this variant.
See also:

listVariants

Returns all the available variants.
scene.listVariants() -> scene.VariantList
Returns

Type

Name

Description

VariantListvariantsAll variants.
See also:

removeVariant

Remove a variant.
scene.removeVariant(variant)
Parameters

Type

Name

Description

VariantvariantThe variant to remove.
See also:

setCurrentVariant

Change the current variant used.
scene.setCurrentVariant(variant=None)
Parameters

Type

Name

Description

VariantvariantThe variant to enable (can be null).
See also:

setVariantTree

Set the alternative tree to use for this variant.
scene.setVariantTree(variant, tree)
Parameters

Type

Name

Description

VariantvariantThe variant to modify.
AlternativeTreetreeThe alternative tree to use for this variant.
See also:

startModifyAllVariants

Call this function to to enable the modifications of all variants at the same time.
scene.startModifyAllVariants()
See also: