Table of Contents

Class Scene

Namespace
Scene

Methods

addComponent

Add a component to an occurrence

scene.addComponent(occurrence, componentType) -> scene.Component

Parameters

occurrence Occurrence

The occurrence to add the new component

componentType ComponentType

Type of the component

Returns

Component

The new component added to occurrence

addComponents

Add a components to each occurrence in the array

scene.addComponents(occurrences, componentType) -> scene.ComponentList

Parameters

occurrences OccurrenceList

Occurrences that need the component to be added

componentType ComponentType

Type of the component

Returns

ComponentList

Component that were added or retrieved

addInParentInstances

Add an instance of prototype's child as child in current occurrence recursively

scene.addInParentInstances(root)

Parameters

root Occurrence

The occurrence to test.

cleanUnusedImages

Remove unused images from texture library

scene.cleanUnusedImages() -> core.Int

Returns

Int

The number of texture deleted by the clean

cleanUnusedMaterials

Remove unused materials from material library

scene.cleanUnusedMaterials(cleanImages) -> core.Int

Parameters

cleanImages Boolean

Call cleanUnusedImages if true

Returns

Int

The number of material deleted by the clean

computeSubTreeChecksum

Compute the checksum of a sub-tree

scene.computeSubTreeChecksum(root) -> core.String

Parameters

root Occurrence

Occurrence to compute

Returns

String

configureFunctionLogger

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

Parameters

functionName String
enableFunction Boolean
enableParameters Boolean
enableExecutionTime Boolean

convertMaterialsToColor

Convert all materials to materials with a color pattern, trying to keep the visual aspect as similar as possible

scene.convertMaterialsToColor(materials=[])

Parameters

materials MaterialList

Materials 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

materials MaterialList

Materials to merge (merge all materials if empty)

createHierarchicalClusters

Reorganize a sub tree with hierarchical clustering

scene.createHierarchicalClusters(root, childrenCountByNode=2, minFitting=-1)

Parameters

root Occurrence

Root of the sub-tree to reorganize

childrenCountByNode Int

Order of the hierarchical tree

minFitting Coeff

Minimal fitting coefficient to allow 2 nodes to be merged/clustered

createOBBMesh

scene.createOBBMesh(occurrence) -> scene.Occurrence

Parameters

occurrence Occurrence

Returns

Occurrence

The create occurrence

createOccurrence

Create a new occurrence

scene.createOccurrence(name, parent) -> scene.Occurrence

Parameters

name String

Name of the new occurrence

parent Occurrence

Create the occurrence as a child of parent, if not set the parent will be root

Returns

Occurrence

Created occurrence

createOccurrenceFromSelection

Create a new occurrence and add the given occurrences as children

scene.createOccurrenceFromSelection(name, children, parent, keepMaterialAssignment) -> scene.Occurrence

Parameters

name String

Name of the new occurrence

children OccurrenceList

Add given occurrence as children (if any)

parent Occurrence

If 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

keepMaterialAssignment Boolean

If defined, material assignation will be updated to keep the visual same aspect

Returns

Occurrence

Created occurrence

createOccurrenceFromText

Creates an occurrence from string

scene.createOccurrenceFromText(text, font, fontSize, color, heigth3D) -> scene.Occurrence

Parameters

text String

The occurrence's name

font String

The font to use

fontSize Int

The font size

color ColorAlpha

The occurrence color

heigth3D Double

3D height of text

Returns

Occurrence

createOccurrences

Create one new occurrence under each given parent

scene.createOccurrences(name, parents) -> scene.OccurrenceList

Parameters

name String

Name of the new occurrence

parents OccurrenceList

Create the occurrences as a child of each parent. If empty, one occurrence will be created with root as parent

Returns

OccurrenceList

Created occurrences

createPartsFromMeshes

Create a set of Parts given meshes and occurrences

scene.createPartsFromMeshes(occurrences, meshes) -> scene.PartList

Parameters

occurrences OccurrenceList

The occurrence which will contains the part component of the mesh at the same index

meshes MeshList

List 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

PartList

List 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) -> scene.Occurrence

Parameters

meshes MeshList

List of input meshes

matrices Matrix4List

List of matrices of input meshes (if empty Identity will be used)

centerPartPivots Boolean

If 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

Occurrence

The created root occurrence

deleteComponentByType

Delete component from type

scene.deleteComponentByType(componentType, occurrence, followPrototypes=True)

Parameters

componentType ComponentType

Type of the component

occurrence Occurrence

The occurrence to remove components from

followPrototypes Bool

If 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)

Parameters

componentType ComponentType

Type of the component

rootOccurrence Occurrence

The root occurrence to remove components from

deleteEmptyOccurrences

Delete all empty assemblies

scene.deleteEmptyOccurrences(root=0)

Parameters

root Occurrence

Root occurrence for the process

deleteOccurrences

Delete a liste of occurrences

scene.deleteOccurrences(occurrences)

Parameters

occurrences OccurrenceList

Occurrences to delete

generateOctaViews

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

Parameters

radius Double
XFrames Int
YFrames Int
hemi Bool

Returns

Occurrence

The created Occurrence

generateOctree

Generate a loose octree from the given sub-tree

scene.generateOctree(occurrence, maxDepth, looseFactor) -> scene.Occurrence

Parameters

occurrence Occurrence

Root occurrence of the sub-tree

maxDepth Int

Defines the depth maximum of the octree

looseFactor Double

Defines the loose factor of the octree

Returns

Occurrence

getAABB

Returns the axis aligned bounding box of a list of scene paths

scene.getAABB(occurrences) -> geom.AABB

Parameters

occurrences OccurrenceList

List of occurrences to retrieve the AABB

Returns

AABB

The axis aligned bounding box of all given occurrences

getActiveMaterial

Get the active material on occurrence

scene.getActiveMaterial(occurrence) -> material.Material

Parameters

occurrence Occurrence

The occurrence

Returns

Material

The material

getActivePropertyValue

Get the value of a property on the first parent that own it

scene.getActivePropertyValue(occurrence, propertyName, cacheProperty) -> core.String

Parameters

occurrence Occurrence

An occurrence

propertyName String

Property name

cacheProperty Boolean

If true, the property will be copied on all ancestor of occurrence below the property owner to speed up future calls

Returns

String

Property value

getActivePropertyValues

Get the value of a property on the first parent that own it for each given occurrence

scene.getActivePropertyValues(occurrences, propertyName, cacheProperty) -> core.StringList

Parameters

occurrences OccurrenceList

List of occurrences

propertyName String

Property name

cacheProperty Boolean

If true, the property will be copied on all ancestor of occurrence below the property owner to speed up future calls

Returns

StringList

Property value for each occurrence

getAncestors

Returns the list of ancestors for one occurrence

scene.getAncestors(occurrence) -> scene.OccurrenceList

Parameters

occurrence Occurrence

The occurrence to test.

Returns

OccurrenceList

The list of ancestors.

getComponent

Returns a component on an occurrence

scene.getComponent(occurrence, componentType, followPrototypes) -> scene.Component

Parameters

occurrence Occurrence

The occurrence

componentType ComponentType

Type of the component

followPrototypes Bool

If true and if the component is not set on the occurrence, try to find it on its prototyping chain

Returns

Component

The component

getComponentByOccurrence

Returns one component of the specified type by occurrence if it exists

scene.getComponentByOccurrence(occurrences, componentType, followPrototypes) -> scene.ComponentList

Parameters

occurrences OccurrenceList

The occurrences list

componentType ComponentType

Type of the component

followPrototypes Bool

If true and if the component is not set on the occurrence, try to find it on its prototyping chain

Returns

ComponentList

List of component synchronized with occurrences

getComponentOccurrence

Get the occurrence that own a component

scene.getComponentOccurrence(component) -> scene.Occurrence

Parameters

component Component

The component

Returns

Occurrence

The occurrence

getComponentType

Get the type of a component

scene.getComponentType(component) -> scene.ComponentType

Parameters

component Component

The component

Returns

ComponentType

Type of the component

getGlobalMatrix

Returns the global matrix on an occurrence

scene.getGlobalMatrix(occurrence) -> geom.Matrix4

Parameters

occurrence Occurrence

Occurrence to get the global matrix

Returns

Matrix4

The global matrix of the occurrence

getGlobalVisibility

Returns the global visibility of a given occurrence

scene.getGlobalVisibility(occurrence) -> core.Boolean

Parameters

occurrence Occurrence

Occurrence to get the global visibility

Returns

Boolean

True if the occurrence is visible, else False

getLocalMatrix

Returns the local matrix on an occurrence

scene.getLocalMatrix(occurrence) -> geom.Matrix4

Parameters

occurrence Occurrence

Node to get the local matrix

Returns

Matrix4

The node local matrix

getMBB

Returns the Minimum Bounding Box of a list of scene paths

scene.getMBB(occurrences) -> geom.MBB

Parameters

occurrences OccurrenceList

List of occurrences to retrieve the AABB

Returns

MBB

The minimum bounding box of all given occurrences

getMaterialsFromSubtree

scene.getMaterialsFromSubtree(occurrence) -> material.MaterialList

Parameters

occurrence Occurrence

Root occurrence of the subtree on which to get the materials and images

Returns

MaterialList

The retrieved materials

getOBB

Returns the Oriented Bounding Box of a list of scene paths (works only on meshes, fast method, not the Minimum Volume Box)

scene.getOBB(occurrences) -> geom.OBB

Parameters

occurrences OccurrenceList

List of occurrences to retrieve the AABB

Returns

OBB

The oriented bounding box of all given occurrences

getOccurrenceActiveMaterial

Returns the active material on a given occurrence

scene.getOccurrenceActiveMaterial(occurrence) -> material.Material

Parameters

occurrence Occurrence

Occurrence to get the active material

Returns

Material

The active material of the occurrence

getOccurrenceName

Returns the name of an occurrence

scene.getOccurrenceName(occurrence) -> core.String

Parameters

occurrence Occurrence

The occurrence to get the name

Returns

String

The occurrence name

getOccurrencesWithComponent

Recursively get all the occurrences containing a component of the specified type

scene.getOccurrencesWithComponent(componentType, fromOcc) -> scene.OccurrenceList

Parameters

componentType ComponentType

The component type

fromOcc Occurrence

Source occurrence of the recursion

Returns

OccurrenceList

Result occurrences

getPartActiveShape

Returns the active shape of a part

scene.getPartActiveShape(part) -> scene.Shape

Parameters

part Part

The part

Returns

Shape

The active shape of a part

getPartOccurrences

Recursively get all the occurrences containing a part component

scene.getPartOccurrences(fromOcc) -> scene.OccurrenceList

Parameters

fromOcc Occurrence

Source occurrence of the recursion

Returns

OccurrenceList

Result occurrences

getPartShapeType

Get the part's shape type

scene.getPartShapeType(part) -> scene.ShapeType

Parameters

part Part

The part to test

Returns

ShapeType

Shape's type

getPolygonCount

Returns the number of polygon in the parts meshes

scene.getPolygonCount(occurrences, asTriangleCount, countOnceEachInstance, countHidden) -> core.ULong

Parameters

occurrences OccurrenceList

The part occurrences

asTriangleCount Bool

If true count the equivalent of triangles for each polygon

countOnceEachInstance Bool

If true ignore multiple instance of each tessellation

countHidden Bool

If true, also count hidden components

Returns

ULong

The 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

Parameters

roots OccurrenceList

The root occurrences to get stats on.

Returns

ULong

Number of parts in the sub-tree (instances are counted once)

getVertexCount

Returns the number of vertices in the parts meshes

scene.getVertexCount(occurrences, countOnceEachInstance, countHidden, countPoints, countMergedVertices) -> core.ULong

Parameters

occurrences OccurrenceList

The part occurrences

countOnceEachInstance Bool

If true ignore multiple instance of each tessellation

countHidden Bool

If true, also count hidden components

countPoints Bool

If true, also count points (for points cloud)

countMergedVertices Bool

If true count all merged vertices in each tessellation

Returns

ULong

The number of vertices

getViewpointsFromCavities

Returns viewpoints from model cavities

scene.getViewpointsFromCavities(voxelSize, minCavityVolume) -> geom.Point3List, geom.Point3List

Parameters

voxelSize Distance

Precision for cavities detection

minCavityVolume Distance

Minimum volume for a cavity to be returned

Returns

Point3List

List of viewpoint positions

hasComponent

Returns True if the given occurrence has the given component type

scene.hasComponent(occurrence, componentType, followPrototypes) -> core.Boolean

Parameters

occurrence Occurrence

The occurrence

componentType ComponentType

Type of the component

followPrototypes Bool

If true and if the component is not set on the occurrence, try to find it on its prototyping chain

Returns

Boolean

hide

Hide the given occurrence

scene.hide(occurrence)

Parameters

occurrence Occurrence

The occurrence to hide

inverseVisibility

Inverse the visibility of the given occurrence

scene.inverseVisibility(occurrence)

Parameters

occurrence Occurrence

The occurrence

isAncestorOf

Test if the occurrences are ancestors to one another.

scene.isAncestorOf(occurrence1, occurrence2) -> core.Bool

Parameters

occurrence1 Occurrence

First occurrence to test.

occurrence2 Occurrence

Second occurrence to test.

Returns

Bool

If occurrences are ancestor to one another.

listComponent

List all components on a type on the whole tree

scene.listComponent(componentType) -> scene.ComponentList

Parameters

componentType ComponentType

The component type

Returns

ComponentList

The component list of the type chosen

listComponents

List all components on an occurrence

scene.listComponents(occurrence, followPrototypes) -> scene.ComponentList

Parameters

occurrence Occurrence

The occurrence to list the components

followPrototypes Bool

If true list also components owned by the prototype

Returns

ComponentList

The components owned by the occurrence

mergeImages

Merge all equivalent images (i.e. with same pixels)

scene.mergeImages(images) -> core.Int

Parameters

images ImageList

Images to merge (merge all images if empty)

Returns

Int

The number of texture after the merge

mergeMaterials

Merge all equivalent materials (i.e. with same appearance)

scene.mergeMaterials(materials, evaluateNames) -> core.Int

Parameters

materials MaterialList

Materials to merge (merge all materials if empty)

evaluateNames Boolean

If 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

Int

The number of material after the merge

removeMaterials

Recursively remove all materials

scene.removeMaterials(roots)

Parameters

roots OccurrenceList

If 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

maxLength Int

Maximum name length

replaceMaterial

Replace a material by another everywhere it is used

scene.replaceMaterial(originalMaterial, newMaterial, occurrences)

Parameters

originalMaterial Material

The material to replace everywhere

newMaterial Material

The new material to set in place of originalMaterial

occurrences OccurrenceList

The 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

inputMode ResizeTexturesInputMode

Defines if the textures to resize are textures used by a selection of Occurrences, or a selection among the textures available in the scene

resizeMode ResizeTexturesResizeMode

Defines if the textures are resized following a ratio or following a maximum size/resolution (only textures above the defined maximum are downsized)

replaceTextures Bool

If True, overwrites textures from the selection

setComponentOccurrence

Move a component to an occurrence

scene.setComponentOccurrence(component, occurrence)

Parameters

component Component

The component

occurrence Occurrence

The occurrence

setDefaultVariant

Set the default variant

scene.setDefaultVariant()

setOccurrenceMaterial

Set the material on a occurrence

scene.setOccurrenceMaterial(occurrence, material)

Parameters

occurrence Occurrence

Occurrence to set the material

material Material

The new occurrence material

setOccurrenceName

Returns the name of an occurrence

scene.setOccurrenceName(occurrence, name)

Parameters

occurrence Occurrence

The occurrence to get the name

name String

The occurrence name

show

Show the given occurrence

scene.show(occurrence)

Parameters

occurrence Occurrence

The occurrence to show

showOnly

Show only the given occurrence

scene.showOnly(occurrence)

Parameters

occurrence Occurrence

The occurrence to show

transferCADMaterialsOnPartOccurrences

Set all materials on part occurrences

scene.transferCADMaterialsOnPartOccurrences(rootOccurrence)

Parameters

rootOccurrence Occurrence

Root occurrence

transferMaterialsOnPatches

Take the first instance material and set it one the mesh patches

scene.transferMaterialsOnPatches(rootOccurrence)

Parameters

rootOccurrence Occurrence

Root occurrence

createCapsule

scene.createCapsule(radius, height, subdivisionLatitude, subdivisionLongitude, generateUV) -> scene.Occurrence

Parameters

radius Double

Radius of the Capsule

height Double

Height of the Capsule (excluding the two size of half spheres)

subdivisionLatitude Int

Subdivision of the Capsule on the Latitude

subdivisionLongitude Int

Subdivision of the Capsule (two half spheres) on the Longitude

generateUV Boolean

Generation of the UV

Returns

Occurrence

The created Occurrence

createCone

scene.createCone(bottomRadius, height, sides, generateUV) -> scene.Occurrence

Parameters

bottomRadius Double

Radius of the bottom of the cone

height Double

Height of the cone

sides Int

Number of sides of the cone

generateUV Boolean

Generation of the UV

Returns

Occurrence

The created Occurrence

createCube

scene.createCube(sizeX, sizeY, sizeZ, subdivision, generateUV) -> scene.Occurrence

Parameters

sizeX Double

Size of the Cube on the x axis

sizeY Double

Size of the Cube on the y axis

sizeZ Double

Size of the Cube on the z axis

subdivision Int

Subdivision of the Cube on all the axis

generateUV Boolean

Generation of the UV

Returns

Occurrence

The created Occurrence

createCylinder

scene.createCylinder(radius, height, sides, generateUV) -> scene.Occurrence

Parameters

radius Double

Radius of the Cylinder

height Double

Height of the Cylinder

sides Int

Number of Sides of the Cylinder

generateUV Boolean

Generation of the UV

Returns

Occurrence

The created Occurrence

createImmersion

scene.createImmersion(radius, subdivisionX, subdivisionY) -> scene.Occurrence

Parameters

radius Double

Radius of the Immersion

subdivisionX Int

Subdivision of the Immersion on the Latitude

subdivisionY Int

Subdivision of the Immersion on the Longitude

Returns

Occurrence

The created Occurrence

createPlane

scene.createPlane(sizeY, sizeX, subdivisionX, subdivisionY, generateUV) -> scene.Occurrence

Parameters

sizeY Double

Size of the Plane on the y axis

sizeX Double

Size of the Plane on the x axis

subdivisionX Int

Subdivision of the Plane on the x axis

subdivisionY Int

Subdivision of the Plane on the y axis

generateUV Boolean

Generation of the UV

Returns

Occurrence

The created Occurrence

createSphere

scene.createSphere(radius, subdivisionLatitude, subdivisionLongitude, generateUV) -> scene.Occurrence

Parameters

radius Double

Radius of the Sphere

subdivisionLatitude Int

Subdivision of the Sphere on the Latitude

subdivisionLongitude Int

Subdivision of the Sphere on the Longitude

generateUV Boolean

Generation of the UV

Returns

Occurrence

The created Occurrence

createTorus

scene.createTorus(majorRadius, minorRadius, subdivisionLatitude, subdivisionLongitude) -> scene.Occurrence

Parameters

majorRadius Double

Major Radius

minorRadius Double

Minor Radius

subdivisionLatitude Int

Subdivision of the Torus on the Latitude

subdivisionLongitude Int

Subdivision of the Torus on the Longitude

Returns

Occurrence

The created Occurrence

findDuplicatedPartOccurrences

scene.findDuplicatedPartOccurrences(root, acceptVolumeRatio, acceptPolycountRatio, acceptAABBAxisRatio, acceptAABBCenterDistance) -> scene.OccurrenceList

Parameters

root Occurrence

Root occurrence for the process

acceptVolumeRatio Real

If the ratio of volumes of two part is lower than acceptVolumeRatio, they will be considered duplicated

acceptPolycountRatio Real

If the ratio of polygon counts of two part is lower than acceptPolycountRatio, they will be considered duplicated

acceptAABBAxisRatio Real

If the ratio of AABB axis of two part is lower than acceptAABBAxisRatio, they will be considered duplicated

acceptAABBCenterDistance Distance

If the ratio of AABB centers of two part is lower than acceptAABBCenterRatio, they will be considered duplicated

Returns

OccurrenceList

Duplicated part occurrences

findOccurrencesByMaterial

scene.findOccurrencesByMaterial(material) -> scene.OccurrenceList

Parameters

material Material

A material

Returns

OccurrenceList

The list of occurrences meeting the criteria

findOccurrencesByMetadata

scene.findOccurrencesByMetadata(property, regex, roots, caseInsensitive) -> scene.OccurrenceList

Parameters

property String

Property name

regex Regex

Regular expression (ECMAScript)

roots OccurrenceList

If specified, restrict the search from the given roots

caseInsensitive Bool

If True, the regex will be insensitive to upper and lower cases

Returns

OccurrenceList

Occurrences which matches the given regular expression

findOccurrencesByMetadataValue

scene.findOccurrencesByMetadataValue(regex, roots, caseInsensitive) -> scene.OccurrenceList

Parameters

regex Regex

Regular expression (ECMAScript)

roots OccurrenceList

If specified, restrict the search from the given roots

caseInsensitive Bool

If True, the regex will be insensitive to upper and lower cases

Returns

OccurrenceList

Occurrences which matches the given regular expression

findOccurrencesByProperty

scene.findOccurrencesByProperty(property, regex, roots, caseInsensitive) -> scene.OccurrenceList

Parameters

property String

Property name

regex Regex

Regular expression (ECMAScript)

roots OccurrenceList

If specified, restrict the search from the given roots

caseInsensitive Bool

If True, the regex will be insensitive to upper and lower cases

Returns

OccurrenceList

Occurrences which matches the given regular expression

findPartOccurrencesByActiveMaterial

scene.findPartOccurrencesByActiveMaterial(material, roots) -> scene.OccurrenceList

Parameters

material Material

A material

roots OccurrenceList

If specified, restrict the search from the given roots

Returns

OccurrenceList

Occurrences of parts with the given material as active material

findPartOccurrencesByMaximumSize

scene.findPartOccurrencesByMaximumSize(roots, maxDiagLength, maxSize, getHidden) -> scene.OccurrenceList

Parameters

roots OccurrenceList

Roots occurrences for the process

maxDiagLength Distance

If the diagonal axis of the bounding box is less than maxDiagLength, part will be filtered. -1 to ignore

maxSize Distance

If the longer axis of the box is less than maxLength, part will be filtered. -1 to ignore

getHidden Boolean

If true, hidden part occurrences meeting the criteria will be filtered as well

Returns

OccurrenceList

The list of occurrences meeting the criteria

findPartOccurrencesByMinimumNumberOfInstances

scene.findPartOccurrencesByMinimumNumberOfInstances(minInstanciationCount) -> scene.OccurrenceList

Parameters

minInstanciationCount Int

Min occurrence count

Returns

OccurrenceList

The list of occurrences meeting the criteria

findPartOccurrencesByVisibleMaterial

scene.findPartOccurrencesByVisibleMaterial(material) -> scene.OccurrenceList

Parameters

material Material

A material

Returns

OccurrenceList

The list of occurrences meeting the criteria

findPartOccurrencesInAABB

find part occurrences in the scene in a given axis aligned bounding box

See also:

scene.findPartOccurrencesInAABB(aabb) -> scene.OccurrenceList

Parameters

aabb AABB

The axis aligned bounding box

Returns

OccurrenceList

Occurrences found in the given axis aligned bounded box

findPartOccurrencesInBox

get part occurrences contained in a given box

See also:

scene.findPartOccurrencesInBox(box, strictlyIncludes) -> scene.OccurrenceList

Parameters

box ExtendedBox

The extension box

strictlyIncludes Boolean

If false, parts only need to intersect the box to be selected

Returns

OccurrenceList

Part occurrences contained in the box

createSubTree

scene.createSubTree(tree, root, replaceRoot) -> scene.OccurrenceList

Parameters

tree PackedTree
root Occurrence

Specify the root occurrence of the scene

replaceRoot Bool

If true, the root occurrence will be replaced by the root of the given tree, else it will be added as a child

Returns

OccurrenceList

Create occurrences (equivalent to tree.occurrences)

getChildren

scene.getChildren(occurrence) -> scene.OccurrenceList

Parameters

occurrence Occurrence

The occurrence

Returns

OccurrenceList

Children occurrences

getCurrentVariantRoot

scene.getCurrentVariantRoot() -> scene.Occurrence

Returns

Occurrence

The active variant root occurrence or global root if no active variant.

getOccurrenceAncestors

scene.getOccurrenceAncestors(occurrence) -> scene.OccurrenceList

Parameters

occurrence Occurrence

The occurrence to find ancestors

Returns

OccurrenceList

List of ancestors (start with the root and end with occurrence parent). Empty if occurrence is a root

getOccurrencesAncestors

scene.getOccurrencesAncestors(occurrences) -> scene.OccurrenceListList

Parameters

occurrences OccurrenceList

The list of occurrences to find ancestors

Returns

OccurrenceListList

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

getParent

scene.getParent(occurrence) -> scene.Occurrence

Parameters

occurrence Occurrence

The occurrence

Returns

Occurrence

The parent occurrence

getRoot

scene.getRoot() -> scene.Occurrence

Returns

Occurrence

The root occurrence

getSubTree

scene.getSubTree(root, visibilityMode, depth) -> scene.PackedTree

Parameters

root Occurrence

Specify the root of the returned scene

visibilityMode VisibilityMode

The visibility mode

depth Int

Maximum depth

Returns

PackedTree

moveOccurrences

Move an occurrence, adjusting the transformation to keep objects at the same place in the world space

See also:

scene.moveOccurrences(occurrences, destination, insertBefore=0)

Parameters

occurrences OccurrenceList

The occurrences to move

destination Occurrence

Destination occurrence (the new parent)

insertBefore Occurrence

Occurrence before witch to move, if null append to destination children

setParent

scene.setParent(occurrence, parent, addInParentInstances=False, insertBefore, worldPositionStays=False)

Parameters

occurrence Occurrence

The occurrence

parent Occurrence

The parent occurrence

addInParentInstances Boolean

If True, each occurrence whose prototype is the target parent will generate a child whose prototype is the occurrence itself

insertBefore Occurrence

Add before this child occurrence in the children list of the parent occurrence

worldPositionStays Boolean

If 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.

addLightComponent

Add a light component to an occurrence

See also:

scene.addLightComponent(occurrence, lightType, color, power, cutOff) -> scene.Component

Parameters

occurrence Occurrence

The occurrence to add the new component

lightType LightType

The type of the light

color Color

Color of the light

power Double

The power of the light

cutOff Angle

The cutoff angle of the light

Returns

Component

The new component added to occurrence

createLight

Create an occurrence with a light component

See also:

scene.createLight(name, lightType, color, power, cutOff, parent) -> scene.Occurrence

Parameters

name String

Name of the light

lightType LightType

The type of the light

color Color

Color of the light

power Double

The power of the light

cutOff Angle

The cutoff angle of the light

parent Occurrence

The parent of the light occurrence

Returns

Occurrence

The light created

addMetadata

scene.addMetadata(metadata, name, value)

Parameters

metadata Metadata

The metadata component

name String

The new property name

value String

The new property value

addMetadataBlock

scene.addMetadataBlock(metadata, names, values)

Parameters

metadata Metadata

The metadata component

names StringList

The new properties names

values StringList

The new properties values

createMetadatasFromDefinitions

scene.createMetadatasFromDefinitions(occurrences, definitions) -> scene.MetadataList

Parameters

occurrences OccurrenceList

List of occurrences to add the metadata components

definitions MetadataDefinitionList

List of metadata definition

Returns

MetadataList

List of metadata components created from definitions (if definition is empty no component is created)

getMetadata

scene.getMetadata(metadata, name) -> core.String

Parameters

metadata Metadata

The metadata component

name String

The metadata property name

Returns

String

The property value

getMetadatasDefinitions

scene.getMetadatasDefinitions(metadatas) -> scene.MetadataDefinitionList

Parameters

metadatas MetadataList

List of metadata component to retrieve definition

Returns

MetadataDefinitionList

List of metadata definition for each given metadata component

removeMetadata

scene.removeMetadata(metadata, name)

Parameters

metadata Metadata

The occurrence

name String

The name of the property

configureOoC

Set and configure an Out of Core component implementation

Warning

This function is tagged as EXPERIMENTAL.

See also:

scene.configureOoC(ooc, implementationType, implementationParameters)

Parameters

ooc OoCComponent

An OoC component

implementationType String

An implementation type (see listOoCImplementations)

implementationParameters String

Depends of implementation type

getOoCConfiguration

Get the current configuration of an Out of Core component

Warning

This function is tagged as EXPERIMENTAL.

See also:

scene.getOoCConfiguration(ooc) -> core.String, core.String

Parameters

ooc OoCComponent

An OoC component

Returns

String

The implementation type of the given ooc

listOoCImplementations

Warning

This function is tagged as EXPERIMENTAL.

See also:

scene.listOoCImplementations() -> core.StringList

Returns

StringList

All available Out of Core implementation types

loadOoC

Ask an Out of Core component to load its sub-scene

Warning

This function is tagged as EXPERIMENTAL.

See also:

scene.loadOoC(ooc)

Parameters

ooc OoCComponent

An OoC component

unloadOoC

Ask an Out of Core component to unload its sub-scene

Warning

This function is tagged as EXPERIMENTAL.

See also:

scene.unloadOoC(ooc)

Parameters

ooc OoCComponent

An OoC component

getSubpartMaterial

scene.getSubpartMaterial(occurrence, subpartIndex) -> material.Material

Parameters

occurrence Occurrence

The Occurrence

subpartIndex UInt

The subpart index

Returns

Material

The assigned material

listActiveShapeMaterials

scene.listActiveShapeMaterials(part) -> material.MaterialList

Parameters

part Part

The part which contains sub materials

Returns

MaterialList

Used materials

listSubpartMaterials

scene.listSubpartMaterials(occurrence) -> material.MaterialList

Parameters

occurrence Occurrence

The occurrence which contains sub materials

Returns

MaterialList

Used materials

listSubpartVariantMaterials

scene.listSubpartVariantMaterials(occurrence) -> scene.VariantMaterialList

Parameters

occurrence Occurrence

The occurrence which contains variants

Returns

VariantMaterialList

List of variant and materials

setSubpartMaterial

scene.setSubpartMaterial(occurrence, subpartIndex, material)

Parameters

occurrence Occurrence

The Occurrence

subpartIndex UInt

The subpart index

material Material

The material

setSubpartVariantMaterials

scene.setSubpartVariantMaterials(occurrence, variantMaterials)

Parameters

occurrence Occurrence

The occurrence which contains variants

variantMaterials VariantMaterialList

List of variant and materials

setSubpartVariantMaterialsList

scene.setSubpartVariantMaterialsList(variants, materialListList) -> scene.VariantMaterialList

Parameters

variants VariantList

The part which contains variants

materialListList MaterialListList

The part which contains the list of material variant list

Returns

VariantMaterialList

List of variant and materials

transferSubpartMaterialsOnPatches

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

See also:

scene.transferSubpartMaterialsOnPatches(occurrence)

Parameters

occurrence Occurrence

The occurrence which has sub materials assigned

createAlternativeTree

Create a new alternative tree

See also:

scene.createAlternativeTree(name, root) -> scene.AlternativeTree

Parameters

name String

The name of the new alternative tree

root Occurrence

The root occurrence

Returns

AlternativeTree

The new alternative tree

getAlternativeTreeRoot

Returns the root occurrence associated with the given AlternativeTree

See also:

scene.getAlternativeTreeRoot(tree) -> scene.Occurrence

Parameters

tree AlternativeTree

Targeted alternative tree

Returns

Occurrence

The root occurrence

listAlternativeTrees

Returns all the available alternative trees

See also:

scene.listAlternativeTrees() -> scene.AlternativeTreeList

Returns

AlternativeTreeList

All alternative trees

addAnimation

scene.addAnimation(animation)

Parameters

animation Animation

Animation to add

addKeyframe

scene.addKeyframe(channel, time, value) -> scene.Keyframe

Parameters

channel AnimChannel

The channel one wants to add a keyframe in

time AnimationTime

The time

value Double

The value

Returns

Keyframe

The corresponding keyframe

addKeyframeFromCurrentPosition

scene.addKeyframeFromCurrentPosition(channel, time)

Parameters

channel AnimChannel

The channel one wants to add a keyframe in

time AnimationTime

The time

animatesThisOccurrence

scene.animatesThisOccurrence(animation, occurrence) -> core.Bool

Parameters

animation Animation

The Animation

occurrence Occurrence

The supposedly animated occurrence

Returns

Bool

The answer to this question

bakeAnimation

scene.bakeAnimation(animation, occurrence, end, interval)

Parameters

animation Animation

The Animation

occurrence Occurrence

The occurrence

end Occurrence

The parent occurrence

interval AnimationTime

The interval

createAnimation

scene.createAnimation(name) -> scene.Animation

Parameters

name String

Name of the animation

Returns

Animation

The created animation

createSkeletonMesh

scene.createSkeletonMesh(root) -> scene.Occurrence

Parameters

root Occurrence

Root joint component node

Returns

Occurrence

New occurrence containing the skeleton mesh

decimateAnimChannelBySegment

scene.decimateAnimChannelBySegment(channel, precision)

Parameters

channel AnimChannel

The channel

precision Double

The precision

deleteAnimation

scene.deleteAnimation(animation)

Parameters

animation Animation

The created animation

deleteEmptyAnimation

scene.deleteEmptyAnimation()

displayAllKeyframesFromAnimChannel

scene.displayAllKeyframesFromAnimChannel(channel)

Parameters

channel AnimChannel

The channel

displayAllKeyframesFromAnimation

scene.displayAllKeyframesFromAnimation(animation)

Parameters

animation Animation

The animation

displayValueFromAnimChannelAtTime

scene.displayValueFromAnimChannelAtTime(channel, time, defaultValue=False)

Parameters

channel AnimChannel

The channel

time AnimationTime

The time

defaultValue Bool

Show default instead ?

getAnimChannelIfExists

scene.getAnimChannelIfExists(animation, occurrence) -> scene.AnimChannel

Parameters

animation Animation

The Animation

occurrence Occurrence

The Occurrence

Returns

AnimChannel

The channel

getAnimChannelInfo

scene.getAnimChannelInfo(channel) -> scene.AnimChannelInfo

Parameters

channel AnimChannel

Animation to get info of

Returns

AnimChannelInfo

getAnimChannelOccurrence

scene.getAnimChannelOccurrence(channel) -> scene.Occurrence

Parameters

channel AnimChannel

The channel

Returns

Occurrence

The corresponding occurrence

getAnimationComponentPropertyBinderLists

scene.getAnimationComponentPropertyBinderLists(animationComponent) -> scene.AnimPropertyBinderList

Parameters

animationComponent AnimationComponent

Animation to get info of

Returns

AnimPropertyBinderList

getAnimationInfo

scene.getAnimationInfo(animation) -> scene.AnimationInfo

Parameters

animation Animation

Animation to get info of

Returns

AnimationInfo

getAnimationPropertyBinderLists

scene.getAnimationPropertyBinderLists(animation) -> scene.AnimPropertyBinderList

Parameters

animation Animation

Animation to get info of

Returns

AnimPropertyBinderList

getJointDefinition

scene.getJointDefinition(joint) -> scene.JointDefinition

Parameters

joint Joint

Id of the joint

Returns

JointDefinition

The jointDefinition matching the id provided

getJointDefinitions

scene.getJointDefinitions(joints) -> scene.JointDefinitionList

Parameters

joints JointList

Ids of joints

Returns

JointDefinitionList

An array of all jointDefinition matching joint provided

getKeyframeParentAnimChannel

scene.getKeyframeParentAnimChannel(keyframe) -> scene.AnimChannel

Parameters

keyframe Keyframe

The keyframe one wants the parent of

Returns

AnimChannel

The Parent

getKeyframes

scene.getKeyframes(channel) -> scene.KeyframeList

Parameters

channel AnimChannel

The channel one wants to extract the keyframs from

Returns

KeyframeList

The list of keyframes

getMainChannel

scene.getMainChannel(channel) -> scene.AnimChannel

Parameters

channel AnimChannel

The channel one wants the main of

Returns

AnimChannel

The corresponding main Channel

getOccurrenceJoint

scene.getOccurrenceJoint(occurrence) -> polygonal.Joint

Parameters

occurrence Occurrence

The occurrence

Returns

Joint

The joint assigned to the given occurrence

getParentChannel

scene.getParentChannel(channel) -> scene.AnimChannel

Parameters

channel AnimChannel

The channel one wants the parent of

Returns

AnimChannel

The corresponding parent Channel

getSubChannel

scene.getSubChannel(channel, name) -> scene.AnimChannel

Parameters

channel AnimChannel

The channel one wants the subchannel of

name String

The name of the subchannel

Returns

AnimChannel

The corresponding subchannel

getSubChannels

scene.getSubChannels(channel) -> scene.AnimChannelList

Parameters

channel AnimChannel

The channel one wants the subchannel of

Returns

AnimChannelList

The list of direct sub channels

linkPropertyToAnimation

scene.linkPropertyToAnimation(animation, entity, propertyName) -> scene.AnimChannel

Parameters

animation Animation

The Animation stack where to put a animated property

entity Entity

The entity object to animate

propertyName String

The name of the property to animate

Returns

AnimChannel

The main channel of the binder

listAnimations

scene.listAnimations() -> scene.AnimationList

Returns

AnimationList

The list containing animations

listMainChannels

scene.listMainChannels(animation) -> scene.AnimChannelList

Parameters

animation Animation

The Animation one wants to list the channels from

Returns

AnimChannelList

The list containing the AnimChannels

makeDefaultKeyframe

scene.makeDefaultKeyframe(channel)

Parameters

channel AnimChannel

The channel

moveAnimation

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

Parameters

animation Animation

The Animation

target Occurrence

The target occurrence

newParent Occurrence

The new parent occurrence

interval AnimationTime

The interval

removeKeyframe

scene.removeKeyframe(channel, time)

Parameters

channel AnimChannel

The channel one wants to remove a keyframe from

time AnimationTime

The time

unlinkPropertyToAnimation

scene.unlinkPropertyToAnimation(animation, entity, propertyName)

Parameters

animation Animation

The Animation stack where to put a animated property

entity Entity

The entity object to animate

propertyName String

The name of the property to animate

getBRepInfos

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

Returns

Int

The part count

getTessellationInfos

scene.getTessellationInfos(root) -> 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

root Occurrence

Occurrence tree root

Returns

Int

The part count

print

Print an occurrence tree on log

See also:

scene.print(root=0)

Parameters

root Occurrence

Occurrence tree root

addFilterToLibrary

scene.addFilterToLibrary(name, expr) -> core.Ident

Parameters

name String

Name of the filter

expr FilterExpression

The filter expression

Returns

Ident

Identifier of the created filter

evaluateExpression

scene.evaluateExpression(filter) -> core.String

Parameters

filter FilterExpression

The filter expression

Returns

String

Result of the given expression

evaluateExpressionOnOccurrences

scene.evaluateExpressionOnOccurrences(occurrences, filter) -> core.StringList

Parameters

occurrences OccurrenceList

Occurrences on which to evaluate the expression

filter FilterExpression

The filter expression

Returns

StringList

The evaluation of the expression on the occurrence at the same index in given occurrences

evaluateExpressionOnSubTree

scene.evaluateExpressionOnSubTree(filter, fromOcc) -> scene.OccurrenceList, core.StringList

Parameters

filter FilterExpression

The filter expression

fromOcc Occurrence

Source occurrence of the recursion

Returns

OccurrenceList

exportFilterLibrary

scene.exportFilterLibrary(file)

Parameters

file FilePath

File path to export

findFilterByName

scene.findFilterByName(name) -> scene.Filter

Parameters

name String

Name of the filter to retrieve (case sensitive)

Returns

Filter

The retrieved filter

getFilterExpression

scene.getFilterExpression(filterId) -> scene.FilterExpression

Parameters

filterId Ident

Identifier of the filter to fetch

Returns

FilterExpression

Filter expression

getFilterFromLibrary

scene.getFilterFromLibrary(filterId) -> scene.Filter

Parameters

filterId Ident

Identifier of the filter to retrieve

Returns

Filter

The retrieved filter

getFilteredOccurrences

scene.getFilteredOccurrences(filter, fromOcc) -> scene.OccurrenceList

Parameters

filter FilterExpression

The filter expression

fromOcc Occurrence

Source occurrence of the recursion

Returns

OccurrenceList

Result occurrences

importFilterLibrary

scene.importFilterLibrary(file)

Parameters

file FilePath

File containing the filter library

listFilterLibrary

scene.listFilterLibrary() -> scene.FilterList

Returns

FilterList

All the filters stored in the filter library

removeFilterFromLibrary

scene.removeFilterFromLibrary(filterId)

Parameters

filterId Ident

Identifier of the filter to remove

isolate

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

See also:

scene.isolate(occurrences)

Parameters

occurrences OccurrenceList

Occurrences to isolate

unisolate

Exit the isolate mode

See also:

scene.unisolate()

findPartOccurrencesWithUnstitchedFaces

scene.findPartOccurrencesWithUnstitchedFaces(root) -> scene.OccurrenceList

Parameters

root Occurrence

Root occurrence

Returns

OccurrenceList

Unstitched faces occurrences

mergeOccurrencesByTreeLevel

scene.mergeOccurrencesByTreeLevel(roots, maxLevel=5, mergeHiddenPartsMode=2)

Parameters

roots OccurrenceList

Roots occurrences for the process

maxLevel Int

Maximum tree level

mergeHiddenPartsMode MergeHiddenPartsMode

Hidden parts handling mode, Destroy them, make visible or merge separately

mergePartOccurrences

scene.mergePartOccurrences(partOccurrences, mergeHiddenPartsMode) -> scene.OccurrenceList

Parameters

partOccurrences OccurrenceList

Occurrence of the parts to merge

mergeHiddenPartsMode MergeHiddenPartsMode

Hidden parts handling mode, Destroy them, make visible or merge separately

Returns

OccurrenceList

Resulting merged occurrences

mergePartOccurrencesByAssemblies

scene.mergePartOccurrencesByAssemblies(roots, mergeHiddenPartsMode=2)

Parameters

roots OccurrenceList

Roots occurrences for the process (will not be removed)

mergeHiddenPartsMode MergeHiddenPartsMode

Hidden parts handling mode, Destroy them, make visible or merge separately

mergePartOccurrencesByFinalAssemblies

scene.mergePartOccurrencesByFinalAssemblies(roots, mergeHiddenPartsMode=2, CollapseToParent=True)

Parameters

roots OccurrenceList

Roots occurrences for the process (will not be removed)

mergeHiddenPartsMode MergeHiddenPartsMode

Hidden parts handling mode, Destroy them, make visible or merge separately

CollapseToParent Boolean

If true, final level unique merged part will replace it's parent

mergePartOccurrencesByMaterials

scene.mergePartOccurrencesByMaterials(partOccurrences, mergeNoMaterials, mergeHiddenPartsMode, combineMeshes) -> scene.OccurrenceList

Parameters

partOccurrences OccurrenceList

Occurrence of the parts to merge

mergeNoMaterials Boolean

If true, merge all parts with no active material together, else do not merge them

mergeHiddenPartsMode MergeHiddenPartsMode

Hidden parts handling mode, Destroy them, make visible or merge separately

combineMeshes Boolean

If true, explode and remerge the input parts by visible materials

Returns

OccurrenceList

Resulting merged occurrences

mergePartOccurrencesByName

scene.mergePartOccurrencesByName(root=0, mergeHiddenPartsMode=2)

Parameters

root Occurrence

Root occurrence of the subtree to process

mergeHiddenPartsMode MergeHiddenPartsMode

Hidden parts handling mode, Destroy them, make visible or merge separately

mergePartOccurrencesByRegions

scene.mergePartOccurrencesByRegions(roots, mergeBy, strategy) -> scene.OccurrenceList

Parameters

roots OccurrenceList

Roots occurrences for the process (will not be removed)

mergeBy MergeByRegionsStrategy

Number: number of output parts (or regions of parts)\nSize: diagonal size of output regions

strategy MergeStrategy

Choose the regions merging strategy

Returns

OccurrenceList

Resulting merged occurrences

mergePartOccurrencesWithOpenShells

scene.mergePartOccurrencesWithOpenShells(root) -> scene.OccurrenceList

Parameters

root Occurrence

Root of the main assembly to merge

Returns

OccurrenceList

List of the merged occurrence that contained only openShell

applyTransformation

apply a transformation to the local matrix of an occurrence

See also:

scene.applyTransformation(occurrence, matrix)

Parameters

occurrence Occurrence

Occurrence to apply the matrix on

matrix Matrix4

Transformation to matrix

createSymmetry

Create symmetries from selection

See also:

scene.createSymmetry(occurrences, plane)

Parameters

occurrences OccurrenceList

Selection of occurrences

plane AxisPlane

Symmetry plane

rotate

Modify the local matrix of the scene node to apply a rotation

See also:

scene.rotate(occurrence, axis, angle)

Parameters

occurrence Occurrence

Occurrence to rotate

axis Vector3

Axis of rotation

angle Angle

Angle of rotation

setLocalMatrix

change the local matrix on an occurrence

See also:

scene.setLocalMatrix(occurrence, matrix)

Parameters

occurrence Occurrence

Occurrence to set the local matrix

matrix Matrix4

The new occurrence local matrix

getPartMesh

scene.getPartMesh(part) -> polygonal.Mesh

Parameters

part Part

The part component

Returns

Mesh

The mesh of the tessellated shape of the part

getPartModel

scene.getPartModel(part) -> cad.Model

Parameters

part Part

The part component

Returns

Model

The model of the BRep shape of the part

getPartsMeshes

scene.getPartsMeshes(parts) -> polygonal.MeshList

Parameters

parts PartList

The list of part component

Returns

MeshList

The list of mesh of the tessellated shape of each part

getPartsModels

scene.getPartsModels(parts) -> cad.ModelList

Parameters

parts PartList

The list of part component

Returns

ModelList

The list of models of the BRep shape of each part

getPartsTransforms

scene.getPartsTransforms(parts) -> geom.Matrix4List

Parameters

parts PartList

The parts to retrieve transform

Returns

Matrix4List

The transform matrix of each part

getPartsTransformsIndexed

scene.getPartsTransformsIndexed(parts) -> core.IntList, geom.Matrix4List

Parameters

parts PartList

The parts to retrieve transform

Returns

IntList

The transform matrix index for each parts (0 for Identity)

setPartMesh

scene.setPartMesh(part, mesh)

Parameters

part Part

The part component

mesh Mesh

The mesh to add to the part

setPartModel

scene.setPartModel(part, model)

Parameters

part Part

The part component

model Model

The model to add to the part

setPartsTransforms

scene.setPartsTransforms(parts, transforms)

Parameters

parts PartList

The parts to retrieve transform

transforms Matrix4List

The transform matrix of each part

setPartsTransformsIndexed

scene.setPartsTransformsIndexed(parts, indices, transforms)

Parameters

parts PartList

The parts to retrieve transform

indices IntList

The transform matrix index for each parts

transforms Matrix4List

The list of transform matrices

getPartialLoadingStatus

Get the current status of a partial loading component

See also:

scene.getPartialLoadingStatus(component) -> scene.PartialLoad_Status

Parameters

component ReferencedDataComponent

Referenced Data component

Returns

PartialLoad_Status

The current status

setReferencedDataComponentParent

Defines which referenced data is parent to the given component

See also:

scene.setReferencedDataComponentParent(component, parent)

Parameters

component ReferencedDataComponent

The referenced data component to alter

parent ReferencedDataComponent

The parent

setReferencedDataComponentPath

Defines which path the refereced data is at

See also:

scene.setReferencedDataComponentPath(component, filePath)

Parameters

component ReferencedDataComponent

The referenced data component to alter

filePath String

The filepath

alignPivotPointToWorld

scene.alignPivotPointToWorld(occurrences, applyToChildren=False)

Parameters

occurrences OccurrenceList

The occurrences to modify

applyToChildren Bool

If True, all the pivot of the descending occurrences from occurrence will be affected

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)

See also:

scene.movePivotPointToOccurrenceCenter(occurrences, applyToChildren=False)

Parameters

occurrences OccurrenceList

Occurrences (or the roots occurrences if recursively=True)

applyToChildren Bool

If True, all the pivot of the descending occurrences from occurrence will be affected

movePivotPointToOrigin

Move the pivot point of an occurrence (and its descendants if recursively) to the origin (0,0,0)

See also:

scene.movePivotPointToOrigin(occurrence, applyToChildren=False)

Parameters

occurrence Occurrence

The occurrence (or the root occurrence if recursively=True)

applyToChildren Bool

If True, all the pivot of the descending occurrences from occurrence will be affected

movePivotPointToSelectionCenter

scene.movePivotPointToSelectionCenter(occurrences)

Parameters

occurrences OccurrenceList

The occurrences to modify

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)

See also:

scene.movePivotPointToTargetedOccurrenceCenter(occurrences, target, applyToChildren=False)

Parameters

occurrences OccurrenceList

The occurrence (or the root occurrence if recursively=True)

target Occurrence

The target occurrence

applyToChildren Bool

If True, all the pivot of the descending occurrences from occurrence will be affected

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)

See also:

scene.setPivotOnly(occurrence, pivot)

Parameters

occurrence Occurrence

The occurrence to move the pivot

pivot Matrix4

The new transformation matrix for the occurrence (pivot)

addAnnotationGroup

scene.addAnnotationGroup(component, name) -> scene.AnnotationGroup

Parameters

component PMIComponent

Component to add the Annotation Group

name String

Name of the annotation group

Returns

AnnotationGroup

Annotation group created

addMeshToAnnotation

scene.addMeshToAnnotation(annotation, material, staticmesh)

Parameters

annotation Annotation
material Material
staticmesh StaticMesh

convertPMIToOccurrences

scene.convertPMIToOccurrences(occurrences, convertVisibility=False)

Parameters

occurrences OccurrenceList

Occurrence selection

convertVisibility Boolean

If True, the visibility will be converted (useful to select a specific view/variant), else all occurrences will be visible

createAnnotationFromDefinition

scene.createAnnotationFromDefinition(definition) -> scene.Annotation

Parameters

definition AnnotationDefinition

Annotation definition

Returns

Annotation

getAnnotationDefinition

scene.getAnnotationDefinition(annotation) -> scene.AnnotationDefinition

Parameters

annotation Annotation

Returns

AnnotationDefinition

getAnnotationGroups

scene.getAnnotationGroups(pmiComponent) -> scene.AnnotationGroupList

Parameters

pmiComponent Component

The pmi component

Returns

AnnotationGroupList

List of AnnotationGroup

getAnnotations

scene.getAnnotations(group) -> scene.AnnotationList

Parameters

group AnnotationGroup

The AnnotationGroup

Returns

AnnotationList

List of Annotation

getOccurrenceAnnotationDefinitions

scene.getOccurrenceAnnotationDefinitions(occurrence) -> scene.AnnotationDefinitionList

Parameters

occurrence Occurrence

Returns

AnnotationDefinitionList

getProductViewDefinition

scene.getProductViewDefinition(view) -> scene.ProductViewDefinition

Parameters

view Variant

The product view

Returns

ProductViewDefinition

getProductViewDefinitions

scene.getProductViewDefinitions() -> scene.ProductViewDefinitionList

Returns

ProductViewDefinitionList

setAnnotationToGroup

scene.setAnnotationToGroup(annotation, group)

Parameters

annotation Annotation
group AnnotationGroup

cleanInstances

Clean prototypes and instances (lonely instances, overriding their prototypes hierarchies...).

See also:

scene.cleanInstances(removeUselessInstances=True, removeHierarchyOverridingInstances=False, occurrence=0)

Parameters

removeUselessInstances Boolean

Remove instances where they are not needed (prototype referenced once, ...)

removeHierarchyOverridingInstances Boolean

Remove instances overriding their prototypes sub-hierarchies.

occurrence Occurrence

Root occurrence for the process

getDirectInstances

Returns all the occurrences prototyping the given occurrence

See also:

scene.getDirectInstances(prototype) -> scene.OccurrenceList

Parameters

prototype Occurrence

The prototype occurrence

Returns

OccurrenceList

The instances

getInstances

Get occurrences sharing the same prototype as the given one

See also:

scene.getInstances(occurrence) -> scene.OccurrenceList

Parameters

occurrence Occurrence

Reference part occurrence

Returns

OccurrenceList

The list of occurrences sharing the same prototype

getPrototype

scene.getPrototype(occurrence) -> scene.Occurrence

Parameters

occurrence Occurrence

The occurrence

Returns

Occurrence

The prototype (if any)

prototypeSubTree

Create occurrences that prototype the given occurrence and all its subtree

See also:

scene.prototypeSubTree(prototype) -> scene.Occurrence

Parameters

prototype Occurrence

The root occurrence of the sub-tree to prototype

Returns

Occurrence

The root occurrence of the prototyped sub-tree

setPrototype

scene.setPrototype(occurrence, prototype)

Parameters

occurrence Occurrence

The occurrence

prototype Occurrence

The prototype

clearSelection

scene.clearSelection()

deleteSelection

scene.deleteSelection()

explodeSelection

For each occurrence, create a new occurrence with the selected sub-occurrence elements and remove them from the original occurrence

See also:

scene.explodeSelection()

getSelectedOccurrences

scene.getSelectedOccurrences(keepAncestors) -> scene.OccurrenceList

Parameters

keepAncestors Boolean

If True, occurrences with ancestors selected will be remove from the list

Returns

OccurrenceList

The list of selected occurrences

invertOrientationSelection

scene.invertOrientationSelection()

invertSelection

scene.invertSelection()

select

scene.select(occurrences)

Parameters

occurrences OccurrenceList

Occurrences to add to the selection

separateSelection

scene.separateSelection() -> scene.Occurrence

Returns

Occurrence

The new occurrence created

unselect

scene.unselect(occurrence)

Parameters

occurrence OccurrenceList

Occurrences to remove from the selection

compress

Compress a sub-tree by removing occurrence containing only one Child or empty, and by removing useless instances (see removeUselessInstances)

See also:

scene.compress(occurrence) -> scene.Occurrence

Parameters

occurrence Occurrence

Root occurrence for the process

Returns

Occurrence

The resulting occurrences of compression

convertToOldSchoolVisibility

Modify the visible properties of the sub-tree to look like old school visibility (only hidden/inherited)

See also:

scene.convertToOldSchoolVisibility(root=0)

Parameters

root Occurrence

Root occurrence

getHiddenPartOccurrences

scene.getHiddenPartOccurrences() -> scene.OccurrenceList

Returns

OccurrenceList

The list of hidden occurrences (visibility status)

getVisiblePartOccurrences

scene.getVisiblePartOccurrences() -> scene.OccurrenceList

Returns

OccurrenceList

The list of visible part occurrences (visibility status)

makeInstanceUnique

scene.makeInstanceUnique(occurrences=0, keepOnlyPartInstances=False)

Parameters

occurrences OccurrenceList

Root occurrence for the process

keepOnlyPartInstances Boolean

If true, instances of part will not be singularized

rake

scene.rake(occurrence=0, keepInstances=False)

Parameters

occurrence Occurrence

Root occurrence for the process

keepInstances Boolean

If false, the part will be singularized

removeSymmetryMatrices

Remove symmetry matrices (apply matrices on geometries on nodes under an occurrence with a symmetry matrix

See also:

scene.removeSymmetryMatrices(occurrence=0)

Parameters

occurrence Occurrence

Root occurrence for the process

resetPartTransform

scene.resetPartTransform(root=0)

Parameters

root Occurrence

Root occurrence for the process

resetTransform

scene.resetTransform(root, recursive=True, keepInstantiation=True, keepPartTransform=False)

Parameters

root Occurrence

Root occurrence for the process

recursive Boolean

If False, transformation will be applied only on the root and its components

keepInstantiation Boolean

If False, all occurrences will be singularized

keepPartTransform Boolean

If False, transformation will be applied to the shapes (BRepShape points or TessellatedShape vertices)

createRayProber

scene.createRayProber() -> core.Ident

Returns

Ident

createSphereProber

scene.createSphereProber() -> core.Ident

Returns

Ident

rayCast

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

Parameters

ray Ray

The ray to cast

root Occurrence

The root occurrence to cast from

Returns

RayHit

Information of the first ray hit

rayCastAll

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

Parameters

ray Ray

The ray to cast

root Occurrence

The root occurrence to cast from

Returns

RayHitList

Information of the first ray hit

updateRayProber

scene.updateRayProber(proberID, ray)

Parameters

proberID Ident

The ray prober Id

ray Ray

Update the prober's ray values

updateSphereProber

scene.updateSphereProber(proberID, sphereCenter, sphereRadius)

Parameters

proberID Ident

The sphere prober Id

sphereCenter Vector3

The new prober center

sphereRadius Double

The new prober radius

getMultipleOccurrenceUserData

scene.getMultipleOccurrenceUserData(userDataId, occurrences) -> core.PtrList

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrences OccurrenceList

Occurrences that store the user data

Returns

PtrList

User data stored for each given occurrence

getOccurrenceUserData

scene.getOccurrenceUserData(userDataId, occurrence) -> core.Ptr

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrence Occurrence

Occurrence that store the user data

Returns

Ptr

User data stored in the given occurrence

hasMultipleOccurrenceUserData

scene.hasMultipleOccurrenceUserData(userDataId, occurrences) -> core.BoolList

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrences OccurrenceList

Occurrences that potentially store the user data

Returns

BoolList

Returns an array of bool that are true if a userdata is stored on the occurrence at the same index for the given userDataId

hasOccurrenceUserData

scene.hasOccurrenceUserData(userDataId, occurrence) -> core.Bool

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrence Occurrence

Occurrence that potentially store the user data

Returns

Bool

Returns true if a userdata is stored on this occurrence for the given userDataId

setMultipleOccurrenceUserData

scene.setMultipleOccurrenceUserData(userDataId, occurrences, userDataList)

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrences OccurrenceList

Occurrences that will store the user data

userDataList PtrList

User data to store on each occurrence

setOccurrenceUserData

scene.setOccurrenceUserData(userDataId, occurrence, userData)

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrence Occurrence

Occurrence that will store the user data

userData Ptr

User data to store in the given occurrence

subscribeToOccurrenceUserData

scene.subscribeToOccurrenceUserData() -> scene.OccurrenceUserData

Returns

OccurrenceUserData

UserData identifier to pass to setUserData/getUserData functions

unsetMultipleOccurrenceUserData

scene.unsetMultipleOccurrenceUserData(userDataId, occurrences)

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrences OccurrenceList

Occurrences that will store the user data

unsetOccurrenceUserData

scene.unsetOccurrenceUserData(userDataId, occurrence)

Parameters

userDataId OccurrenceUserData

UserData identifier provided by subscribeToOccurrenceUserData

occurrence Occurrence

Occurrence that will store the user data

unsubscribeFromOccurrenceUserData

scene.unsubscribeFromOccurrenceUserData(userDataId)

Parameters

userDataId OccurrenceUserData

UserData identifier to unsubscribe

addVariant

scene.addVariant(name) -> scene.Variant

Parameters

name String

The name of the new variant

Returns

Variant

The new variant

duplicateVariant

scene.duplicateVariant(variant, name) -> scene.Variant

Parameters

variant Variant

The variant to duplicated

name String

Name of the new variant

Returns

Variant

The created variant

getVariantComponentsDefinitions

scene.getVariantComponentsDefinitions(variantComponents) -> scene.VariantDefinitionListList

Parameters

variantComponents VariantComponentList

The list of variant components to retrieve definitions

Returns

VariantDefinitionListList

For each variant component, returns one list of variant definition (one by variant)

getVariantTree

scene.getVariantTree(variant) -> scene.AlternativeTree

Parameters

variant Variant

The variant

Returns

AlternativeTree

The alternative tree used by this variant

listVariants

scene.listVariants() -> scene.VariantList

Returns

VariantList

All variants

removeVariant

scene.removeVariant(variant)

Parameters

variant Variant

The variant to remove

setCurrentVariant

scene.setCurrentVariant(variant)

Parameters

variant Variant

The variant to enable (can be null)

setVariantTree

scene.setVariantTree(variant, tree)

Parameters

variant Variant

The variant to modify

tree AlternativeTree

The alternative tree to use for this variant

SceneChanged

def onSceneChanged(eventType, occurrence, child):
    pass

id = scene.addSceneChangedCallback(onSceneChanged)

...

scene.removeSceneChangedCallback(id)

Parameters

eventType SceneChangeType

Type of change

occurrence Occurrence

Occurrence concerned by change

child Occurrence

Child occurrence for child insertion/removal

AnimationAdded

def onAnimationAdded(animation):
    pass

id = scene.addAnimationAddedCallback(onAnimationAdded)

...

scene.removeAnimationAddedCallback(id)

Parameters

animation Animation

Added animation

AnimationChanged

def onAnimationChanged(animation):
    pass

id = scene.addAnimationChangedCallback(onAnimationChanged)

...

scene.removeAnimationChangedCallback(id)

Parameters

animation Animation

Changed Animation

AnimationCleared

def onAnimationCleared():
    pass

id = scene.addAnimationClearedCallback(onAnimationCleared)

...

scene.removeAnimationClearedCallback(id)

AnimationRemoved

def onAnimationRemoved(animation):
    pass

id = scene.addAnimationRemovedCallback(onAnimationRemoved)

...

scene.removeAnimationRemovedCallback(id)

Parameters

animation Animation

Removed Animation

SelectionChanged

def onSelectionChanged(type, occurrences):
    pass

id = scene.addSelectionChangedCallback(onSelectionChanged)

...

scene.removeSelectionChangedCallback(id)

Parameters

type SelectionChangeType

Type of change (CLEARED, ADDED or REMOVED)

occurrences OccurrenceList

Only if type is ADDED or REMOVED, list of added or removed occurrences

VariantChanged

def onVariantChanged(type, variant):
    pass

id = scene.addVariantChangedCallback(onVariantChanged)

...

scene.removeVariantChangedCallback(id)

Parameters

type VariantChangeType

Type of change (ADDED, REMOVED, CURRENT_CHANGED)

variant Variant

onRayProbe

def ononRayProbe(proberID, proberInfo):
    pass

id = scene.addonRayProbeCallback(ononRayProbe)

...

scene.removeonRayProbeCallback(id)

Parameters

proberID Ident

The ray propber ID

proberInfo ProberInfo

The prober's info

onSphereProbe

def ononSphereProbe(proberID, proberInfo):
    pass

id = scene.addonSphereProbeCallback(ononSphereProbe)

...

scene.removeonSphereProbeCallback(id)

Parameters

proberID Ident

The sphere propber ID

proberInfo ProberInfo

The prober's info