A Resource that contains vertex-array based geometry.
    public abstract class Mesh : Resource

Mesh is a type of Resource that contains vertex-array based geometry, divided in surfaces. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.

Inheritance Chain

Derived Classes


    public Vector2 LightmapSizeHint { get; set; }


    public Shape CreateConvexShape()

Calculate a ConvexPolygonShape from the mesh.

    public Mesh CreateOutline(float margin)

Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise).

    public Shape CreateTrimeshShape()

Calculate a ConcavePolygonShape from the mesh.

    public TriangleMesh GenerateTriangleMesh()

Generate a TriangleMesh from the mesh.

    public Vector3[] GetFaces()

Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.

    public Vector2 GetLightmapSizeHint()

Getter for LightmapSizeHint

    public int GetSurfaceCount()

Return the amount of surfaces that the Mesh holds.

    public void SetLightmapSizeHint(Vector2 size)

Setter for LightmapSizeHint

    public Godot.Collections.Array SurfaceGetArrays(int surfIdx)

Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see ArrayMesh.AddSurfaceFromArrays(Godot.Mesh.PrimitiveType, Godot.Collections.Array, Godot.Collections.Array, int)).

    public Godot.Collections.Array SurfaceGetBlendShapeArrays(int surfIdx)

Returns the blend shape arrays for the requested surface.

    public Material SurfaceGetMaterial(int surfIdx)

Return a Material in a given surface. Surface is rendered using this material.

Inner Types


Name Value Description
FormatVertex 1  
FormatNormal 2  
FormatTangent 4  
FormatColor 8  
FormatTexUv 16  
FormatTexUv2 32  
FormatBones 64  
FormatWeights 128  
FormatIndex 256  
CompressBase 9  
CompressVertex 512  
CompressNormal 1024  
CompressTangent 2048  
CompressColor 4096  
CompressTexUv 8192  
CompressTexUv2 16384  
CompressBones 32768  
CompressWeights 65536  
CompressIndex 131072  
FlagUse2dVertices 262144  
FlagUse16BitBones 524288  
CompressDefault 97280  


Name Value Description
Vertex 0 Array of vertices.
Normal 1 Array of normals.
Tangent 2 Array of tangents as an array of floats, 4 floats per tangent.
Color 3 Array of colors.
TexUv 4 Array of UV coordinates.
TexUv2 5 Array of second set of UV coordinates.
Bones 6 Array of bone data.
Weights 7 Array of weights.
Index 8 Array of indices.
Max 9  


Name Value Description
Normalized 0  
Relative 1  


Name Value Description
Points 0 Render array as points (one vertex equals one point).
Lines 1 Render array as lines (every two vertices a line is created).
LineStrip 2 Render array as line strip.
LineLoop 3 Render array as line loop (like line strip, but closed).
Triangles 4 Render array as triangles (every three vertices a triangle is created).
TriangleStrip 5 Render array as triangle strips.
TriangleFan 6 Render array as triangle fans.