Python API Change Log
ABOUT Pixyz Batch
Because Pixyz Batch shares the same Python API with Pixyz Studio, all changes below also apply to Pixyz Batch
Release 2020.1.0.22 to 2020.1.1.7
(Released July 01, 2020)
IMPORTANT INFORMATION
In continuation of the 2019 breaking API changes, Pixyz Studio/Batch 2020.1 Python API becomes more typed and structured. To help migration from 2019 to 2020, find more information here
REMOVED FUNCTIONS
Module: IO
- io.exportSceneToShowIn3D()
Module: Scenario
- scenario.selectIdentical() (replaced by "scenario.selectSimilar()")
ADDED FUNCTIONS
Module: Scenario
- scenario.createInstancesBySimilarity()
- scenario.selectSimilar()
MODIFIED FUNCTIONS
Module: Algo
mapUvOnBox
mapUvOnBox(occurrences, affine box, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a box
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine box : Box
Affine transformation of the box Box definition
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
mapUvOnCylinder
mapUvOnCylinder(occurrences, affine cylinder, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a cylinder
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine cylinder : Cylinder
Affine transformation of the cylinder Cylinder definition
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
mapUvOnPlane
mapUvOnPlane(occurrences, affine Plane, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a plane
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine plane : Plane
Affine transformation of the plane Plane definition
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
mapUvOnSphere
mapUvOnSphere(occurrences, affine sphere, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a sphere
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine sphere : Sphere
Affine transformation of the sphere Sphere definition
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
Release 2019.2.1.12 to 2020.1.0.22
(Released April 20, 2020)
IMPORTANT INFORMATION
In continuation of the 2019 breaking API changes, Pixyz Studio/Batch 2020.1 Python API becomes more typed and structured. To help migration from 2019 to 2020, find more information here
REMOVED FUNCTIONS
Module: Algo
- algo.combineMeshesByVisibleMaterials
- algo.fillNormalMap
- algo.toEditableMesh
Module: CAD
- cad.addSurfaceDefinition()
Module: IO
- io.importWizard() (replaced by "wizardio.importWizard)")
ADDED FUNCTIONS
Module: Algo
- algo.crackNonManifoldVertices
- algo.decimatePointClouds
- algo.lineToTexture
- algo.moebiusCracker
- algo.optimizeTextureSize
- algo.removeMultiplePolygon
- algo.sewBoundary
- algo.sweep
Module: CAD
- cad.createCoEdge
- cad.getFaceParametricBoundaries
Module: Geom
- geom.fromTRS
- geom.toTRS
Module: IO
- io.importFiles()
Module: Material
- material.getImageSize
- material.resizeImage
Module: Scene
- scene.createCone
- scene.createCube
- scene.createCylinder
- scene.createImmersion
- scene.createOccurrenceFromText
- scene.createPlane
- scene.createRayProber
- scene.createTorus
- scene.getPartsModels
- scene.insertDefaultLightsInTree
- scene.mergePartsByName
- scene.selectPartOccurrencesInBox
- scene.updateRayProber
Module: View
- view.addNotification
- view.createViewer
- view.fitView
- view.getDepthTextureHandle
- view.getMainViewerCuttingPlaneProperty
- view.getMainViewerExplodeViewProperty
- view.getMainViewerProperty
- viewer.removeRoot
- viewer.setCameraPosition
- viewer.setMainViewerCuttingPlaneProperty
- viewer.setMainViewerExplodeViewProperty ?
- viewer.setMainViewerProperty
- viewer.setViewerMatrices
- viewer.takeScreenshot
ADDED MODULE
- CoreGUI
- SceenGUI
- ViewGUI
- WizardIO
RENAMED FUNCTIONS
Module: Algo
- algo.backToBRep -> material.algo.backToInitialBRep
Module: CAD
- cad.getLoopOrientedEdges -> cad.getLoopCoEdges
MODIFIED FUNCTIONS
Module: Algo
bakeMaps
bakeMaps(destinationOccurrences, sourceOccurrences, mapsToBake, /, channel, resolution, padding, shareMaps, mapSuffix, additionalCustomMaps, tolerance)
Bake texture maps on meshes from self or other meshes
Parameters
----------
destinationOccurrences : OccurrenceList
Occurrences of the meshes where to store the baked map
sourceOccurrences : OccurrenceList
Occurrences of components from which to bake maps (if empty use destination)
mapsToBake : MapTypeList
List of map to generate (Normal, Diffuse, ...)
channel : Int , optional
(default: 0)
UV channel of destOccurrence to use for the map generation
resolution : Int , optional
(default: 1024)
Map resolution
padding : Int , optional
(default: 1)
Add padding to the map
shareMaps : Boolean , optional
(default: true)
If true, all the destinationOccurrences will share the same maps
mapSuffix : String , optional
(default: "")
Add a suffix to the map names
additionalCustomMaps : CustomBakeMapList , optional
(default: )
Additional custom maps to bake
tolerance : Distance , optional
(default: -1)
Tolerance of projection for baking from source to destination
Returns:
-------
bakedMaps : ImageList
Baked map list
mapUvOnBox
mapUvOnBox(occurrences, affine, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a box
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine : Affine Box
Affine transformation of the box
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
mapUvOnCylinder
mapUvOnCylinder(occurrences, affine, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a cylinder
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine : Affine Cylinder
Affine transformation of the cylinder
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
mapUvOnPlane
mapUvOnPlane(occurrences, affine, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a plane
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine : Affine Plane
Affine transformation of the plane
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
mapUvOnSphere
mapUvOnSphere(occurrences, affine, /, channel, overideExistingUvs)
Generate texture coordinates using the projection on a sphere
Parameters
----------
occurrences : OccurrenceList
Occurrences of part to process
affine : Affine Sphere
Affine transformation of the sphere
channel : Int , optional
(default: 0)
The UV channel which will contains the texture coordinates
overideExistingUvs : Boolean , optional
(default: true)
If True, overide existing UVs on channel
Module: CAD
createLoop
createLoop(edges coEdges, orientations, /, check)
Create a loop from a set of edges of a set of orientations
Parameters
----------
edges coEdges : CoEdgeList
List of edges coEdges composing the loop
orientations : OrientationList
List of orientations for each edges
check : Boolean , optional
(default: true)
If true, the loop check if edges are well connected or not
getCoEdgeDefinition
getCoEdgeDefinition(coEdge)
get all parameters contained in the coEdge
Parameters
----------
coEdge : CoEdge
The coEdge
Returns:
-------
edge : Edge
The edge of the coEdge
edgeOrientation : Orientation
Orientation of the edge
loop : Loop
The loop containing the coEdge
surface : Surface
The surface of the coEdge
parametricCurve : LimitedSurface
The parametricCurve of the coEdge
getEdgeDefinition
getEdgeDefinition(edge)
get all parameters contained in the edge
Parameters
----------
edge : Edge
The edge
Returns:
-------
vertex1 : Vertex
The first vertex of the edge
vertex2 : Vertex
The second vertex of the edge
curve : Curve
The curve of the edge
bounds : Bounds1D
The bounds of the edge
surfaceDefinitions : EdgeSurfaceDefinitionList
Surfaces linked to the edges
getFaceDefinition
getFaceDefinition(face)
get all parameters contain in the face
Parameters
----------
face : Face
The face
Returns:
-------
surface : Surface
The surface contain within the face
loops : LoopList
The loops contain within the face
orientation : Orientation
Relative orientation of the surface
getLoopOrientedEdges getLoopCoEdges
getLoopCoEdges(loop)
get all orientedEdges coEdges contain in the loop
Parameters
----------
loop : Loop
The loop
Returns:
-------
orientedEdges coEdges : CoEdgeList
The orientedEdges coEdges contain within the loop
Module: Core
setModuleProperty
setModuleProperty(module, propertyName, propertyValue)
Set the value of a module property
Parameters
----------
module : String
Name of the module
propertyName : String
The property name
propertyValue : String
The property value
Returns:
-------
value : String
The property value as String
Module: Scenario
generateLODChain
generateLODChain(occurrences, /, decimateParametersList)
Automatically generates 3 LODs for the current selection.
Parameters
----------
occurrences : OccurrenceList
Scene paths of components to process
decimateParametersList : DecimateParametersList , optional
(default: [scenario.DecimateParameters(1., 0.1, 5.), scenario.DecimateParameters(2., 1., 10.)])
The list of all LOD decimate parameters
generatePhantomMesh
generatePhantomMesh(occurrences, /, generateDiffuseMap)
Automatically generates one unique optimized mesh out of the models in the scene, with material(s).
Parameters
----------
occurrences : OccurrenceList
Scene path of component to process
generateDiffuseMap : GenerateDiffuseMap , optional
(default: ["yes", [1024, 1]] scenario.BakeOptions(1024, 1)])
Module: Scene
createSpotLight
createSpotLight(color, power, /, position, direction, cutoff)
Create a new spot light
Parameters
----------
color : Color
Color of the light
power : Double
Intensity of the light
position : Point3 , optional
(default: )
Relative position of the light
direction : Vector3 , optional
(default: [0,0,1] geom.Vector3(0,0,1))
Relative direction of the light
cutoff : Angle , optional
(default: 20)
Cutoff angle of the spot light
Returns:
-------
light : SpotLight
The created spot light
makeInstanceUnique
makeInstanceUnique(root occurrences, /)
Singularize all instances on the sub-tree of an occurrence
Parameters
----------
root occurrences : Occurrence OccurrenceList , optional
(default: 0)
Root occurrence for the process
resetTransform
resetTransform(root, keepPartTransform, / /, recursive, keepInstantiation, keepPartTransform)
Set all transformation matrices to identity in a sub-tree
Parameters
----------
root : Occurrence, optional
(default: 0)
Root occurrence for the process
recursive : Boolean , optional
(default: true)
If False, transformation will be applied only on the root and its components
keepInstantiation : Boolean , optional
(default: true)
If False, all occurrences will be singularized
keepPartTransform : Boolean , optional
(default: false)
If False, transformation will be applied to the shapes (BRepShape points or TessellatedShape vertices)
Module: View
getCurrentCamera
getCurrentCamera()
Returns the information of the current camera (used in the main viewer)
Returns:
-------
position : Point3 camera : Camera
Position of the camera Current camera