Class Polygonal
Inheritance
Namespace:
Syntax
Methods
configureFunctionLogger
Declaration
polygonal.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)Parameters
| Type | Name | Description | 
|---|---|---|
| String | functionName | |
| Boolean | enableFunction | |
| Boolean | enableParameters | |
| Boolean | enableExecutionTime | 
getPolygonCount
Returns the number of polygon of a mesh
Declaration
polygonal.getPolygonCount(mesh, asTriangleCount=False) -> core.ULongParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh | 
| Bool | asTriangleCount | If true count the equivalent of triangles for each polygon | 
Returns
| Type | Description | 
|---|---|
| ULong | The number of polygons | 
computeMeshTopoChecksum
Compute a checksum of the mesh topology, connectivity
See also:
Declaration
polygonal.computeMeshTopoChecksum(mesh) -> core.StringParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh | 
Returns
| Type | Description | 
|---|---|
| String | The mesh | 
computeMeshVertexPositionsChecksum
Compute a checksum of the mesh vertices positions
See also:
Declaration
polygonal.computeMeshVertexPositionsChecksum(mesh, precisionFloat=-1) -> core.StringParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh | 
| Int | precisionFloat | Floating point precision [1..24], number of significant numbers kept. -1 means no rounded will be applied | 
Returns
| Type | Description | 
|---|---|
| String | The mesh | 
computeUVTopoChecksum
Compute a checksum of the uvs topology, connectivity
See also:
Declaration
polygonal.computeUVTopoChecksum(mesh, uvChannel) -> core.StringParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh | 
| Int | uvChannel | The uv channel | 
Returns
| Type | Description | 
|---|---|
| String | The mesh | 
computeUVVertexPositionsChecksum
Compute a checksum of the vertices positions in uv space
See also:
Declaration
polygonal.computeUVVertexPositionsChecksum(mesh, uvChannel, precisionFloat=-1) -> core.StringParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh | 
| Int | uvChannel | The uv channel | 
| Int | precisionFloat | Floating point precision [1..24], number of significant numbers kept. -1 means no rounded will be applied | 
Returns
| Type | Description | 
|---|---|
| String | The mesh | 
dracoDecode
Declaration
polygonal.dracoDecode(buffer, jointIndicesId=-1, jointWeightsId=-1) -> polygonal.StaticMeshParameters
| Type | Name | Description | 
|---|---|---|
| ByteList | buffer | |
| Int | jointIndicesId | Unique ID of Generic attribute encoding joint indices | 
| Int | jointWeightsId | Unique ID of Generic attribute encoding joint weights | 
Returns
| Type | Description | 
|---|---|
| StaticMesh | 
dracoEncode
Declaration
polygonal.dracoEncode(mesh, compressionLevel=7, quantizationPosition=-1, quantizationNormal=-1, quantizationTexCoord=-1) -> core.ByteList, core.Int, core.IntParameters
| Type | Name | Description | 
|---|---|---|
| StaticMesh | mesh | |
| Int | compressionLevel | 0=faster but the worst compression, 10=slower but the best compression | 
| Int | quantizationPosition | Number of quantization bits used for position attributes | 
| Int | quantizationNormal | Number of quantization bits used for normal attributes | 
| Int | quantizationTexCoord | Number of quantization bits used for texture coordinates attributes | 
Returns
| Type | Description | 
|---|---|
| ByteList | 
createJointPlaceholders
Create fake joint to store in mesh definitions. Thus we can retrieve stored data from getJointPlaceholders
See also:
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.createJointPlaceholders(data, worldMatrices) -> polygonal.PlaceholderJointListParameters
| Type | Name | Description | 
|---|---|---|
| ULongList | data | Create as much joints as there are data, each joint store one data | 
| Matrix4List | worldMatrices | World matrix for each joints | 
Returns
| Type | Description | 
|---|---|
| PlaceholderJointList | Returns one placeholder joint per given data | 
createMeshFromDefinition
Create a new mesh with the given MeshDefinition
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.createMeshFromDefinition(meshDefinition) -> polygonal.MeshParameters
| Type | Name | Description | 
|---|---|---|
| MeshDefinition | meshDefinition | Mesh definition | 
Returns
| Type | Description | 
|---|---|
| Mesh | The new mesh | 
createMeshFromDefinitions
Create a new mesh from multiple MeshDefinition
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.createMeshFromDefinitions(meshDefinition) -> polygonal.MeshParameters
| Type | Name | Description | 
|---|---|---|
| MeshDefinitionList | meshDefinition | The MeshDefinitions | 
Returns
| Type | Description | 
|---|---|
| Mesh | The new mesh | 
createMeshFromText
Creates an occurrence from string
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.createMeshFromText(text, matrix, font="ChicFont", fontSize=64, color=None, heigth3D=40) -> polygonal.Mesh, material.MaterialParameters
| Type | Name | Description | 
|---|---|---|
| String | text | Text to create | 
| Matrix4 | matrix | A matrix to apply on mesh | 
| String | font | The font to use | 
| Int | fontSize | The font size | 
| ColorAlpha | color | The occurrence color | 
| Double | heigth3D | 3D height of text | 
Returns
| Type | Description | 
|---|---|
| Mesh | 
createMeshesFromDefinitions
Create new meshes with the given MeshDefinitions
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.createMeshesFromDefinitions(meshDefinitions) -> polygonal.MeshListParameters
| Type | Name | Description | 
|---|---|---|
| MeshDefinitionList | meshDefinitions | The MeshDefinitions | 
Returns
| Type | Description | 
|---|---|
| MeshList | The new Meshes | 
getJointPlaceholders
Get data stored in joint placeholders
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.getJointPlaceholders(joints) -> core.ULongListParameters
| Type | Name | Description | 
|---|---|---|
| PlaceholderJointList | joints | Placeholder joints to get data from | 
Returns
| Type | Description | 
|---|---|
| ULongList | Data stored in each placehold joint (for invalid joint, returned data is undefined) | 
getMeshDefinition
Returns the mesh definition
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.getMeshDefinition(mesh) -> polygonal.MeshDefinitionParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh to get definition | 
Returns
| Type | Description | 
|---|---|
| MeshDefinition | Mesh definition | 
getMeshDefinitions
Returns the meshes definitions
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.getMeshDefinitions(meshes) -> polygonal.MeshDefinitionListParameters
| Type | Name | Description | 
|---|---|---|
| MeshList | meshes | The meshes to get definitions | 
Returns
| Type | Description | 
|---|---|
| MeshDefinitionList | The MeshDefinitions | 
getMeshSkinning
Returns the joints/IBMs list of a given mesh (those referenced by jointIndices)
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.getMeshSkinning(mesh) -> polygonal.JointList, geom.Matrix4ListParameters
| Type | Name | Description | 
|---|---|---|
| StaticMesh | mesh | 
Returns
| Type | Description | 
|---|---|
| JointList | 
hasMeshJoints
Check if the mesh has joints
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.hasMeshJoints(mesh) -> core.BoolParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The Mesh | 
Returns
| Type | Description | 
|---|---|
| Bool | Return True if the mesh contains joints | 
hasNormalizedUVs
Check if the provided mesh UV channel contains normalized texture coordinates
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasUVs
- polygonal.setMeshSkinning
Declaration
polygonal.hasNormalizedUVs(mesh, channel) -> core.BoolParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh that needs to be checked | 
| Int | channel | The channel to verity. If set to -1, all channels are checked | 
Returns
| Type | Description | 
|---|---|
| Bool | Return True if the mesh UV channel is defined and contains normalized texture coordinates | 
hasUVs
Check if one or some UV channels are defined in the mesh
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.setMeshSkinning
Declaration
polygonal.hasUVs(mesh, channel=-1) -> core.BoolParameters
| Type | Name | Description | 
|---|---|---|
| Mesh | mesh | The mesh to check | 
| Int | channel | The UV channel to check, or -1 for any | 
Returns
| Type | Description | 
|---|---|
| Bool | Return True if the mesh contains the provided UV channel, or if channel is -1 and the mesh contains any UV channel. | 
setMeshSkinning
Set/Replace the list of joints/IBMs of a given mesh (those referenced by jointIndices)
See also:
- polygonal.createJointPlaceholders
- polygonal.createMeshFromDefinition
- polygonal.createMeshFromDefinitions
- polygonal.createMeshFromText
- polygonal.createMeshesFromDefinitions
- polygonal.getJointPlaceholders
- polygonal.getMeshDefinition
- polygonal.getMeshDefinitions
- polygonal.getMeshSkinning
- polygonal.hasMeshJoints
- polygonal.hasNormalizedUVs
- polygonal.hasUVs
Declaration
polygonal.setMeshSkinning(mesh, joints, IBMs)Parameters
| Type | Name | Description | 
|---|---|---|
| StaticMesh | mesh | |
| JointList | joints | |
| Matrix4List | IBMs | Inverse Bind Matrices | 
usePointGapFillerNormal
This triangulates a set of points and normals
Declaration
polygonal.usePointGapFillerNormal(points, normals) -> core.IntListParameters
| Type | Name | Description | 
|---|---|---|
| Point3List | points | The set of points to triangulate | 
| Vector3List | normals | The normals associated to the points to triangulate. This can be empty | 
Returns
| Type | Description | 
|---|---|
| IntList | The indexes of the points from the given array arranged as triangles |