123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/MeshDataTool.xml.
- .. _class_MeshDataTool:
- MeshDataTool
- ============
- **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Helper tool to access and edit :ref:`Mesh<class_Mesh>` data.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- MeshDataTool provides access to individual vertices in a :ref:`Mesh<class_Mesh>`. It allows users to read and edit vertex data of meshes. It also creates an array of faces and edges.
- To use MeshDataTool, load a mesh with :ref:`create_from_surface<class_MeshDataTool_method_create_from_surface>`. When you are finished editing the data commit the data to a mesh with :ref:`commit_to_surface<class_MeshDataTool_method_commit_to_surface>`.
- Below is an example of how MeshDataTool may be used.
- .. tabs::
- .. code-tab:: gdscript
- var mesh = ArrayMesh.new()
- mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, BoxMesh.new().get_mesh_arrays())
- var mdt = MeshDataTool.new()
- mdt.create_from_surface(mesh, 0)
- for i in range(mdt.get_vertex_count()):
- var vertex = mdt.get_vertex(i)
- # In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded.
- vertex += mdt.get_vertex_normal(i)
- # Save your change.
- mdt.set_vertex(i, vertex)
- mesh.clear_surfaces()
- mdt.commit_to_surface(mesh)
- var mi = MeshInstance.new()
- mi.mesh = mesh
- add_child(mi)
- .. code-tab:: csharp
- var mesh = new ArrayMesh();
- mesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, new BoxMesh().GetMeshArrays());
- var mdt = new MeshDataTool();
- mdt.CreateFromSurface(mesh, 0);
- for (var i = 0; i < mdt.GetVertexCount(); i++)
- {
- Vector3 vertex = mdt.GetVertex(i);
- // In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded.
- vertex += mdt.GetVertexNormal(i);
- // Save your change.
- mdt.SetVertex(i, vertex);
- }
- mesh.ClearSurfaces();
- mdt.CommitToSurface(mesh);
- var mi = new MeshInstance();
- mi.Mesh = mesh;
- AddChild(mi);
- See also :ref:`ArrayMesh<class_ArrayMesh>`, :ref:`ImmediateMesh<class_ImmediateMesh>` and :ref:`SurfaceTool<class_SurfaceTool>` for procedural geometry generation.
- \ **Note:** Godot uses clockwise `winding order <https://learnopengl.com/Advanced-OpenGL/Face-culling>`__ for front faces of triangle primitive modes.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Using the MeshDataTool <../tutorials/3d/procedural_geometry/meshdatatool>`
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear<class_MeshDataTool_method_clear>` **(** **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`commit_to_surface<class_MeshDataTool_method_commit_to_surface>` **(** :ref:`ArrayMesh<class_ArrayMesh>` mesh, :ref:`int<class_int>` compression_flags=0 **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`create_from_surface<class_MeshDataTool_method_create_from_surface>` **(** :ref:`ArrayMesh<class_ArrayMesh>` mesh, :ref:`int<class_int>` surface **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_edge_count<class_MeshDataTool_method_get_edge_count>` **(** **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_edge_faces<class_MeshDataTool_method_get_edge_faces>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_edge_meta<class_MeshDataTool_method_get_edge_meta>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_edge_vertex<class_MeshDataTool_method_get_edge_vertex>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` vertex **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_face_count<class_MeshDataTool_method_get_face_count>` **(** **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_face_edge<class_MeshDataTool_method_get_face_edge>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` edge **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_face_meta<class_MeshDataTool_method_get_face_meta>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_Vector3>` | :ref:`get_face_normal<class_MeshDataTool_method_get_face_normal>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_face_vertex<class_MeshDataTool_method_get_face_vertex>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` vertex **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_format<class_MeshDataTool_method_get_format>` **(** **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Material<class_Material>` | :ref:`get_material<class_MeshDataTool_method_get_material>` **(** **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_Vector3>` | :ref:`get_vertex<class_MeshDataTool_method_get_vertex>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_vertex_bones<class_MeshDataTool_method_get_vertex_bones>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_vertex_color<class_MeshDataTool_method_get_vertex_color>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_vertex_count<class_MeshDataTool_method_get_vertex_count>` **(** **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_vertex_edges<class_MeshDataTool_method_get_vertex_edges>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_vertex_faces<class_MeshDataTool_method_get_vertex_faces>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_vertex_meta<class_MeshDataTool_method_get_vertex_meta>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_Vector3>` | :ref:`get_vertex_normal<class_MeshDataTool_method_get_vertex_normal>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Plane<class_Plane>` | :ref:`get_vertex_tangent<class_MeshDataTool_method_get_vertex_tangent>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`get_vertex_uv<class_MeshDataTool_method_get_vertex_uv>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`get_vertex_uv2<class_MeshDataTool_method_get_vertex_uv2>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`get_vertex_weights<class_MeshDataTool_method_get_vertex_weights>` **(** :ref:`int<class_int>` idx **)** |const| |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_edge_meta<class_MeshDataTool_method_set_edge_meta>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_face_meta<class_MeshDataTool_method_set_face_meta>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_material<class_MeshDataTool_method_set_material>` **(** :ref:`Material<class_Material>` material **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex<class_MeshDataTool_method_set_vertex>` **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vertex **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_bones<class_MeshDataTool_method_set_vertex_bones>` **(** :ref:`int<class_int>` idx, :ref:`PackedInt32Array<class_PackedInt32Array>` bones **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_color<class_MeshDataTool_method_set_vertex_color>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_meta<class_MeshDataTool_method_set_vertex_meta>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_normal<class_MeshDataTool_method_set_vertex_normal>` **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` normal **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_tangent<class_MeshDataTool_method_set_vertex_tangent>` **(** :ref:`int<class_int>` idx, :ref:`Plane<class_Plane>` tangent **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_uv<class_MeshDataTool_method_set_vertex_uv>` **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_uv2<class_MeshDataTool_method_set_vertex_uv2>` **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv2 **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_vertex_weights<class_MeshDataTool_method_set_vertex_weights>` **(** :ref:`int<class_int>` idx, :ref:`PackedFloat32Array<class_PackedFloat32Array>` weights **)** |
- +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_MeshDataTool_method_clear:
- .. rst-class:: classref-method
- void **clear** **(** **)**
- Clears all data currently in MeshDataTool.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_commit_to_surface:
- .. rst-class:: classref-method
- :ref:`Error<enum_@GlobalScope_Error>` **commit_to_surface** **(** :ref:`ArrayMesh<class_ArrayMesh>` mesh, :ref:`int<class_int>` compression_flags=0 **)**
- Adds a new surface to specified :ref:`Mesh<class_Mesh>` with edited data.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_create_from_surface:
- .. rst-class:: classref-method
- :ref:`Error<enum_@GlobalScope_Error>` **create_from_surface** **(** :ref:`ArrayMesh<class_ArrayMesh>` mesh, :ref:`int<class_int>` surface **)**
- Uses specified surface of given :ref:`Mesh<class_Mesh>` to populate data for MeshDataTool.
- Requires :ref:`Mesh<class_Mesh>` with primitive type :ref:`Mesh.PRIMITIVE_TRIANGLES<class_Mesh_constant_PRIMITIVE_TRIANGLES>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_edge_count:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_edge_count** **(** **)** |const|
- Returns the number of edges in this :ref:`Mesh<class_Mesh>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_edge_faces:
- .. rst-class:: classref-method
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_edge_faces** **(** :ref:`int<class_int>` idx **)** |const|
- Returns array of faces that touch given edge.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_edge_meta:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **get_edge_meta** **(** :ref:`int<class_int>` idx **)** |const|
- Returns meta information assigned to given edge.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_edge_vertex:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_edge_vertex** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` vertex **)** |const|
- Returns index of specified vertex connected to given edge.
- Vertex argument can only be 0 or 1 because edges are comprised of two vertices.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_face_count:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_face_count** **(** **)** |const|
- Returns the number of faces in this :ref:`Mesh<class_Mesh>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_face_edge:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_face_edge** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` edge **)** |const|
- Returns specified edge associated with given face.
- Edge argument must be either 0, 1, or 2 because a face only has three edges.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_face_meta:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **get_face_meta** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the metadata associated with the given face.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_face_normal:
- .. rst-class:: classref-method
- :ref:`Vector3<class_Vector3>` **get_face_normal** **(** :ref:`int<class_int>` idx **)** |const|
- Calculates and returns the face normal of the given face.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_face_vertex:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_face_vertex** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` vertex **)** |const|
- Returns the specified vertex index of the given face.
- Vertex argument must be either 0, 1, or 2 because faces contain three vertices.
- \ **Example:**\
- .. tabs::
- .. code-tab:: gdscript
- var index = mesh_data_tool.get_face_vertex(0, 1) # Gets the index of the second vertex of the first face.
- var position = mesh_data_tool.get_vertex(index)
- var normal = mesh_data_tool.get_vertex_normal(index)
- .. code-tab:: csharp
- int index = meshDataTool.GetFaceVertex(0, 1); // Gets the index of the second vertex of the first face.
- Vector3 position = meshDataTool.GetVertex(index);
- Vector3 normal = meshDataTool.GetVertexNormal(index);
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_format:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_format** **(** **)** |const|
- Returns the :ref:`Mesh<class_Mesh>`'s format. Format is an integer made up of :ref:`Mesh<class_Mesh>` format flags combined together. For example, a mesh containing both vertices and normals would return a format of ``3`` because :ref:`Mesh.ARRAY_FORMAT_VERTEX<class_Mesh_constant_ARRAY_FORMAT_VERTEX>` is ``1`` and :ref:`Mesh.ARRAY_FORMAT_NORMAL<class_Mesh_constant_ARRAY_FORMAT_NORMAL>` is ``2``.
- See :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` for a list of format flags.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_material:
- .. rst-class:: classref-method
- :ref:`Material<class_Material>` **get_material** **(** **)** |const|
- Returns the material assigned to the :ref:`Mesh<class_Mesh>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex:
- .. rst-class:: classref-method
- :ref:`Vector3<class_Vector3>` **get_vertex** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the position of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_bones:
- .. rst-class:: classref-method
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_vertex_bones** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the bones of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_color:
- .. rst-class:: classref-method
- :ref:`Color<class_Color>` **get_vertex_color** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the color of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_count:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_vertex_count** **(** **)** |const|
- Returns the total number of vertices in :ref:`Mesh<class_Mesh>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_edges:
- .. rst-class:: classref-method
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_vertex_edges** **(** :ref:`int<class_int>` idx **)** |const|
- Returns an array of edges that share the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_faces:
- .. rst-class:: classref-method
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_vertex_faces** **(** :ref:`int<class_int>` idx **)** |const|
- Returns an array of faces that share the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_meta:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **get_vertex_meta** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the metadata associated with the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_normal:
- .. rst-class:: classref-method
- :ref:`Vector3<class_Vector3>` **get_vertex_normal** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the normal of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_tangent:
- .. rst-class:: classref-method
- :ref:`Plane<class_Plane>` **get_vertex_tangent** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the tangent of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_uv:
- .. rst-class:: classref-method
- :ref:`Vector2<class_Vector2>` **get_vertex_uv** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the UV of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_uv2:
- .. rst-class:: classref-method
- :ref:`Vector2<class_Vector2>` **get_vertex_uv2** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the UV2 of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_get_vertex_weights:
- .. rst-class:: classref-method
- :ref:`PackedFloat32Array<class_PackedFloat32Array>` **get_vertex_weights** **(** :ref:`int<class_int>` idx **)** |const|
- Returns bone weights of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_edge_meta:
- .. rst-class:: classref-method
- void **set_edge_meta** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)**
- Sets the metadata of the given edge.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_face_meta:
- .. rst-class:: classref-method
- void **set_face_meta** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)**
- Sets the metadata of the given face.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_material:
- .. rst-class:: classref-method
- void **set_material** **(** :ref:`Material<class_Material>` material **)**
- Sets the material to be used by newly-constructed :ref:`Mesh<class_Mesh>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex:
- .. rst-class:: classref-method
- void **set_vertex** **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vertex **)**
- Sets the position of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_bones:
- .. rst-class:: classref-method
- void **set_vertex_bones** **(** :ref:`int<class_int>` idx, :ref:`PackedInt32Array<class_PackedInt32Array>` bones **)**
- Sets the bones of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_color:
- .. rst-class:: classref-method
- void **set_vertex_color** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color **)**
- Sets the color of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_meta:
- .. rst-class:: classref-method
- void **set_vertex_meta** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)**
- Sets the metadata associated with the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_normal:
- .. rst-class:: classref-method
- void **set_vertex_normal** **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` normal **)**
- Sets the normal of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_tangent:
- .. rst-class:: classref-method
- void **set_vertex_tangent** **(** :ref:`int<class_int>` idx, :ref:`Plane<class_Plane>` tangent **)**
- Sets the tangent of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_uv:
- .. rst-class:: classref-method
- void **set_vertex_uv** **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv **)**
- Sets the UV of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_uv2:
- .. rst-class:: classref-method
- void **set_vertex_uv2** **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv2 **)**
- Sets the UV2 of the given vertex.
- .. rst-class:: classref-item-separator
- ----
- .. _class_MeshDataTool_method_set_vertex_weights:
- .. rst-class:: classref-method
- void **set_vertex_weights** **(** :ref:`int<class_int>` idx, :ref:`PackedFloat32Array<class_PackedFloat32Array>` weights **)**
- Sets the bone weights of the given vertex.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|