class_meshdatatool.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the MeshDataTool.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_MeshDataTool:
  6. MeshDataTool
  7. ============
  8. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. Helper tool to access and edit :ref:`Mesh<class_Mesh>` data.
  10. Description
  11. -----------
  12. 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.
  13. 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>`.
  14. Below is an example of how MeshDataTool may be used.
  15. ::
  16. var mesh = ArrayMesh.new()
  17. mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, CubeMesh.new().get_mesh_arrays())
  18. var mdt = MeshDataTool.new()
  19. mdt.create_from_surface(mesh, 0)
  20. for i in range(mdt.get_vertex_count()):
  21. var vertex = mdt.get_vertex(i)
  22. # In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded.
  23. vertex += mdt.get_vertex_normal(i)
  24. # Save your change.
  25. mdt.set_vertex(i, vertex)
  26. mesh.surface_remove(0)
  27. mdt.commit_to_surface(mesh)
  28. var mi = MeshInstance.new()
  29. mi.mesh = mesh
  30. add_child(mi)
  31. See also :ref:`ArrayMesh<class_ArrayMesh>`, :ref:`ImmediateGeometry<class_ImmediateGeometry>` and :ref:`SurfaceTool<class_SurfaceTool>` for procedural geometry generation.
  32. **Note:** Godot uses clockwise `winding order <https://learnopengl.com/Advanced-OpenGL/Face-culling>`__ for front faces of triangle primitive modes.
  33. Methods
  34. -------
  35. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`clear<class_MeshDataTool_method_clear>` **(** **)** |
  37. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`commit_to_surface<class_MeshDataTool_method_commit_to_surface>` **(** :ref:`ArrayMesh<class_ArrayMesh>` mesh **)** |
  39. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :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 **)** |
  41. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_edge_count<class_MeshDataTool_method_get_edge_count>` **(** **)** |const| |
  43. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_edge_faces<class_MeshDataTool_method_get_edge_faces>` **(** :ref:`int<class_int>` idx **)** |const| |
  45. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Variant<class_Variant>` | :ref:`get_edge_meta<class_MeshDataTool_method_get_edge_meta>` **(** :ref:`int<class_int>` idx **)** |const| |
  47. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :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| |
  49. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`int<class_int>` | :ref:`get_face_count<class_MeshDataTool_method_get_face_count>` **(** **)** |const| |
  51. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :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| |
  53. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Variant<class_Variant>` | :ref:`get_face_meta<class_MeshDataTool_method_get_face_meta>` **(** :ref:`int<class_int>` idx **)** |const| |
  55. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Vector3<class_Vector3>` | :ref:`get_face_normal<class_MeshDataTool_method_get_face_normal>` **(** :ref:`int<class_int>` idx **)** |const| |
  57. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :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| |
  59. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`get_format<class_MeshDataTool_method_get_format>` **(** **)** |const| |
  61. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Material<class_Material>` | :ref:`get_material<class_MeshDataTool_method_get_material>` **(** **)** |const| |
  63. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Vector3<class_Vector3>` | :ref:`get_vertex<class_MeshDataTool_method_get_vertex>` **(** :ref:`int<class_int>` idx **)** |const| |
  65. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_vertex_bones<class_MeshDataTool_method_get_vertex_bones>` **(** :ref:`int<class_int>` idx **)** |const| |
  67. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Color<class_Color>` | :ref:`get_vertex_color<class_MeshDataTool_method_get_vertex_color>` **(** :ref:`int<class_int>` idx **)** |const| |
  69. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`get_vertex_count<class_MeshDataTool_method_get_vertex_count>` **(** **)** |const| |
  71. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_vertex_edges<class_MeshDataTool_method_get_vertex_edges>` **(** :ref:`int<class_int>` idx **)** |const| |
  73. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_vertex_faces<class_MeshDataTool_method_get_vertex_faces>` **(** :ref:`int<class_int>` idx **)** |const| |
  75. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Variant<class_Variant>` | :ref:`get_vertex_meta<class_MeshDataTool_method_get_vertex_meta>` **(** :ref:`int<class_int>` idx **)** |const| |
  77. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Vector3<class_Vector3>` | :ref:`get_vertex_normal<class_MeshDataTool_method_get_vertex_normal>` **(** :ref:`int<class_int>` idx **)** |const| |
  79. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Plane<class_Plane>` | :ref:`get_vertex_tangent<class_MeshDataTool_method_get_vertex_tangent>` **(** :ref:`int<class_int>` idx **)** |const| |
  81. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Vector2<class_Vector2>` | :ref:`get_vertex_uv<class_MeshDataTool_method_get_vertex_uv>` **(** :ref:`int<class_int>` idx **)** |const| |
  83. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Vector2<class_Vector2>` | :ref:`get_vertex_uv2<class_MeshDataTool_method_get_vertex_uv2>` **(** :ref:`int<class_int>` idx **)** |const| |
  85. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`PoolRealArray<class_PoolRealArray>` | :ref:`get_vertex_weights<class_MeshDataTool_method_get_vertex_weights>` **(** :ref:`int<class_int>` idx **)** |const| |
  87. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`set_edge_meta<class_MeshDataTool_method_set_edge_meta>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)** |
  89. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`set_face_meta<class_MeshDataTool_method_set_face_meta>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)** |
  91. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`set_material<class_MeshDataTool_method_set_material>` **(** :ref:`Material<class_Material>` material **)** |
  93. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | void | :ref:`set_vertex<class_MeshDataTool_method_set_vertex>` **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vertex **)** |
  95. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | void | :ref:`set_vertex_bones<class_MeshDataTool_method_set_vertex_bones>` **(** :ref:`int<class_int>` idx, :ref:`PoolIntArray<class_PoolIntArray>` bones **)** |
  97. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`set_vertex_color<class_MeshDataTool_method_set_vertex_color>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color **)** |
  99. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`set_vertex_meta<class_MeshDataTool_method_set_vertex_meta>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)** |
  101. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`set_vertex_normal<class_MeshDataTool_method_set_vertex_normal>` **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` normal **)** |
  103. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`set_vertex_tangent<class_MeshDataTool_method_set_vertex_tangent>` **(** :ref:`int<class_int>` idx, :ref:`Plane<class_Plane>` tangent **)** |
  105. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`set_vertex_uv<class_MeshDataTool_method_set_vertex_uv>` **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv **)** |
  107. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`set_vertex_uv2<class_MeshDataTool_method_set_vertex_uv2>` **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv2 **)** |
  109. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`set_vertex_weights<class_MeshDataTool_method_set_vertex_weights>` **(** :ref:`int<class_int>` idx, :ref:`PoolRealArray<class_PoolRealArray>` weights **)** |
  111. +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. Method Descriptions
  113. -------------------
  114. .. _class_MeshDataTool_method_clear:
  115. - void **clear** **(** **)**
  116. Clears all data currently in MeshDataTool.
  117. ----
  118. .. _class_MeshDataTool_method_commit_to_surface:
  119. - :ref:`Error<enum_@GlobalScope_Error>` **commit_to_surface** **(** :ref:`ArrayMesh<class_ArrayMesh>` mesh **)**
  120. Adds a new surface to specified :ref:`Mesh<class_Mesh>` with edited data.
  121. ----
  122. .. _class_MeshDataTool_method_create_from_surface:
  123. - :ref:`Error<enum_@GlobalScope_Error>` **create_from_surface** **(** :ref:`ArrayMesh<class_ArrayMesh>` mesh, :ref:`int<class_int>` surface **)**
  124. Uses specified surface of given :ref:`Mesh<class_Mesh>` to populate data for MeshDataTool.
  125. Requires :ref:`Mesh<class_Mesh>` with primitive type :ref:`Mesh.PRIMITIVE_TRIANGLES<class_Mesh_constant_PRIMITIVE_TRIANGLES>`.
  126. ----
  127. .. _class_MeshDataTool_method_get_edge_count:
  128. - :ref:`int<class_int>` **get_edge_count** **(** **)** |const|
  129. Returns the number of edges in this :ref:`Mesh<class_Mesh>`.
  130. ----
  131. .. _class_MeshDataTool_method_get_edge_faces:
  132. - :ref:`PoolIntArray<class_PoolIntArray>` **get_edge_faces** **(** :ref:`int<class_int>` idx **)** |const|
  133. Returns array of faces that touch given edge.
  134. ----
  135. .. _class_MeshDataTool_method_get_edge_meta:
  136. - :ref:`Variant<class_Variant>` **get_edge_meta** **(** :ref:`int<class_int>` idx **)** |const|
  137. Returns meta information assigned to given edge.
  138. ----
  139. .. _class_MeshDataTool_method_get_edge_vertex:
  140. - :ref:`int<class_int>` **get_edge_vertex** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` vertex **)** |const|
  141. Returns index of specified vertex connected to given edge.
  142. Vertex argument can only be 0 or 1 because edges are comprised of two vertices.
  143. ----
  144. .. _class_MeshDataTool_method_get_face_count:
  145. - :ref:`int<class_int>` **get_face_count** **(** **)** |const|
  146. Returns the number of faces in this :ref:`Mesh<class_Mesh>`.
  147. ----
  148. .. _class_MeshDataTool_method_get_face_edge:
  149. - :ref:`int<class_int>` **get_face_edge** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` edge **)** |const|
  150. Returns specified edge associated with given face.
  151. Edge argument must be either 0, 1, or 2 because a face only has three edges.
  152. ----
  153. .. _class_MeshDataTool_method_get_face_meta:
  154. - :ref:`Variant<class_Variant>` **get_face_meta** **(** :ref:`int<class_int>` idx **)** |const|
  155. Returns the metadata associated with the given face.
  156. ----
  157. .. _class_MeshDataTool_method_get_face_normal:
  158. - :ref:`Vector3<class_Vector3>` **get_face_normal** **(** :ref:`int<class_int>` idx **)** |const|
  159. Calculates and returns the face normal of the given face.
  160. ----
  161. .. _class_MeshDataTool_method_get_face_vertex:
  162. - :ref:`int<class_int>` **get_face_vertex** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` vertex **)** |const|
  163. Returns the specified vertex of the given face.
  164. Vertex argument must be either 0, 1, or 2 because faces contain three vertices.
  165. ----
  166. .. _class_MeshDataTool_method_get_format:
  167. - :ref:`int<class_int>` **get_format** **(** **)** |const|
  168. 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:`ArrayMesh.ARRAY_FORMAT_VERTEX<class_ArrayMesh_constant_ARRAY_FORMAT_VERTEX>` is ``1`` and :ref:`ArrayMesh.ARRAY_FORMAT_NORMAL<class_ArrayMesh_constant_ARRAY_FORMAT_NORMAL>` is ``2``.
  169. See :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` for a list of format flags.
  170. ----
  171. .. _class_MeshDataTool_method_get_material:
  172. - :ref:`Material<class_Material>` **get_material** **(** **)** |const|
  173. Returns the material assigned to the :ref:`Mesh<class_Mesh>`.
  174. ----
  175. .. _class_MeshDataTool_method_get_vertex:
  176. - :ref:`Vector3<class_Vector3>` **get_vertex** **(** :ref:`int<class_int>` idx **)** |const|
  177. Returns the vertex at given index.
  178. ----
  179. .. _class_MeshDataTool_method_get_vertex_bones:
  180. - :ref:`PoolIntArray<class_PoolIntArray>` **get_vertex_bones** **(** :ref:`int<class_int>` idx **)** |const|
  181. Returns the bones of the given vertex.
  182. ----
  183. .. _class_MeshDataTool_method_get_vertex_color:
  184. - :ref:`Color<class_Color>` **get_vertex_color** **(** :ref:`int<class_int>` idx **)** |const|
  185. Returns the color of the given vertex.
  186. ----
  187. .. _class_MeshDataTool_method_get_vertex_count:
  188. - :ref:`int<class_int>` **get_vertex_count** **(** **)** |const|
  189. Returns the total number of vertices in :ref:`Mesh<class_Mesh>`.
  190. ----
  191. .. _class_MeshDataTool_method_get_vertex_edges:
  192. - :ref:`PoolIntArray<class_PoolIntArray>` **get_vertex_edges** **(** :ref:`int<class_int>` idx **)** |const|
  193. Returns an array of edges that share the given vertex.
  194. ----
  195. .. _class_MeshDataTool_method_get_vertex_faces:
  196. - :ref:`PoolIntArray<class_PoolIntArray>` **get_vertex_faces** **(** :ref:`int<class_int>` idx **)** |const|
  197. Returns an array of faces that share the given vertex.
  198. ----
  199. .. _class_MeshDataTool_method_get_vertex_meta:
  200. - :ref:`Variant<class_Variant>` **get_vertex_meta** **(** :ref:`int<class_int>` idx **)** |const|
  201. Returns the metadata associated with the given vertex.
  202. ----
  203. .. _class_MeshDataTool_method_get_vertex_normal:
  204. - :ref:`Vector3<class_Vector3>` **get_vertex_normal** **(** :ref:`int<class_int>` idx **)** |const|
  205. Returns the normal of the given vertex.
  206. ----
  207. .. _class_MeshDataTool_method_get_vertex_tangent:
  208. - :ref:`Plane<class_Plane>` **get_vertex_tangent** **(** :ref:`int<class_int>` idx **)** |const|
  209. Returns the tangent of the given vertex.
  210. ----
  211. .. _class_MeshDataTool_method_get_vertex_uv:
  212. - :ref:`Vector2<class_Vector2>` **get_vertex_uv** **(** :ref:`int<class_int>` idx **)** |const|
  213. Returns the UV of the given vertex.
  214. ----
  215. .. _class_MeshDataTool_method_get_vertex_uv2:
  216. - :ref:`Vector2<class_Vector2>` **get_vertex_uv2** **(** :ref:`int<class_int>` idx **)** |const|
  217. Returns the UV2 of the given vertex.
  218. ----
  219. .. _class_MeshDataTool_method_get_vertex_weights:
  220. - :ref:`PoolRealArray<class_PoolRealArray>` **get_vertex_weights** **(** :ref:`int<class_int>` idx **)** |const|
  221. Returns bone weights of the given vertex.
  222. ----
  223. .. _class_MeshDataTool_method_set_edge_meta:
  224. - void **set_edge_meta** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)**
  225. Sets the metadata of the given edge.
  226. ----
  227. .. _class_MeshDataTool_method_set_face_meta:
  228. - void **set_face_meta** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)**
  229. Sets the metadata of the given face.
  230. ----
  231. .. _class_MeshDataTool_method_set_material:
  232. - void **set_material** **(** :ref:`Material<class_Material>` material **)**
  233. Sets the material to be used by newly-constructed :ref:`Mesh<class_Mesh>`.
  234. ----
  235. .. _class_MeshDataTool_method_set_vertex:
  236. - void **set_vertex** **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` vertex **)**
  237. Sets the position of the given vertex.
  238. ----
  239. .. _class_MeshDataTool_method_set_vertex_bones:
  240. - void **set_vertex_bones** **(** :ref:`int<class_int>` idx, :ref:`PoolIntArray<class_PoolIntArray>` bones **)**
  241. Sets the bones of the given vertex.
  242. ----
  243. .. _class_MeshDataTool_method_set_vertex_color:
  244. - void **set_vertex_color** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color **)**
  245. Sets the color of the given vertex.
  246. ----
  247. .. _class_MeshDataTool_method_set_vertex_meta:
  248. - void **set_vertex_meta** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` meta **)**
  249. Sets the metadata associated with the given vertex.
  250. ----
  251. .. _class_MeshDataTool_method_set_vertex_normal:
  252. - void **set_vertex_normal** **(** :ref:`int<class_int>` idx, :ref:`Vector3<class_Vector3>` normal **)**
  253. Sets the normal of the given vertex.
  254. ----
  255. .. _class_MeshDataTool_method_set_vertex_tangent:
  256. - void **set_vertex_tangent** **(** :ref:`int<class_int>` idx, :ref:`Plane<class_Plane>` tangent **)**
  257. Sets the tangent of the given vertex.
  258. ----
  259. .. _class_MeshDataTool_method_set_vertex_uv:
  260. - void **set_vertex_uv** **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv **)**
  261. Sets the UV of the given vertex.
  262. ----
  263. .. _class_MeshDataTool_method_set_vertex_uv2:
  264. - void **set_vertex_uv2** **(** :ref:`int<class_int>` idx, :ref:`Vector2<class_Vector2>` uv2 **)**
  265. Sets the UV2 of the given vertex.
  266. ----
  267. .. _class_MeshDataTool_method_set_vertex_weights:
  268. - void **set_vertex_weights** **(** :ref:`int<class_int>` idx, :ref:`PoolRealArray<class_PoolRealArray>` weights **)**
  269. Sets the bone weights of the given vertex.
  270. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  271. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  272. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`