Asset Transformer SDK (ex Pixyz) Scene Python API functions
Read time 109 minutes
Last updated 19 hours ago addComponent
Add a component to an occurrence.
scene.addComponent(occurrence, componentType) -> scene.Component
Parameters
Type Name Description Occurrence occurrence The occurrence to add the new component. ComponentType componentType Type of the component.
Returns
Type Name Description Component component The 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 OccurrenceList occurrences Occurrences that need the component to be added. ComponentType componentType Type of the component.
Returns
Type Name Description ComponentList components Component 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 Occurrence root The occurrence to test.
cleanUnusedImages
Remove unused images from texture library.
scene.cleanUnusedImages() -> core.Int
Returns
Type Name Description Int nbTextureDeleted The number of texture deleted by the clean.
cleanUnusedMaterials
Remove unused materials from material library.
scene.cleanUnusedMaterials(cleanImages=False) -> core.Int
Parameters
Type Name Description Boolean cleanImages Call cleanUnusedImages if true.
Returns
Type Name Description Int nbMaterialDeleted The 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 Occurrence root Occurrence to compute.
Returns
Type Name Description String checksum
configureFunctionLogger
scene.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
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 MaterialList materials 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
Type Name Description MaterialList materials Materials to merge (merge all materials if empty).
createOBBMesh
scene.createOBBMesh(occurrence) -> scene.Occurrence
Parameters
Returns
Type Name Description Occurrence obbOccurrence The create occurrence.
createOccurrence
Create a new occurrence.
scene.createOccurrence(name, parent=None) -> scene.Occurrence
Parameters
Type Name Description String name Name of the new occurrence. Occurrence parent Create the occurrence as a child of parent, if not set the parent will be root.
Returns
Type Name Description Occurrence occurrence Created 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 String name Name of the new occurrence. OccurrenceList children Add given occurrence as children (if any). Occurrence parent 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. Boolean keepMaterialAssignment If defined, material assignation will be updated to keep the visual same aspect.
Returns
Type Name Description Occurrence occurrence Created occurrence.
createOccurrenceFromText
Creates an occurrence from string.
scene.createOccurrenceFromText(text, font="ChicFont", fontSize=64, color=None, heigth3D=40) -> scene.Occurrence
Parameters
Type Name Description String text The occurrence's name. String font The font to use. Int fontSize The font size. ColorAlpha color The occurrence color. Double heigth3D 3D height of text.
Returns
createOccurrences
Create one new occurrence under each given parent.
scene.createOccurrences(name, parents=None) -> scene.OccurrenceList
Parameters
Type Name Description String name Name of the new occurrence. OccurrenceList parents Create the occurrences as a child of each parent. If empty, one occurrence will be created with root as parent.
Returns
createPartsFromMeshes
Create a set of Parts given meshes and occurrences.
scene.createPartsFromMeshes(occurrences, meshes) -> scene.PartList
Parameters
Type Name Description OccurrenceList occurrences The occurrence which will contains the part component of the mesh at the same index. MeshList meshes 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
Type Name Description PartList parts 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=True) -> scene.Occurrence
Parameters
Type Name Description MeshList meshes List of input meshes. Matrix4List matrices List of matrices of input meshes (if empty Identity will be used). Boolean centerPartPivots 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
Type Name Description Occurrence root The created root occurrence.
deleteComponentByType
Delete component from type.
scene.deleteComponentByType(componentType, occurrence, followPrototypes=True)
Parameters
Type Name Description ComponentType componentType Type of the component. Occurrence occurrence The occurrence to remove components from. Bool followPrototypes 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=None)
Parameters
Type Name Description ComponentType componentType Type of the component. Occurrence rootOccurrence The root occurrence to remove components from.
deleteEmptyOccurrences
Delete all empty assemblies.
scene.deleteEmptyOccurrences(root=0)
Parameters
Type Name Description Occurrence root Root occurrence for the process.
deleteOccurrences
Delete a liste of occurrences.
scene.deleteOccurrences(occurrences)
Parameters
generateOctaViews
scene.generateOctaViews(radius, XFrames, YFrames, hemi=False) -> scene.Occurrence
Parameters
Returns
Type Name Description Occurrence occurrence The 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 OccurrenceList occurrences List of occurrences to retrieve the AABB. Boolean precise If 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 AABB aabb The axis aligned bounding box of all given occurrences.
getActiveMaterial
Get the active material on occurrence.
scene.getActiveMaterial(occurrence) -> material.Material
Parameters
Type Name Description Occurrence occurrence The occurrence.
Returns
Type Name Description Material material The material.
getActiveMaterials
Get the active materials on multiple occurrences.
scene.getActiveMaterials(occurrences) -> material.MaterialList
Parameters
Type Name Description OccurrenceList occurrences The occurrences to retrieve active material on.
Returns
Type Name Description MaterialList materials The 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 Occurrence occurrence An occurrence. String propertyName Property name. Boolean cacheProperty If true, the property will be copied on all ancestor of occurrence below the property owner to speed up future calls.
Returns
Type Name Description String value 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=False) -> core.StringList
Parameters
Type Name Description OccurrenceList occurrences List of occurrences. String propertyName Property name. Boolean cacheProperty If true, the property will be copied on all ancestor of occurrence below the property owner to speed up future calls.
Returns
Type Name Description StringList values Property value for each occurrence.
getAncestors
Returns the list of ancestors for one occurrence.
scene.getAncestors(occurrence) -> scene.OccurrenceList
Parameters
Type Name Description Occurrence occurrence The occurrence to test.
Returns
getBrepShape
Returns the Brep shape of a part.
scene.getBrepShape(part) -> scene.BRepShape
Parameters
Type Name Description Part part The Part.
Returns
Type Name Description BRepShape brepShape The brep shape of the part.
getComponent
Returns a component on an occurrence.
scene.getComponent(occurrence, componentType, followPrototypes=True) -> scene.Component
Parameters
Type Name Description Occurrence occurrence The occurrence. ComponentType componentType Type of the component. Bool followPrototypes If true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns
Type Name Description Component component The component.
getComponentByOccurrence
Warning
This function is deprecated.
Returns one component of the specified type by occurrence if it exists.
scene.getComponentByOccurrence(occurrences, componentType, followPrototypes=True) -> scene.ComponentList
Parameters
Type Name Description OccurrenceList occurrences The occurrences list. ComponentType componentType Type of the component. Bool followPrototypes If true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns
Type Name Description ComponentList components List of component synchronized with occurrences.
getComponentOccurrence
Get the occurrence that own a component.
scene.getComponentOccurrence(component) -> scene.Occurrence
Parameters
Type Name Description Component component The component.
Returns
Type Name Description Occurrence occurrence The occurrence.
getComponentType
Get the type of a component.
scene.getComponentType(component) -> scene.ComponentType
Parameters
Type Name Description Component component The component.
Returns
Type Name Description ComponentType componentType Type 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 OccurrenceList occurrences The occurrences list. ComponentType componentType Type of the component. Bool followPrototypes If true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns
Type Name Description ComponentList components List of component synchronized with occurrences.
getGlobalMatrices
Returns the global matrix for each given occurrence.
scene.getGlobalMatrices(occurrences) -> geom.Matrix4List
Parameters
Type Name Description OccurrenceList occurrences Nodes to get the local matrix.
Returns
Type Name Description Matrix4List matrices The global matrix for each given node.
getGlobalMatrix
Returns the global matrix on an occurrence.
scene.getGlobalMatrix(occurrence) -> geom.Matrix4
Parameters
Type Name Description Occurrence occurrence Occurrence to get the global matrix.
Returns
Type Name Description Matrix4 matrix The global matrix of the occurrence.
getGlobalVisibility
Returns the global visibility of a given occurrence.
scene.getGlobalVisibility(occurrence) -> core.Boolean
Parameters
Type Name Description Occurrence occurrence Occurrence to get the global visibility.
Returns
Type Name Description Boolean visible True 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 OccurrenceList occurrences Nodes to get the local matrix.
Returns
Type Name Description Matrix4List matrices The local matrix for each given node.
getLocalMatrix
Returns the local matrix on an occurrence.
scene.getLocalMatrix(occurrence) -> geom.Matrix4
Parameters
Type Name Description Occurrence occurrence Node to get the local matrix.
Returns
Type Name Description Matrix4 matrix The 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 OccurrenceList occurrences List of occurrences to retrieve the MBB. Vector3 forcedAxis Forced axis of the mbb.
Returns
Type Name Description MBB mbb The minimum bounding box of all given occurrences.
getMaterialsFromSubtree
scene.getMaterialsFromSubtree(occurrence) -> material.MaterialList
Parameters
Type Name Description Occurrence occurrence Root occurrence of the subtree on which to get the materials and images.
Returns
Type Name Description MaterialList materials The 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 OccurrenceList occurrences List of occurrences to retrieve the OBB.
Returns
Type Name Description OBB obb The 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 Occurrence occurrence Occurrence to get the active material.
Returns
Type Name Description Material material The active material of the occurrence.
getOccurrenceName
Returns the name of an occurrence.
scene.getOccurrenceName(occurrence) -> core.String
Parameters
Type Name Description Occurrence occurrence The occurrence to get the name.
Returns
Type Name Description String name The 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 ComponentType componentType The component type. Occurrence fromOcc Source occurrence of the recursion.
Returns
getPartActiveShape
Returns the active shape of a part.
scene.getPartActiveShape(part) -> scene.Shape
Parameters
Type Name Description Part part The part.
Returns
Type Name Description Shape shape The 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 Occurrence fromOcc Source occurrence of the recursion.
Returns
getPartShapeType
Get the part's shape type.
scene.getPartShapeType(part) -> scene.ShapeType
Parameters
Type Name Description Part part The part to test.
Returns
Type Name Description ShapeType shapeType Shape'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 OccurrenceList occurrences The part occurrences. Bool asTriangleCount If true count the equivalent of triangles for each polygon. Bool countOnceEachInstance If true ignore multiple instance of each tessellation. Bool countHidden If true, also count hidden components.
Returns
Type Name Description ULong polygonCount 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, core.ULong
Parameters
Type Name Description OccurrenceList roots The root occurrences to get stats on.
Returns
Type Name Description ULong partCount Number of parts in the sub-tree (instances are counted once). ULong partOccurrenceCount Number of part occurrence in the sub-tree (instances are counted multiple times). ULong triangleCount Number of triangles in the sub-tree (instances are counted once, quadrangle count for 2 triangles). ULong triangleOccurrenceCount Number of triangles in the sub-tree (instances are counted multiples times, quadrangle count for 2 triangles). ULong vertexCount Number of surfacic vertices in the sub-tree (instances are counted once). ULong vertexOccurrenceCount Number of surfacic vertices in the sub-tree (instances are counted multiples times). ULong pointCount Number of free vertices (points) in the sub-tree (instances are counted once). ULong pointOccurrenceCount Number of free vertices (points) in the sub-tree (instances are counted multiples times). ULong lineCount Number of free edges (line) in the sub-tree (instances are counted once). ULong lineOccurrenceCount Number of free edges (line) in the sub-tree (instances are counted multiples times). ULong patchesCount Number 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 OccurrenceList occurrences The part occurrences. Bool countOnceEachInstance If true ignore multiple instance of each tessellation. Bool countHidden If true, also count hidden components. Bool countPoints If true, also count points (for points cloud). Bool countMergedVertices If true count all merged vertices in each tessellation.
Returns
Type Name Description ULong vertexCount The number of vertices.
getViewpointsFromCavities
Returns viewpoints from model cavities.
scene.getViewpointsFromCavities(voxelSize, minCavityVolume) -> geom.Point3List, geom.Point3List
Parameters
Type Name Description Distance voxelSize Precision for cavities detection. Distance minCavityVolume Minimum volume for a cavity to be returned.
Returns
Type Name Description Point3List positions List of viewpoint positions. Point3List directions List of viewpoint directions.
getVolume
Return the volume of the occurrence.
scene.getVolume(occurrence) -> core.Double
Parameters
Type Name Description Occurrence occurrence Entry occurrence.
Returns
Type Name Description Double volume The computed volume.
getVolumes
Return the volume of a set of root occurrences.
scene.getVolumes(iRoots) -> core.DoubleList
Parameters
Returns
Type Name Description DoubleList volumes The 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 Occurrence occurrence The occurrence. ComponentType componentType Type of the component. Bool followPrototypes If true and if the component is not set on the occurrence, try to find it on its prototyping chain.
Returns
hide
Hide the given occurrences.
Parameters
Type Name Description OccurrenceList occurrences The list of occurrences to hide.
inverseVisibility
Inverse the visibility of the given occurrences.
scene.inverseVisibility(occurrences)
Parameters
isAncestorOf
Test if an occurrence is an ancestor of another one.
scene.isAncestorOf(maybeAncestor, occurrence) -> core.Bool
Parameters
Type Name Description Occurrence maybeAncestor The potential ancestor of the occurrence. Occurrence occurrence The occurrence to test.
Returns
Type Name Description Bool isAncestor If 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 OccurrenceList occurrences The list that shall be filtered.
Returns
Type Name Description OccurrenceList filteredList The list without descendants of members.
listComponent
List all components on a type on the whole tree.
scene.listComponent(componentType) -> scene.ComponentList
Parameters
Returns
Type Name Description ComponentList components The component list of the type chosen.
listComponents
List all components on an occurrence.
scene.listComponents(occurrence, followPrototypes=True) -> scene.ComponentList
Parameters
Type Name Description Occurrence occurrence The occurrence to list the components. Bool followPrototypes If true list also components owned by the prototype.
Returns
Type Name Description ComponentList components The components owned by the occurrence.
mergeImages
Merge all equivalent images (i.e. with same pixels).
scene.mergeImages(images=[]) -> core.Int
Parameters
Type Name Description ImageList images Images to merge (merge all images if empty).
Returns
Type Name Description Int nbTexture The 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 MaterialList materials Materials to merge (merge all materials if empty). Boolean evaluateNames 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
Type Name Description Int nbMaterial The number of material after the merge.
removeMaterials
Recursively remove all materials.
scene.removeMaterials(roots=None)
Parameters
Type Name Description OccurrenceList roots 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
Type Name Description Int maxLength Maximum name length.
replaceMaterial
Replace a material by another everywhere it is used.
scene.replaceMaterial(originalMaterial, newMaterial, occurrences=None)
Parameters
Type Name Description Material originalMaterial The material to replace everywhere. Material newMaterial The new material to set in place of originalMaterial. OccurrenceList occurrences 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
Type Name Description ResizeTexturesInputMode inputMode Defines if the textures to resize are textures used by a selection of Occurrences, or a selection among the textures available in the scene. ResizeTexturesResizeMode resizeMode Defines if the textures are resized following a ratio or following a maximum size/resolution (only textures above the defined maximum are downsized). Bool replaceTextures If True, overwrites textures from the selection.
setComponentOccurrence
Move a component to an occurrence.
scene.setComponentOccurrence(component, occurrence)
Parameters
setDefaultVariant
Set the default variant.
scene.setDefaultVariant()
setOccurrenceMaterial
Set the material on a occurrence.
scene.setOccurrenceMaterial(occurrence, material)
Parameters
Type Name Description 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
Type Name Description Occurrence occurrence The occurrence to get the name. String name The occurrence name.
show
Show the given occurrences.
Parameters
Type Name Description OccurrenceList occurrences The list occurrences to show.
showOnly
Show only the given occurrences.
scene.showOnly(occurrences)
Parameters
Type Name Description OccurrenceList occurrences The list occurrences to show.
transferCADMaterialsOnPartOccurrences
Set all materials on part occurrences.
scene.transferCADMaterialsOnPartOccurrences(rootOccurrence=None)
Parameters
Type Name Description Occurrence rootOccurrence Root occurrence.
transferMaterialsOnPatches
Take the first instance material and set it one the mesh patches.
scene.transferMaterialsOnPatches(rootOccurrence=None)
Parameters
Type Name Description Occurrence rootOccurrence Root occurrence.
Clustering
createHierarchicalClusters
Reorganize a sub tree with hierarchical clustering.
scene.createHierarchicalClusters(root, childrenCountByNode=2, minFitting=-1) -> scene.Occurrence
Parameters
Type Name Description Occurrence root Root of the sub-tree to reorganize. Int childrenCountByNode Order of the hierarchical tree. Coeff minFitting Minimal fitting coefficient to allow 2 nodes to be merged/clustered.
Returns
Type Name Description Occurrence root Hierarchical 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 Occurrence occurrence Root occurrence of the sub-tree. Int maxDepth Defines the depth maximum of the octree. Double looseFactor Defines the loose factor of the octree.
Returns
See also:
getClusters
Get groups of occurrences based on spatial proximity.
scene.getClusters(occurrences, strategy) -> scene.OccurrenceListList
Parameters
Returns
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 Occurrence root Root occurrence for the process. Real acceptVolumeRatio If the ratio of volumes of two parts is lower than acceptVolumeRatio, they will be considered duplicated. Real acceptPolycountRatio If the ratio of polygon counts of two parts is lower than acceptPolycountRatio, they will be considered duplicated. Real acceptAABBAxisRatio If the ratio of AABB axis of two parts is lower than acceptAABBAxisRatio, they will be considered duplicated. Distance acceptAABBCenterDistance If the distance between AABB centers of two parts is lower than acceptAABBCenterDistance, they will be considered duplicated.
Returns
Type Name Description OccurrenceListList partOccurrencesGroupedBySimilarity All 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 Double radius Radius of the Capsule. Double height Height of the Capsule (excluding the two size of half spheres). Int subdivisionLatitude Subdivision of the Capsule on the Latitude. Int subdivisionLongitude Subdivision of the Capsule (two half spheres) on the Longitude. Boolean generateUV Generation of the UV.
Returns
Type Name Description Occurrence occurrence The 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 Double bottomRadius Radius of the bottom of the cone . Double height Height of the cone. Int sides Number of sides of the cone. Boolean generateUV Generation of the UV.
Returns
Type Name Description Occurrence occurrence The 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 Double sizeX Size of the Cube on the x axis. Double sizeY Size of the Cube on the y axis. Double sizeZ Size of the Cube on the z axis. Int subdivision Subdivision of the Cube on all the axis. Boolean generateUV Generation of the UV.
Returns
Type Name Description Occurrence occurrence The 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 Double radius Radius of the Cylinder. Double height Height of the Cylinder. Int sides Number of Sides of the Cylinder. Boolean generateUV Generation of the UV.
Returns
Type Name Description Occurrence occurrence The 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 Double radius Radius of the Immersion. Int subdivisionX Subdivision of the Immersion on the Latitude. Int subdivisionY Subdivision of the Immersion on the Longitude.
Returns
Type Name Description Occurrence occurrence The 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 Double sizeX Size of the Plane on the x axis. Double sizeY Size of the Plane on the y axis. Int subdivisionX Subdivision of the Plane on the x axis. Int subdivisionY Subdivision of the Plane on the y axis. Boolean generateUV Generation of the UV.
Returns
Type Name Description Occurrence occurrence The 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 Double radius Radius of the Sphere. Int subdivisionLatitude Subdivision of the Sphere on the Latitude. Int subdivisionLongitude Subdivision of the Sphere on the Longitude. Boolean generateUV Generation of the UV.
Returns
Type Name Description Occurrence occurrence The 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 Double majorRadius Major Radius. Double minorRadius Minor Radius. Int subdivisionLatitude Subdivision of the Torus on the Latitude. Int subdivisionLongitude Subdivision of the Torus on the Longitude. Boolean generateUV Generation of the UV.
Returns
Type Name Description Occurrence occurrence The created Occurrence.
See also:
FindBy
findDuplicatedPartOccurrences
Warning
This function is deprecated.
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 Occurrence root Root occurrence. Real acceptVolumeRatio If the ratio of volumes of two parts is lower than acceptVolumeRatio, they will be considered duplicated. Real acceptPolycountRatio If the ratio of polygon counts of two parts is lower than acceptPolycountRatio, they will be considered duplicated. Real acceptAABBAxisRatio If the ratio of AABB axis of two parts is lower than acceptAABBAxisRatio, they will be considered duplicated. Distance acceptAABBCenterDistance If the distance between AABB centers of two parts is lower than acceptAABBCenterDistance, they will be considered duplicated.
Returns
Type Name Description OccurrenceList duplicatedPartOccurrences The 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 Material material A material.
Returns
Type Name Description OccurrenceList filtered The 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 String property Property name. Regex regex Regular expression (ECMAScript). OccurrenceList roots If specified, restrict the search from the given roots. Bool caseInsensitive If True, the regex will be insensitive to upper and lower cases.
Returns
Type Name Description OccurrenceList occurrences Occurrences 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 Regex regex Regular expression (ECMAScript). OccurrenceList roots If specified, restrict the search from the given roots. Bool caseInsensitive If True, the regex will be insensitive to upper and lower cases.
Returns
Type Name Description OccurrenceList occurrences Occurrences 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 String property Property name. Regex regex Regular expression (ECMAScript). OccurrenceList roots If specified, restrict the search from the given roots. Bool caseInsensitive If True, the regex will be insensitive to upper and lower cases.
Returns
Type Name Description OccurrenceList occurrences Occurrences 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 Material material A material. OccurrenceList roots If specified, restrict the search from the given roots.
Returns
Type Name Description OccurrenceList occurrence Occurrences 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 OccurrenceList roots Roots occurrences for the process. Distance maxDiagLength If the diagonal axis of the bounding box is less than maxDiagLength, part will be filtered. -1 to ignore. Distance maxSize If the longer axis of the box is less than maxLength, part will be filtered. -1 to ignore. Boolean getHidden If true, hidden part occurrences meeting the criteria will be filtered as well.
Returns
Type Name Description OccurrenceList filtered The 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 Int minInstanciationCount Min occurrence count.
Returns
Type Name Description OccurrenceList filtered The 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 Material material A material.
Returns
Type Name Description OccurrenceList filtered The 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 AABB aabb The axis aligned bounding box.
Returns
Type Name Description OccurrenceList occurrences Occurrences 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 ExtendedBox box The extension box. Boolean strictlyIncludes If false, parts only need to intersect the box to be selected.
Returns
Type Name Description OccurrenceList occurrences Part 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 PackedTree tree Occurrence root Specify the root occurrence of the scene. Bool replaceRoot If 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 OccurrenceList occurrences Create occurrences (equivalent to tree.occurrences).
See also:
getChildren
Get the children of an occurrence.
scene.getChildren(occurrence) -> scene.OccurrenceList
Parameters
Type Name Description Occurrence occurrence The occurrence.
Returns
See also:
getChildrenCount
Get the children count of an occurrence.
scene.getChildrenCount(occurrence) -> core.Int
Parameters
Type Name Description Occurrence occurrence The occurrence.
Returns
Type Name Description Int childrenCount Children 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 Occurrence root The 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 Occurrence occurrence The occurrence.
Returns
Type Name Description Occurrence child Child occurrence.
See also:
getNextSibling
Get the next occurrence in parent children.
scene.getNextSibling(occurrence) -> scene.Occurrence
Parameters
Type Name Description Occurrence occurrence The occurrence.
Returns
Type Name Description Occurrence nextSibling Next 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 Occurrence occurrence The occurrence to find ancestors.
Returns
Type Name Description OccurrenceList ancestors List 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 OccurrenceList occurrences The list of occurrences to find ancestors.
Returns
Type Name Description OccurrenceListList ancestorsList For 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 Occurrence occurrence The occurrence.
Returns
Type Name Description Occurrence parent The parent occurrence.
See also:
getPreviousSibling
Get the previous occurrence in parent children.
scene.getPreviousSibling(occurrence) -> scene.Occurrence
Parameters
Type Name Description Occurrence occurrence The occurrence.
Returns
Type Name Description Occurrence previousSibling Previous sibling occurrence.
See also:
getRoot
Get the root occurrence of the product structure.
scene.getRoot() -> scene.Occurrence
Returns
Type Name Description Occurrence root The 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 Occurrence root Specify the root of the returned scene. VisibilityMode visibilityMode The visibility mode. Int depth Maximum depth.
Returns
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 OccurrenceList occurrences The occurrences to move. Occurrence destination Destination occurrence (the new parent). Occurrence insertBefore Occurrence 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 Occurrence occurrence The occurrence. Occurrence parent The parent occurrence. Boolean addInParentInstances If True, each occurrence whose prototype is the target parent will generate a child whose prototype is the occurrence itself. Occurrence insertBefore Add before this child occurrence in the children list of the parent occurrence. Boolean worldPositionStays 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.
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 Occurrence occurrence The occurrence to add the new component. LightType lightType The type of the light. Color color Color of the light. Double power The power of the light. Angle cutOff The cutoff angle of the light.
Returns
Type Name Description Component component The 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 String name Name of the light. LightType lightType The type of the light. Color color Color of the light. Double power The power of the light. Angle cutOff The cutoff angle of the light. Occurrence parent The parent of the light occurrence.
Returns
Type Name Description Occurrence occurrence The light created.
See also:
Metadata
addMetadata
Add a new metadata property to a metadata component.
scene.addMetadata(metadata, name, value)
Parameters
Type Name Description Metadata metadata The metadata component. String name The new property name. String value The new property value.
See also:
addMetadataBlock
Add a new metadata property to a metadata component.
scene.addMetadataBlock(metadata, names, values)
Parameters
Type Name Description Metadata metadata The metadata component. StringList names The new properties names. StringList values The new properties values.
See also:
createMetadatasFromDefinitions
Create Metadata components from definitions.
scene.createMetadatasFromDefinitions(occurrences, definitions) -> scene.MetadataList
Parameters
Returns
Type Name Description MetadataList metadatas List 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 Metadata metadata The metadata component. String name The metadata property name.
Returns
Type Name Description String component The property value.
See also:
getMetadatasDefinitions
Returns definition of Metadata components.
scene.getMetadatasDefinitions(metadatas) -> scene.MetadataDefinitionList
Parameters
Type Name Description MetadataList metadatas List of metadata component to retrieve definition.
Returns
Type Name Description MetadataDefinitionList definitions List 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 Metadata metadata The occurrence. String name The 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 Occurrence occurrence The Occurrence. UInt subpartIndex The subpart index.
Returns
Type Name Description Material material The assigned material.
See also:
listActiveShapeMaterials
List all the materials used in the part shape.
scene.listActiveShapeMaterials(part) -> material.MaterialList
Parameters
Type Name Description Part part The part which contains sub materials.
Returns
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 Occurrence occurrence The occurrence which contains sub materials.
Returns
See also:
listSubpartVariantMaterials
List all the materials variants in subpart .
scene.listSubpartVariantMaterials(occurrence) -> scene.VariantMaterialList
Parameters
Type Name Description Occurrence occurrence The occurrence which contains variants.
Returns
See also:
setSubpartMaterial
Set a subpart material assignment using a SubpartMaterial component.
scene.setSubpartMaterial(occurrence, subpartIndex, material)
Parameters
Type Name Description Occurrence occurrence The Occurrence. UInt subpartIndex The subpart index. Material material The material.
See also:
setSubpartMaterials
Set multiple subpart materials at once using a SubpartMaterial component.
scene.setSubpartMaterials(occurrence, materials, startIndex=0)
Parameters
Type Name Description Occurrence occurrence The Occurrence on which to apply the materials. MaterialList materials Materials to set. UInt startIndex The subpart start index.
See also:
setSubpartVariantMaterials
Set materials in variant .
scene.setSubpartVariantMaterials(occurrence, variantMaterials)
Parameters
See also:
setSubpartVariantMaterialsList
Set all the materials list in variants .
scene.setSubpartVariantMaterialsList(variants, materialListList) -> scene.VariantMaterialList
Parameters
Type Name Description VariantList variants The part which contains variants. MaterialListList materialListList The part which contains the list of material variant list.
Returns
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 Occurrence occurrence The 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 String name The name of the new alternative tree. Occurrence root The root occurrence.
Returns
See also:
getAlternativeTreeRoot
Returns the root occurrence associated with the given AlternativeTree.
scene.getAlternativeTreeRoot(tree) -> scene.Occurrence
Parameters
Returns
Type Name Description Occurrence root The root occurrence.
See also:
listAlternativeTrees
Returns all the available alternative trees.
scene.listAlternativeTrees() -> scene.AlternativeTreeList
Returns
See also:
animations
addAnimation
Add an animation in Animation library.
scene.addAnimation(animation)
Parameters
Type Name Description Animation animation Animation to add.
See also:
addKeyframe
Adds a keyframe in the curve.
scene.addKeyframe(channel, time, value) -> scene.Keyframe
Parameters
Returns
Type Name Description Keyframe keyframe The corresponding keyframe.
See also:
addKeyframeFromCurrentPosition
Adds keyframes in a given AnimChannel based on current position.
scene.addKeyframeFromCurrentPosition(channel, time)
Parameters
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 Animation animation The Animation. Occurrence occurrence The supposedly animated occurrence.
Returns
Type Name Description Bool isAnimated The answer to this question.
See also:
bakeAnimation
Important
This function is tagged as experimental.
Bake an animation. The values are now precalculated and no longer interpolated.
scene.bakeAnimation(animation, occurrence, end, interval)
Parameters
See also:
createAnimation
Creates an animation, need to use addAnimation when animation is filled.
scene.createAnimation(name) -> scene.Animation
Parameters
Type Name Description String name Name of the animation.
Returns
Type Name Description Animation animation The created animation.
See also:
createSkeletonMesh
Create a skeleton mesh from a joint component tree.
scene.createSkeletonMesh(root) -> scene.Occurrence
Parameters
Type Name Description Occurrence root Root joint component node.
Returns
Type Name Description Occurrence skeletonOcc New occurrence containing the skeleton mesh.
See also:
decimateAnimChannelBySegment
Decimates by segment a given AnimChannel.
scene.decimateAnimChannelBySegment(channel, precision)
Parameters
See also:
deleteAnimation
Deletes an animation.
scene.deleteAnimation(animation)
Parameters
Type Name Description Animation animation The 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
See also:
displayAllKeyframesFromAnimation
Displays info on the selected animation.
scene.displayAllKeyframesFromAnimation(animation)
Parameters
Type Name Description Animation animation The animation.
See also:
displayValueFromAnimChannelAtTime
Displays the value.
scene.displayValueFromAnimChannelAtTime(channel, time, defaultValue=False)
Parameters
See also:
getAnimChannelIfExists
Returns the main AnimChannel of an Occurrence according to a given Animation.
scene.getAnimChannelIfExists(animation, occurrence) -> scene.AnimChannel
Parameters
Returns
See also:
getAnimChannelInfo
Important
This function is tagged as experimental.
Get an animation channel informations.
scene.getAnimChannelInfo(channel) -> scene.AnimChannelInfo
Parameters
Type Name Description AnimChannel channel Animation to get info of.
Returns
See also:
getAnimChannelOccurrence
Returns the Occurrence related to a given AnimChannel.
scene.getAnimChannelOccurrence(channel) -> scene.Occurrence
Parameters
Returns
Type Name Description Occurrence occurrence The corresponding occurrence.
See also:
getAnimationComponentPropertyBinderLists
Important
This function is tagged as experimental.
Packs all animation-related info in an object.
scene.getAnimationComponentPropertyBinderLists(animationComponent) -> scene.AnimPropertyBinderList
Parameters
Returns
See also:
getAnimationInfo
Important
This function is tagged as experimental.
Packs all animation-related info in an object.
scene.getAnimationInfo(animation) -> scene.AnimationInfo
Parameters
Type Name Description Animation animation Animation to get info of.
Returns
See also:
getAnimationPropertyBinderLists
Important
This function is tagged as experimental.
Packs all animation-related info in an object.
scene.getAnimationPropertyBinderLists(animation) -> scene.AnimPropertyBinderList
Parameters
Type Name Description Animation animation Animation to get info of.
Returns
See also:
getJointDefinition
Get joint definition from id.
scene.getJointDefinition(joint) -> scene.JointDefinition
Parameters
Type Name Description Joint joint Id of the joint.
Returns
Type Name Description JointDefinition jointDefinition The jointDefinition matching the id provided.
See also:
getJointDefinitions
Get joint definition from id.
scene.getJointDefinitions(joints) -> scene.JointDefinitionList
Parameters
Type Name Description JointList joints Ids of joints.
Returns
Type Name Description JointDefinitionList jointDefinitions An 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 Keyframe keyframe The keyframe one wants the parent of.
Returns
See also:
getKeyframes
Returns a list of all keyframes of a simple animChannel.
scene.getKeyframes(channel) -> scene.KeyframeList
Parameters
Type Name Description AnimChannel channel The channel one wants to extract the keyframs from.
Returns
Type Name Description KeyframeList keyframelist The list of keyframes.
See also:
getMainChannel
Returns the main AnimChannel of a given AnimChannel.
scene.getMainChannel(channel) -> scene.AnimChannel
Parameters
Type Name Description AnimChannel channel The channel one wants the main of.
Returns
Type Name Description AnimChannel mainChannel The corresponding main Channel.
See also:
getOccurrenceJoint
Returns the Joint assigned to an occurrence if any.
scene.getOccurrenceJoint(occurrence) -> polygonal.Joint
Parameters
Type Name Description Occurrence occurrence The occurrence.
Returns
Type Name Description Joint joint The 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 AnimChannel channel The channel one wants the parent of.
Returns
Type Name Description AnimChannel parentChannel The 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 AnimChannel channel The channel one wants the subchannel of. String name The name of the subchannel.
Returns
Type Name Description AnimChannel subChannel The corresponding subchannel.
See also:
getSubChannels
Returns all the sub channel of an AnimChannel.
scene.getSubChannels(channel) -> scene.AnimChannelList
Parameters
Type Name Description AnimChannel channel The channel one wants the subchannel of.
Returns
Type Name Description AnimChannelList subChannels The 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 Animation animation The Animation stack where to put a animated property. Entity entity The entity object to animate. String propertyName The name of the property to animate.
Returns
Type Name Description AnimChannel mainChannel The main channel of the binder.
See also:
listAnimations
List all Animations from the scene.
scene.listAnimations() -> scene.AnimationList
Returns
Type Name Description AnimationList animList The list containing animations.
See also:
listMainChannels
List all main AnimChannel from a given Animation.
scene.listMainChannels(animation) -> scene.AnimChannelList
Parameters
Type Name Description Animation animation The Animation one wants to list the channels from.
Returns
Type Name Description AnimChannelList channelList The list containing the AnimChannels.
See also:
makeDefaultKeyframe
Creates keyframes with the default values of the channel at time 0.
scene.makeDefaultKeyframe(channel)
Parameters
See also:
moveAnimation
Moving animation.
scene.moveAnimation(animation, target, newParent, interval)
Parameters
See also:
removeKeyframe
Removes a keyframe in the curve.
scene.removeKeyframe(channel, time)
Parameters
See also:
unlinkPropertyToAnimation
Unlinks a binder.
scene.unlinkPropertyToAnimation(animation, entity, propertyName)
Parameters
Type Name Description Animation animation The Animation stack where to put a animated property. Entity entity The entity object to animate. String propertyName The 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 Int partCount The part count. Int totalPartCount The total part count. Int vertexCount The vertex count. Int totalVertexCount The total vertex count. Int edgeCount The edge count. Int totalEdgeCount The total edge count. Int openShellCount The open shell count. Int totalOpenShellCount The total open shell count. Int bodyCount The body count. Int totalBodyCount The total body count. Double area2Dsum The 2D area sum. Int boundaryCount The boundary count. Int boundaryEdgeCount The boundary edge count. Int nonManifoldEdgeCount The 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 Occurrence root Occurrence tree root.
Returns
Type Name Description Int partCount The part count. Int totalPartCount The total part count. Int vertexCount The vertex count. Int totalVertexCount The total vertex count. Int edgeCount The edge count. Int totalEdgeCount The total edge count. Int polygonCount The polygon count. Int totalPolygonCount The total polygon count. Int patchCount The patch count. Int totalPatchCount The total patch count. Int boundaryCount The boundary count. Int boundaryEdgeCount The boundary edge count. Int nonManifoldEdgeCount The 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 Part part The tessellated part.
Returns
Type Name Description Double maxSag The MaxSag value in mm. Double maxLength The maximum length in mm. Double maxAngle Bool createNormals Whether normals were created. UVGenerationMode uvGenerationMode The uv generation mode. Int uvChannel The UV channel. Double uvPadding The UV padding. Bool createTangents Whether tangents were created. Bool createFreeEdges Whether free edges were created.
See also:
print
Print an occurrence tree on log.
Parameters
Type Name Description Occurrence root Occurrence tree root.
See also:
filters
addFilterToLibrary
Add a filter to the filters library.
scene.addFilterToLibrary(name, expr) -> core.Ident
Parameters
Returns
Type Name Description Ident filterId Identifier of the created filter.
See also:
evaluateExpression
Evaluate the given filter expression.
scene.evaluateExpression(filter) -> core.String
Parameters
Returns
Type Name Description String result Result 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
Returns
Type Name Description StringList evaluations The 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
Returns
Type Name Description OccurrenceList occurrences StringList evaluations The 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 FilePath file File 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 String name Name of the filter to retrieve (case sensitive).
Returns
Type Name Description Filter filter The 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 Ident filterId Identifier of the filter to fetch.
Returns
See also:
getFilterFromLibrary
Retrieve a filter from the library with its identifier.
scene.getFilterFromLibrary(filterId) -> scene.Filter
Parameters
Type Name Description Ident filterId Identifier of the filter to retrieve.
Returns
Type Name Description Filter filter The retrieved filter.
See also:
getFilteredOccurrences
Recursively get all the occurrences validating the given filter expression.
scene.getFilteredOccurrences(filter, fromOcc=None) -> scene.OccurrenceList
Parameters
Returns
See also:
importFilterLibrary
Import filters from a given file.
scene.importFilterLibrary(file)
Parameters
Type Name Description FilePath file File containing the filter library.
See also:
listFilterLibrary
Returns all the filter stored in the filter library.
scene.listFilterLibrary() -> scene.FilterList
Returns
Type Name Description FilterList filters All the filters stored in the filter library.
See also:
removeFilterFromLibrary
Remove a filter from the filters library.
scene.removeFilterFromLibrary(filterId)
Parameters
Type Name Description Ident filterId Identifier of the filter to remove.
See also:
isolate
getIsolatedOccurrences
Get Occurrences currently being isolated.
scene.getIsolatedOccurrences() -> scene.OccurrenceList
Returns
Type Name Description OccurrenceList occurrences The list of occurrences isolated.
See also:
isIsolated
Is in isolate mode.
scene.isIsolated() -> core.Boolean
Returns
Type Name Description Boolean isolated Returns 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
See also:
unisolate
Exit the isolate mode.
See also:
locks
sceneReadLock
Lock the scene to prevent modification while allowing reading from other threads.
See also:
sceneReadUnlock
Unlock the scene for modification.
See also:
sceneTryReadLock
Try lock the scene to prevent modification while allowing reading from other threads.
scene.sceneTryReadLock() -> core.Boolean
Returns
Type Name Description Boolean sceneLocked Returns if the scene has been locked.
See also:
sceneWriteLock
Lock the scene from being read/write by other threads.
See also:
sceneWriteUnlock
Unlock the scene for modification and reading.
See also:
merging
findPartOccurrencesWithUnstitchedOpenShells
Find Part occurrences containing multiple unstitched openShell entities.
scene.findPartOccurrencesWithUnstitchedOpenShells(root) -> scene.OccurrenceList
Parameters
Returns
Type Name Description OccurrenceList unstitchedFacesOccurrences Unstitched faces occurrences.
See also:
mergeOccurrencesByTreeLevel
Merge all parts over maxLevel level.
scene.mergeOccurrencesByTreeLevel(roots, maxLevel=5, mergeHiddenPartsMode=2)
Parameters
Type Name Description OccurrenceList roots Roots occurrences for the process. Int maxLevel Maximum tree level. MergeHiddenPartsMode mergeHiddenPartsMode Hidden 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 OccurrenceList partOccurrences Occurrence of the parts to merge. MergeHiddenPartsMode mergeHiddenPartsMode Hidden parts handling mode, Destroy them, make visible or merge separately.
Returns
Type Name Description OccurrenceList mergedOccurrences Resulting 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 OccurrenceList roots Roots occurrences for the process (will not be removed). MergeHiddenPartsMode mergeHiddenPartsMode Hidden 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 OccurrenceList roots Roots occurrences for the process (will not be removed). MergeHiddenPartsMode mergeHiddenPartsMode Hidden parts handling mode, Destroy them, make visible or merge separately. Boolean CollapseToParent If 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 OccurrenceList partOccurrences Occurrence of the parts to merge. Boolean mergeNoMaterials 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. Boolean combineMeshes If true, explode and remerge the input parts by visible materials.
Returns
Type Name Description OccurrenceList mergedOccurrences Resulting merged occurrences.
See also:
mergePartOccurrencesByName
Merge all parts by occurrences names.
scene.mergePartOccurrencesByName(root=0, mergeHiddenPartsMode=2)
Parameters
Type Name Description Occurrence root Root occurrence of the subtree to process. MergeHiddenPartsMode mergeHiddenPartsMode Hidden 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
Returns
Type Name Description OccurrenceList mergedOccurrences Resulting merged occurrences.
See also:
mergePartOccurrencesWithSingleOpenShellByAssemblies
Merge Part occurrences containing a single openShell entity, by assemblies.
scene.mergePartOccurrencesWithSingleOpenShellByAssemblies(root) -> scene.OccurrenceList
Parameters
Type Name Description Occurrence root Root of the main assembly to merge.
Returns
Type Name Description OccurrenceList mergedOccurrences List 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 Occurrence occurrence Occurrence to apply the matrix on. Matrix4 matrix Transformation to matrix.
See also:
createSymmetry
Create symmetries from selection.
scene.createSymmetry(occurrences, plane)
Parameters
See also:
rotate
Modify the local matrix of the scene node to apply a rotation.
scene.rotate(occurrence, axis, angle)
Parameters
Type Name Description Occurrence occurrence Occurrence to rotate. Vector3 axis Axis of rotation. Angle angle Angle of rotation.
See also:
setLocalMatrices
Change the local matrices on a list of occurrences.
scene.setLocalMatrices(occurrencesIds, matrices, batchSize)
Parameters
Type Name Description OccurrenceList occurrencesIds List of occurrences on which to set the local matrices. Matrix4List matrices The occurrences' new local matrices. UInt batchSize Number 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 Occurrence occurrence Occurrence to set the local matrix. Matrix4 matrix The new occurrence local matrix.
See also:
part
getPartMesh
Return the mesh of the TesselatedShape.
scene.getPartMesh(part) -> polygonal.Mesh
Parameters
Type Name Description Part part The part component.
Returns
Type Name Description Mesh mesh The 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 Part part The part component.
Returns
Type Name Description Model model The 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 PartList parts The list of part component.
Returns
Type Name Description MeshList meshes The 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 PartList parts The list of part component.
Returns
Type Name Description ModelList models The 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 PartList parts The parts to retrieve transform.
Returns
Type Name Description Matrix4List transforms The 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 PartList parts The parts to retrieve transform.
Returns
Type Name Description IntList indices The transform matrix index for each parts (0 for Identity). Matrix4List transforms The 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 Part part The part component. Mesh mesh The 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 Part part The part component. Model model The 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 PartList parts The parts to retrieve transform. Matrix4List transforms The 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 PartList parts The parts to retrieve transform. IntList indices The transform matrix index for each parts. Matrix4List transforms The list of transform matrices.
See also:
partialLoading
getPartialLoadingStatus
Get the current status of a partial loading component.
scene.getPartialLoadingStatus(component) -> scene.PartialLoad_Status
Parameters
Returns
See also:
setReferencedDataComponentParent
Defines which referenced data is parent to the given component.
scene.setReferencedDataComponentParent(component, parent)
Parameters
See also:
setReferencedDataComponentPath
Defines which path the referenced data is at.
scene.setReferencedDataComponentPath(component, filePath)
Parameters
See also:
pivots
alignPivotPointToWorld
Re-orient the Pivot Point straight to world origin (the grid).
scene.alignPivotPointToWorld(occurrences, applyToChildren=False)
Parameters
Type Name Description OccurrenceList occurrences The occurrences to modify. Bool applyToChildren If 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 OccurrenceList occurrences Occurrences (or the roots occurrences if recursively=True). Bool applyToChildren If 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 Occurrence occurrence The occurrence (or the root occurrence if recursively=True). Bool applyToChildren If 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 OccurrenceList occurrences The 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 OccurrenceList occurrences The occurrence (or the root occurrence if recursively=True). Occurrence target The target occurrence. Bool applyToChildren If 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 Occurrence occurrence The occurrence to move the pivot. Matrix4 pivot The 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 PMIComponent component Component to add the Annotation Group. String name Name of the annotation group.
Returns
See also:
addMeshToAnnotation
Add a mesh and its material to a annotation.
scene.addMeshToAnnotation(annotation, material, staticmesh)
Parameters
See also:
convertPMIToOccurrences
Convert each PMI component into a set of occurrences with mesh geometries.
scene.convertPMIToOccurrences(occurrences, convertVisibility=False)
Parameters
Type Name Description OccurrenceList occurrences Occurrence selection. Boolean convertVisibility If 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
Returns
Type Name Description Annotation metadata Annotation 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 Annotation annotation Annotation that shall be converted to an occurrence with mesh geometry. Boolean convertVisibility If True, the visibility will be converted (useful to select a specific view/variant), else all occurrences will be visible.
Returns
Type Name Description Occurrence newOccurrence Annotation as occurrence with mesh geometry.
See also:
createProductView
Create a productview from definition.
scene.createProductView(definition) -> scene.ProductView
Parameters
Returns
See also:
getAnnotationDefinition
Get definition of given annotation.
scene.getAnnotationDefinition(annotation) -> scene.AnnotationDefinition
Parameters
Returns
See also:
getAnnotationGroups
Returns the list of the AnnotationGroup from a PMIComponent.
scene.getAnnotationGroups(pmiComponent) -> scene.AnnotationGroupList
Parameters
Type Name Description Component pmiComponent The pmi component.
Returns
See also:
getAnnotationListAABB
Get the AABB of the annotation list.
scene.getAnnotationListAABB(annotationList) -> geom.AABB
Parameters
Returns
Type Name Description AABB aabb The 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
Returns
See also:
getOccurrenceAnnotationDefinitions
Get all annotations definition of given occurrence.
scene.getOccurrenceAnnotationDefinitions(occurrence) -> scene.AnnotationDefinitionList
Parameters
Returns
See also:
getProductViewDefinition
Get productview definition.
scene.getProductViewDefinition(view) -> scene.ProductViewDefinition
Parameters
Type Name Description Variant view The product view.
Returns
See also:
getProductViewDefinitions
Get all productviews definitions.
scene.getProductViewDefinitions() -> scene.ProductViewDefinitionList
Returns
See also:
setAnnotationToGroup
Set Annotation to a Annotation Group.
scene.setAnnotationToGroup(annotation, group)
Parameters
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 Boolean removeUselessInstances Remove instances where they are not needed (prototype referenced once, ...). Boolean removeHierarchyOverridingInstances Remove instances overriding their prototypes sub-hierarchies. Occurrence occurrence Root occurrence for the process.
See also:
getDirectInstances
Returns all the occurrences prototyping the given occurrence.
scene.getDirectInstances(prototype) -> scene.OccurrenceList
Parameters
Type Name Description Occurrence prototype The prototype occurrence.
Returns
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 Occurrence occurrence The occurrence.
Returns
Type Name Description Occurrence prototype The 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 Occurrence occurrence Reference part occurrence.
Returns
Type Name Description OccurrenceList instances The 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 Occurrence occurrence The occurrence.
Returns
Type Name Description Occurrence prototype The prototype (if any).
See also:
getPrototypes
Returns the prototype for each given occurrence.
scene.getPrototypes(occurrences) -> scene.OccurrenceList
Parameters
Returns
Type Name Description OccurrenceList prototypes The 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 Occurrence prototype The root occurrence of the sub-tree to prototype.
Returns
Type Name Description Occurrence occurrence The root occurrence of the prototyped sub-tree.
See also:
setPrototype
Sets the prototype of an occurrence.
scene.setPrototype(occurrence, prototype)
Parameters
See also:
setPrototypes
Sets the prototype for each given occurrence.
scene.setPrototypes(occurrences, prototypes)
Parameters
See also:
updateChildrenPrototypes
Update children prototypes of the given occurrence.
scene.updateChildrenPrototypes(occurrence)
Parameters
Type Name Description Occurrence occurrence The occurrence.
See also:
selection
clearSelection
Clear the current selection.
scene.clearSelection(selectionId=1)
Parameters
Type Name Description Ident selectionId ID 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 Ident selectionId Selection 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 Ident selectionId ID 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 Ident selectionId Selection 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 Boolean keepAncestors If True, occurrences with ancestors selected will be remove from the list. Ident selectionId ID of the selection to use, or current selection (id = 1) will be used.
Returns
Type Name Description OccurrenceList selection The list of selected occurrences.
See also:
getSelectedPolygonCount
Returns the number of selected polygons.
scene.getSelectedPolygonCount(selectionId=1) -> core.ULong
Parameters
Type Name Description Ident selectionId ID of the selection to use, or current selection (id = 1) will be used.
Returns
Type Name Description ULong polygonCount Number 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 Ident selectionId ID 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 OccurrenceList occurrence Occurrences to invert from the selection. Ident selectionId ID 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 Ident selectionId ID 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 OccurrenceList occurrences Occurrences to add to the selection. Ident selectionId ID 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 Boolean createSingleOccurrence Only create a single occurrence, or create occurrences corresponding to every part containing selected elements, at the same place in the hierarchical tree. Ident selectionId ID of the selection to separate, or current selection (id = 1) will be separated.
Returns
Type Name Description OccurrenceList newOccurrences The new occurrence(s) created.
See also:
unselect
Remove occurrences to selection.
scene.unselect(occurrence, selectionId=1)
Parameters
Type Name Description OccurrenceList occurrence Occurrences to remove from the selection. Ident selectionId ID 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 Occurrence occurrence Root occurrence for the process.
Returns
Type Name Description Occurrence resultingOccurrences The 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
See also:
getHiddenPartOccurrences
Get hidden part occurrences.
scene.getHiddenPartOccurrences(roots=None) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList roots Roots occurrences for the process.
Returns
Type Name Description OccurrenceList filtered The list of hidden occurrences (visibility status).
See also:
getVisiblePartOccurrences
Get visible part occurrences.
scene.getVisiblePartOccurrences(roots=None) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList roots Roots occurrences for the process.
Returns
Type Name Description OccurrenceList filtered The 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 OccurrenceList occurrences Root occurrence for the process. Boolean keepOnlyPartInstances If 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 Occurrence occurrence Root occurrence for the process. Boolean keepInstances If 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 Occurrence occurrence Root 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 Occurrence root Root 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 Occurrence root Root occurrence for the process. Boolean recursive If False, transformation will be applied only on the root and its components. Boolean keepInstantiation If False, all occurrences will be singularized. Boolean keepPartTransform If 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 Ident id
See also:
createSphereProber
Creates a sphere prober.
scene.createSphereProber() -> core.Ident
Returns
Type Name Description Ident id
See also:
rayCast
scene.rayCast(ray, root) -> scene.RayHit
Parameters
Type Name Description Ray ray The ray to cast. Occurrence root The root occurrence to cast from.
Returns
Type Name Description RayHit hit Information of the first ray hit.
See also:
rayCastAll
scene.rayCastAll(ray, root) -> scene.RayHitList
Parameters
Type Name Description Ray ray The ray to cast. Occurrence root The root occurrence to cast from.
Returns
Type Name Description RayHitList hits Information of the first ray hit.
See also:
updateRayProber
Updates the designed ray prober.
scene.updateRayProber(proberID, ray)
Parameters
Type Name Description Ident proberID The ray prober Id. Ray ray Update the prober's ray values.
See also:
updateSphereProber
Updates the designed sphere prober.
scene.updateSphereProber(proberID, sphereCenter, sphereRadius)
Parameters
Type Name Description Ident proberID The sphere prober Id. Vector3 sphereCenter The new prober center. Double sphereRadius The new prober radius.
See also:
userData
getMultipleOccurrenceUserData
Batch version of getOccurrenceUserData.
scene.getMultipleOccurrenceUserData(userDataId, occurrences) -> core.PtrList
Parameters
Type Name Description OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. OccurrenceList occurrences Occurrences that store the user data.
Returns
Type Name Description PtrList userDataList User 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 OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. Occurrence occurrence Occurrence that store the user data.
Returns
Type Name Description Ptr userData User data stored in the given occurrence.
See also:
hasMultipleOccurrenceUserData
Batch version of hasOccurrenceUserData.
scene.hasMultipleOccurrenceUserData(userDataId, occurrences) -> core.BoolList
Parameters
Type Name Description OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. OccurrenceList occurrences Occurrences that potentially store the user data.
Returns
Type Name Description BoolList results Returns 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 OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. Occurrence occurrence Occurrence that potentially store the user data.
Returns
Type Name Description Bool result Returns 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 OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. OccurrenceList occurrences Occurrences that will store the user data. PtrList userDataList User 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 OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. Occurrence occurrence Occurrence that will store the user data. Ptr userData User 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 OccurrenceUserData userDataId UserData identifier to pass to setUserData/getUserData functions.
See also:
unsetMultipleOccurrenceUserData
Batch version of unsetOccurrenceUserData.
scene.unsetMultipleOccurrenceUserData(userDataId, occurrences)
Parameters
Type Name Description OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. OccurrenceList occurrences Occurrences that will store the user data.
See also:
unsetOccurrenceUserData
Unset the userdata stored on an occurrence.
scene.unsetOccurrenceUserData(userDataId, occurrence)
Parameters
Type Name Description OccurrenceUserData userDataId UserData identifier provided by subscribeToOccurrenceUserData. Occurrence occurrence Occurrence that will store the user data.
See also:
unsubscribeFromOccurrenceUserData
scene.unsubscribeFromOccurrenceUserData(userDataId)
Parameters
See also:
variant
addVariant
Create a new variant.
scene.addVariant(name) -> scene.Variant
Parameters
Type Name Description String name The name of the new variant.
Returns
Type Name Description Variant variant The 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 Variant variant The variant to duplicated. String name Name of the new variant.
Returns
Type Name Description Variant newVariant The 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 VariantComponentList variantComponents The list of variant components to retrieve definitions.
Returns
Type Name Description VariantDefinitionListList definitions For 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 Variant variant The variant.
Returns
Type Name Description AlternativeTree tree The alternative tree used by this variant.
See also:
listVariants
Returns all the available variants.
scene.listVariants() -> scene.VariantList
Returns
See also:
removeVariant
Remove a variant.
scene.removeVariant(variant)
Parameters
Type Name Description Variant variant The variant to remove.
See also:
setCurrentVariant
Change the current variant used.
scene.setCurrentVariant(variant=None)
Parameters
Type Name Description Variant variant The 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 Variant variant The variant to modify. AlternativeTree tree The 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: