Asset Transformer SDK (ex Pixyz) Scene Python API functions
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
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. An occurrence is considered empty if it doesn't contain any children and has no Part, Light, Animation, Joint, or Camera component attached.
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
경고
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.
getPartLocalMatrix
Returns the local matrix on a part.
scene.getPartLocalMatrix(part) -> geom.Matrix4
Parameters
Type Name Description Part part Part to get the local matrix.
Returns
Type Name Description Matrix4 matrix The part local matrix.
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
경고
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:
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:
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:
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:
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:
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:
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:
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:
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
getMaterialsFromSubPart
Returns a list of all the materials in the set subPartMaterialComponent.
scene.getMaterialsFromSubPart(component) -> material.MaterialList
Parameters
Returns
Type Name Description MaterialList materials All the materials of the subpartMaterial Component.
See also:
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
중요
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
중요
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
중요
This function is tagged as experimental.
Packs all animation-related info in an object.
scene.getAnimationComponentPropertyBinderLists(animationComponent) -> scene.AnimPropertyBinderList
Parameters
Returns
See also:
getAnimationInfo
중요
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
중요
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