Scripting API

Mesh

class in UnityEngine · UnityEngine.CoreModule · inherits from Object

58 of 105 of Unity's membersUnity's documentation
In Tassix

Triangle mesh. Data lives natively; managed code keeps a cache of the channels it has read or written. Setting any channel uploads the mesh. Submeshes are ranges of one index buffer, as in Unity.

Constructors 1

Properties 23

int bindposeCount { get; }
Matrix4x4[] bindposes { get; set; }

Each bone's bind pose: from the mesh's space into the bone's, as the mesh was bound.

int blendShapeCount { get; }
BoneWeight[] boneWeights { get; set; }

Each vertex's bones and weights (none, or one per vertex).

Bounds bounds { get; set; }
Color[] colors { get; set; }
Color32[] colors32 { get; set; }
Rendering.IndexFormat indexFormat { get; set; }

16-bit indices by default, as Unity's; Tassix keeps 32-bit indices either way.

int lodCount { get; }

Growing adds empty submeshes; shrinking drops the last ones and their indices.

Vector3[] normals { get; set; }
int subMeshCount { get; set; }
Vector4[] tangents { get; set; }
int[] triangles { get; set; }
Vector2[] uv { get; set; }
Vector2[] uv2 { get; set; }
Vector2[] uv3 { get; set; }
Vector2[] uv4 { get; set; }
Vector2[] uv5 { get; set; }
Vector2[] uv6 { get; set; }
Vector2[] uv7 { get; set; }
Vector2[] uv8 { get; set; }
int vertexCount { get; }
Vector3[] vertices { get; set; }

Methods 34

void AddBlendShapeFrame(string shapeName, float frameWeight, Vector3[] deltaVertices, Vector3[]? deltaNormals, Vector3[]? deltaTangents)
void Clear()
void Clear(bool keepVertexLayout)
void ClearBlendShapes()
void CombineMeshes(CombineInstance[] combine)
void CombineMeshes(CombineInstance[] combine, bool mergeSubMeshes)
void CombineMeshes(CombineInstance[] combine, bool mergeSubMeshes, bool useMatrices)
void CombineMeshes(CombineInstance[] combine, bool mergeSubMeshes, bool useMatrices, bool hasLightmapData)

This mesh becomes the instances' meshes together: from each, the vertices its submesh's triangles span (lowest index to highest) through its matrix (normals through the inverse transpose), and that submesh's triangles renumbered; one submesh in all, or one each.

void GetBindposes(List<Matrix4x4> bindposes)
int GetBlendShapeFrameCount(int shapeIndex)
void GetBlendShapeFrameVertices(int shapeIndex, int frameIndex, Vector3[]? deltaVertices, Vector3[]? deltaNormals, Vector3[]? deltaTangents)
float GetBlendShapeFrameWeight(int shapeIndex, int frameIndex)
int GetBlendShapeIndex(string blendShapeName)
string GetBlendShapeName(int shapeIndex)
void GetBoneWeights(List<BoneWeight> boneWeights)
void GetColors(List<Color32> colors)
void GetColors(List<Color> colors)
uint GetIndexCount(int submesh)
uint GetIndexStart(int submesh)
int[] GetIndices(int submesh)
void GetIndices(List<int> indices, int submesh)
MeshLodRange GetLod(int submesh, int level)

A submesh's index range at a LOD level (0: the full mesh).

void GetNormals(List<Vector3> normals)
void GetTangents(List<Vector4> tangents)
MeshTopology GetTopology(int submesh)
int[] GetTriangles(int submesh)
void GetTriangles(List<int> triangles, int submesh)
void GetUVs(int channel, List<Vector2> uvs)
void GetUVs(int channel, List<Vector3> uvs)
void GetUVs(int channel, List<Vector4> uvs)
void GetVertices(List<Vector3> results)
void MarkDynamic()
void RecalculateBounds()

Bounds are always computed from the vertices; nothing to do.

void RecalculateNormals()
void SetBindposes(List<Matrix4x4> poses)
void SetColors(List<Color32> inColors)
void SetColors(List<Color> inColors)
void SetColors(List<Color> inColors, int start, int length)
void SetColors(List<Color> inColors, int start, int length, Rendering.MeshUpdateFlags flags)
void SetColors(Color[] inColors)
void SetColors(Color[] inColors, int start, int length)
void SetColors(Color[] inColors, int start, int length, Rendering.MeshUpdateFlags flags)
void SetColors(List<Color32> inColors, int start, int length)
void SetColors(List<Color32> inColors, int start, int length, Rendering.MeshUpdateFlags flags)
void SetColors(Color32[] inColors)
void SetColors(Color32[] inColors, int start, int length)
void SetColors(Color32[] inColors, int start, int length, Rendering.MeshUpdateFlags flags)
void SetIndices(int[] indices, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetIndices(int[] indices, MeshTopology topology, int submesh)
void SetIndices(int[] indices, MeshTopology topology, int submesh, bool calculateBounds)
void SetIndices(int[] indices, int indicesStart, int indicesLength, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetIndices(List<int> indices, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetIndices(List<int> indices, int indicesStart, int indicesLength, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetIndices(ushort[] indices, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetNormals(List<Vector3> inNormals)
void SetNormals(List<Vector3> inNormals, int start, int length)
void SetNormals(List<Vector3> inNormals, int start, int length, Rendering.MeshUpdateFlags flags)
void SetNormals(Vector3[] inNormals)
void SetNormals(Vector3[] inNormals, int start, int length)
void SetNormals(Vector3[] inNormals, int start, int length, Rendering.MeshUpdateFlags flags)
void SetTangents(List<Vector4> inTangents)
void SetTangents(List<Vector4> inTangents, int start, int length)
void SetTangents(List<Vector4> inTangents, int start, int length, Rendering.MeshUpdateFlags flags)
void SetTangents(Vector4[] inTangents)
void SetTangents(Vector4[] inTangents, int start, int length)
void SetTangents(Vector4[] inTangents, int start, int length, Rendering.MeshUpdateFlags flags)
void SetTriangles(int[] triangles, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetTriangles(int[] triangles, int submesh)
void SetTriangles(int[] triangles, int submesh, bool calculateBounds)
void SetTriangles(List<int> triangles, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetTriangles(List<int> triangles, int submesh)
void SetTriangles(List<int> triangles, int submesh, bool calculateBounds)
void SetTriangles(int[] triangles, int trianglesStart, int trianglesLength, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetTriangles(List<int> triangles, int trianglesStart, int trianglesLength, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetTriangles(ushort[] triangles, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetTriangles(ushort[] triangles, int trianglesStart, int trianglesLength, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetTriangles(List<ushort> triangles, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetTriangles(List<ushort> triangles, int trianglesStart, int trianglesLength, int submesh, bool calculateBounds = true, int baseVertex = 0)
void SetUVs(int channel, List<Vector2> uvs)
void SetUVs(int channel, List<Vector3> uvs)
void SetUVs(int channel, List<Vector4> uvs)
void SetUVs(int channel, Vector2[] uvs)
void SetUVs(int channel, Vector3[] uvs)
void SetUVs(int channel, Vector4[] uvs)
void SetUVs(int channel, List<Vector2> uvs, int start, int length)
void SetUVs(int channel, List<Vector2> uvs, int start, int length, Rendering.MeshUpdateFlags flags)
void SetUVs(int channel, List<Vector3> uvs, int start, int length)
void SetUVs(int channel, List<Vector3> uvs, int start, int length, Rendering.MeshUpdateFlags flags)
void SetUVs(int channel, List<Vector4> uvs, int start, int length)
void SetUVs(int channel, List<Vector4> uvs, int start, int length, Rendering.MeshUpdateFlags flags)
void SetUVs(int channel, Vector2[] uvs, int start, int length)
void SetUVs(int channel, Vector2[] uvs, int start, int length, Rendering.MeshUpdateFlags flags)
void SetUVs(int channel, Vector3[] uvs, int start, int length)
void SetUVs(int channel, Vector3[] uvs, int start, int length, Rendering.MeshUpdateFlags flags)
void SetUVs(int channel, Vector4[] uvs, int start, int length)
void SetUVs(int channel, Vector4[] uvs, int start, int length, Rendering.MeshUpdateFlags flags)
void SetVertices(List<Vector3> inVertices)
void SetVertices(List<Vector3> inVertices, int start, int length)
void SetVertices(List<Vector3> inVertices, int start, int length, Rendering.MeshUpdateFlags flags)
void SetVertices(Vector3[] inVertices)
void SetVertices(Vector3[] inVertices, int start, int length)
void SetVertices(Vector3[] inVertices, int start, int length, Rendering.MeshUpdateFlags flags)
void UploadMeshData(bool markNoLongerReadable)

Not in Tassix yet 47

AcquireReadOnlyMeshData AllocateWritableMeshData ApplyAndDisposeWritableMeshData GetAllBoneWeights GetBaseVertex GetBlendShapeBuffer GetBlendShapeBufferRange GetBoneWeightBuffer GetBonesPerVertex GetIndexBuffer GetLods GetNativeIndexBufferPtr GetNativeVertexBufferPtr GetSubMesh GetUVDistributionMetric GetVertexAttribute GetVertexAttributeDimension GetVertexAttributeFormat GetVertexAttributeOffset GetVertexAttributeStream GetVertexAttributes GetVertexBuffer GetVertexBufferStride HasVertexAttribute MarkModified Optimize OptimizeIndexBuffers OptimizeReorderVertexBuffer RecalculateTangents RecalculateUVDistributionMetric RecalculateUVDistributionMetrics SetBoneWeights SetIndexBufferData SetIndexBufferParams SetLod SetLods SetSubMesh SetSubMeshes SetVertexBufferData SetVertexBufferParams indexBufferTarget isReadable lodSelectionCurve skinWeightBufferLayout vertexAttributeCount vertexBufferCount vertexBufferTarget