Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

Polygonal

Python API functions
Read time 9 minutesLast updated 19 hours ago

configureFunctionLogger

polygonal.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters

Type

Name

Description

StringfunctionName
BooleanenableFunction
BooleanenableParameters
BooleanenableExecutionTime

getPolygonCount

Returns the number of polygon of a mesh.
polygonal.getPolygonCount(mesh, asTriangleCount=False) -> core.ULong
Parameters

Type

Name

Description

MeshmeshThe mesh.
BoolasTriangleCountIf true count the equivalent of triangles for each polygon.
Returns

Type

Name

Description

ULongpolygonCountThe number of polygons.

checksum

computeMeshTopoChecksum

Compute a checksum of the mesh topology, connectivity.
polygonal.computeMeshTopoChecksum(mesh) -> core.String
Parameters

Type

Name

Description

MeshmeshThe mesh.
Returns

Type

Name

Description

StringchecksumThe mesh.
See also:

computeMeshVertexPositionsChecksum

Compute a checksum of the mesh vertices positions.
polygonal.computeMeshVertexPositionsChecksum(mesh, precisionFloat=-1) -> core.String
Parameters

Type

Name

Description

MeshmeshThe mesh.
IntprecisionFloatFloating point precision [1..24], number of significant numbers kept. -1 means no rounded will be applied.
Returns

Type

Name

Description

StringchecksumThe mesh.
See also:

computeUVTopoChecksum

Compute a checksum of the uvs topology, connectivity.
polygonal.computeUVTopoChecksum(mesh, uvChannel) -> core.String
Parameters

Type

Name

Description

MeshmeshThe mesh.
IntuvChannelThe uv channel.
Returns

Type

Name

Description

StringchecksumThe mesh.
See also:

computeUVVertexPositionsChecksum

Compute a checksum of the vertices positions in uv space.
polygonal.computeUVVertexPositionsChecksum(mesh, uvChannel, precisionFloat=-1) -> core.String
Parameters

Type

Name

Description

MeshmeshThe mesh.
IntuvChannelThe uv channel.
IntprecisionFloatFloating point precision [1..24], number of significant numbers kept. -1 means no rounded will be applied.
Returns

Type

Name

Description

StringchecksumThe mesh.
See also:

draco

dracoDecode

Decode a mesh using draco.
polygonal.dracoDecode(buffer, jointIndicesId=-1, jointWeightsId=-1) -> polygonal.StaticMesh
Parameters

Type

Name

Description

ByteListbuffer
IntjointIndicesIdUnique ID of Generic attribute encoding joint indices.
IntjointWeightsIdUnique ID of Generic attribute encoding joint weights.
Returns

Type

Name

Description

StaticMeshmesh
See also:

dracoEncode

Encode a mesh using draco.
polygonal.dracoEncode(mesh, compressionLevel=7, quantizationPosition=-1, quantizationNormal=-1, quantizationTexCoord=-1) -> core.ByteList, core.Int, core.Int
Parameters

Type

Name

Description

StaticMeshmesh
IntcompressionLevel0=faster but the worst compression, 10=slower but the best compression.
IntquantizationPositionNumber of quantization bits used for position attributes.
IntquantizationNormalNumber of quantization bits used for normal attributes.
IntquantizationTexCoordNumber of quantization bits used for texture coordinates attributes.
Returns

Type

Name

Description

ByteListbuffer
IntjointIndicesIdUnique ID of Generic attribute encoding joint indices (-1 if not applicable or if enocdeSkeleton is false).
IntjointWeightsIdUnique ID of Generic attribute encoding joint weights (-1 if not applicable or if enocdeSkeleton is false).
See also:

geometry access

createJointPlaceholders

Create fake joint to store in mesh definitions. Thus we can retrieve stored data from getJointPlaceholders.
polygonal.createJointPlaceholders(data, worldMatrices) -> polygonal.PlaceholderJointList
Parameters

Type

Name

Description

ULongListdataCreate as much joints as there are data, each joint store one data.
Matrix4ListworldMatricesWorld matrix for each joints.
Returns

Type

Name

Description

PlaceholderJointListjointsReturns one placeholder joint per given data.
See also:

createMeshFromDefinition

Create a new mesh with the given MeshDefinition.
polygonal.createMeshFromDefinition(meshDefinition) -> polygonal.Mesh
Parameters

Type

Name

Description

MeshDefinitionmeshDefinitionMesh definition.
Returns

Type

Name

Description

MeshmeshThe new mesh.
See also:

createMeshFromDefinitions

Create a new mesh from multiple MeshDefinition.
polygonal.createMeshFromDefinitions(meshDefinition) -> polygonal.Mesh
Parameters

Type

Name

Description

MeshDefinitionListmeshDefinitionThe MeshDefinitions.
Returns

Type

Name

Description

MeshmeshThe new mesh.
See also:

createMeshFromText

Creates an occurrence from string.
polygonal.createMeshFromText(text, matrix, font="ChicFont", fontSize=64, color=None, heigth3D=40) -> polygonal.Mesh, material.Material
Parameters

Type

Name

Description

StringtextText to create.
Matrix4matrixA matrix to apply on mesh.
StringfontThe font to use.
IntfontSizeThe font size.
ColorAlphacolorThe occurrence color.
Doubleheigth3D3D height of text.
Returns

Type

Name

Description

Meshmesh
Materialmaterial
See also:

createMeshesFromDefinitions

Create new meshes with the given MeshDefinitions.
polygonal.createMeshesFromDefinitions(meshDefinitions) -> polygonal.MeshList
Parameters

Type

Name

Description

MeshDefinitionListmeshDefinitionsThe MeshDefinitions.
Returns

Type

Name

Description

MeshListmeshesThe new Meshes.
See also:

getJointPlaceholders

Get data stored in joint placeholders.
polygonal.getJointPlaceholders(joints) -> core.ULongList
Parameters

Type

Name

Description

PlaceholderJointListjointsPlaceholder joints to get data from.
Returns

Type

Name

Description

ULongListdataData stored in each placehold joint (for invalid joint, returned data is undefined).
See also:

getMeshDefinition

Returns the mesh definition.
polygonal.getMeshDefinition(mesh) -> polygonal.MeshDefinition
Parameters

Type

Name

Description

MeshmeshThe mesh to get definition.
Returns

Type

Name

Description

MeshDefinitionmeshDefinitionMesh definition.
See also:

getMeshDefinitions

Returns the meshes definitions.
polygonal.getMeshDefinitions(meshes) -> polygonal.MeshDefinitionList
Parameters

Type

Name

Description

MeshListmeshesThe meshes to get definitions.
Returns

Type

Name

Description

MeshDefinitionListmeshDefinitionsThe MeshDefinitions.
See also:

getMeshSkinning

Returns the joints/IBMs list of a given mesh (those referenced by jointIndices).
polygonal.getMeshSkinning(mesh) -> polygonal.JointList, geom.Matrix4List
Parameters

Type

Name

Description

StaticMeshmesh
Returns

Type

Name

Description

JointListjoints
Matrix4ListIBMsInverse Bind Matrices.
See also:

hasMeshJoints

Check if the mesh has joints.
polygonal.hasMeshJoints(mesh) -> core.Bool
Parameters

Type

Name

Description

MeshmeshThe Mesh.
Returns

Type

Name

Description

BoolvalueReturn True if the mesh contains joints.
See also:

hasNormalizedUVs

Check if the provided mesh UV channel contains normalized texture coordinates.
polygonal.hasNormalizedUVs(mesh, channel) -> core.Bool
Parameters

Type

Name

Description

MeshmeshThe mesh that needs to be checked.
IntchannelThe channel to verity. If set to -1, all channels are checked.
Returns

Type

Name

Description

BoolvalueReturn True if the mesh UV channel is defined and contains normalized texture coordinates.
See also:

hasUVs

Check if one or some UV channels are defined in the mesh.
polygonal.hasUVs(mesh, channel=-1) -> core.Bool
Parameters

Type

Name

Description

MeshmeshThe mesh to check.
IntchannelThe UV channel to check, or -1 for any.
Returns

Type

Name

Description

BoolvalueReturn True if the mesh contains the provided UV channel, or if channel is -1 and the mesh contains any UV channel.
See also:

setMeshSkinning

Set/Replace the list of joints/IBMs of a given mesh (those referenced by jointIndices).
polygonal.setMeshSkinning(mesh, joints, IBMs)
Parameters

Type

Name

Description

StaticMeshmesh
JointListjoints
Matrix4ListIBMsInverse Bind Matrices.
See also:

modification

usePointGapFillerNormal

This triangulates a set of points and normals.
polygonal.usePointGapFillerNormal(points, normals) -> core.IntList
Parameters

Type

Name

Description

Point3ListpointsThe set of points to triangulate.
Vector3ListnormalsThe normals associated to the points to triangulate. This can be empty.
Returns

Type

Name

Description

IntListtriangulationThe indexes of the points from the given array arranged as triangles.