class_arraymesh.rst 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ArrayMesh.xml.
  6. .. _class_ArrayMesh:
  7. ArrayMesh
  8. =========
  9. **Inherits:** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. :ref:`Mesh<class_Mesh>` type that provides utility for constructing a surface from arrays.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The **ArrayMesh** is used to construct a :ref:`Mesh<class_Mesh>` by specifying the attributes as arrays.
  15. The most basic example is the creation of a single triangle:
  16. ::
  17. var vertices = PoolVector3Array()
  18. vertices.push_back(Vector3(0, 1, 0))
  19. vertices.push_back(Vector3(1, 0, 0))
  20. vertices.push_back(Vector3(0, 0, 1))
  21. # Initialize the ArrayMesh.
  22. var arr_mesh = ArrayMesh.new()
  23. var arrays = []
  24. arrays.resize(ArrayMesh.ARRAY_MAX)
  25. arrays[ArrayMesh.ARRAY_VERTEX] = vertices
  26. # Create the Mesh.
  27. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
  28. var m = MeshInstance.new()
  29. m.mesh = arr_mesh
  30. The :ref:`MeshInstance<class_MeshInstance>` is ready to be added to the :ref:`SceneTree<class_SceneTree>` to be shown.
  31. See also :ref:`ImmediateGeometry<class_ImmediateGeometry>`, :ref:`MeshDataTool<class_MeshDataTool>` 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. .. rst-class:: classref-introduction-group
  34. Tutorials
  35. ---------
  36. - :doc:`../tutorials/3d/procedural_geometry/arraymesh`
  37. .. rst-class:: classref-reftable-group
  38. Properties
  39. ----------
  40. .. table::
  41. :widths: auto
  42. +-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
  43. | :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` | :ref:`blend_shape_mode<class_ArrayMesh_property_blend_shape_mode>` | ``1`` |
  44. +-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
  45. | :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_ArrayMesh_property_custom_aabb>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
  46. +-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
  47. .. rst-class:: classref-reftable-group
  48. Methods
  49. -------
  50. .. table::
  51. :widths: auto
  52. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`add_blend_shape<class_ArrayMesh_method_add_blend_shape>` **(** :ref:`String<class_String>` name **)** |
  54. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>` **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)** |
  56. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`clear_blend_shapes<class_ArrayMesh_method_clear_blend_shapes>` **(** **)** |
  58. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`clear_surfaces<class_ArrayMesh_method_clear_surfaces>` **(** **)** |
  60. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_blend_shape_count<class_ArrayMesh_method_get_blend_shape_count>` **(** **)** |const| |
  62. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`String<class_String>` | :ref:`get_blend_shape_name<class_ArrayMesh_method_get_blend_shape_name>` **(** :ref:`int<class_int>` index **)** |const| |
  64. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`lightmap_unwrap<class_ArrayMesh_method_lightmap_unwrap>` **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)** |
  66. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`regen_normalmaps<class_ArrayMesh_method_regen_normalmaps>` **(** **)** |
  68. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`set_blend_shape_name<class_ArrayMesh_method_set_blend_shape_name>` **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)** |
  70. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`surface_find_by_name<class_ArrayMesh_method_surface_find_by_name>` **(** :ref:`String<class_String>` name **)** |const| |
  72. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`surface_get_array_index_len<class_ArrayMesh_method_surface_get_array_index_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  74. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`surface_get_array_len<class_ArrayMesh_method_surface_get_array_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  76. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`int<class_int>` | :ref:`surface_get_format<class_ArrayMesh_method_surface_get_format>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  78. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`String<class_String>` | :ref:`surface_get_name<class_ArrayMesh_method_surface_get_name>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  80. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` | :ref:`surface_get_primitive_type<class_ArrayMesh_method_surface_get_primitive_type>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  82. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`surface_remove<class_ArrayMesh_method_surface_remove>` **(** :ref:`int<class_int>` surf_idx **)** |
  84. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`surface_set_name<class_ArrayMesh_method_surface_set_name>` **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)** |
  86. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`surface_update_region<class_ArrayMesh_method_surface_update_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)** |
  88. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. .. rst-class:: classref-section-separator
  90. ----
  91. .. rst-class:: classref-descriptions-group
  92. Enumerations
  93. ------------
  94. .. _enum_ArrayMesh_ArrayType:
  95. .. rst-class:: classref-enumeration
  96. enum **ArrayType**:
  97. .. _class_ArrayMesh_constant_ARRAY_VERTEX:
  98. .. rst-class:: classref-enumeration-constant
  99. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_VERTEX** = ``0``
  100. :ref:`PoolVector3Array<class_PoolVector3Array>`, :ref:`PoolVector2Array<class_PoolVector2Array>`, or :ref:`Array<class_Array>` of vertex positions.
  101. .. _class_ArrayMesh_constant_ARRAY_NORMAL:
  102. .. rst-class:: classref-enumeration-constant
  103. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_NORMAL** = ``1``
  104. :ref:`PoolVector3Array<class_PoolVector3Array>` of vertex normals.
  105. .. _class_ArrayMesh_constant_ARRAY_TANGENT:
  106. .. rst-class:: classref-enumeration-constant
  107. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_TANGENT** = ``2``
  108. :ref:`PoolRealArray<class_PoolRealArray>` of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
  109. .. _class_ArrayMesh_constant_ARRAY_COLOR:
  110. .. rst-class:: classref-enumeration-constant
  111. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_COLOR** = ``3``
  112. :ref:`PoolColorArray<class_PoolColorArray>` of vertex colors.
  113. .. _class_ArrayMesh_constant_ARRAY_TEX_UV:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_TEX_UV** = ``4``
  116. :ref:`PoolVector2Array<class_PoolVector2Array>` for UV coordinates.
  117. .. _class_ArrayMesh_constant_ARRAY_TEX_UV2:
  118. .. rst-class:: classref-enumeration-constant
  119. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_TEX_UV2** = ``5``
  120. :ref:`PoolVector2Array<class_PoolVector2Array>` for second UV coordinates.
  121. .. _class_ArrayMesh_constant_ARRAY_BONES:
  122. .. rst-class:: classref-enumeration-constant
  123. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_BONES** = ``6``
  124. :ref:`PoolRealArray<class_PoolRealArray>` or :ref:`PoolIntArray<class_PoolIntArray>` of bone indices. Each element in groups of 4 floats.
  125. .. _class_ArrayMesh_constant_ARRAY_WEIGHTS:
  126. .. rst-class:: classref-enumeration-constant
  127. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_WEIGHTS** = ``7``
  128. :ref:`PoolRealArray<class_PoolRealArray>` of bone weights. Each element in groups of 4 floats.
  129. .. _class_ArrayMesh_constant_ARRAY_INDEX:
  130. .. rst-class:: classref-enumeration-constant
  131. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_INDEX** = ``8``
  132. :ref:`PoolIntArray<class_PoolIntArray>` of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the \*i\*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices.
  133. For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line.
  134. .. _class_ArrayMesh_constant_ARRAY_MAX:
  135. .. rst-class:: classref-enumeration-constant
  136. :ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_MAX** = ``9``
  137. Represents the size of the :ref:`ArrayType<enum_ArrayMesh_ArrayType>` enum.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _enum_ArrayMesh_ArrayFormat:
  141. .. rst-class:: classref-enumeration
  142. enum **ArrayFormat**:
  143. .. _class_ArrayMesh_constant_ARRAY_FORMAT_VERTEX:
  144. .. rst-class:: classref-enumeration-constant
  145. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_VERTEX** = ``1``
  146. Array format will include vertices (mandatory).
  147. .. _class_ArrayMesh_constant_ARRAY_FORMAT_NORMAL:
  148. .. rst-class:: classref-enumeration-constant
  149. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_NORMAL** = ``2``
  150. Array format will include normals.
  151. .. _class_ArrayMesh_constant_ARRAY_FORMAT_TANGENT:
  152. .. rst-class:: classref-enumeration-constant
  153. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_TANGENT** = ``4``
  154. Array format will include tangents.
  155. .. _class_ArrayMesh_constant_ARRAY_FORMAT_COLOR:
  156. .. rst-class:: classref-enumeration-constant
  157. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_COLOR** = ``8``
  158. Array format will include a color array.
  159. .. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV:
  160. .. rst-class:: classref-enumeration-constant
  161. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_TEX_UV** = ``16``
  162. Array format will include UVs.
  163. .. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV2:
  164. .. rst-class:: classref-enumeration-constant
  165. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_TEX_UV2** = ``32``
  166. Array format will include another set of UVs.
  167. .. _class_ArrayMesh_constant_ARRAY_FORMAT_BONES:
  168. .. rst-class:: classref-enumeration-constant
  169. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_BONES** = ``64``
  170. Array format will include bone indices.
  171. .. _class_ArrayMesh_constant_ARRAY_FORMAT_WEIGHTS:
  172. .. rst-class:: classref-enumeration-constant
  173. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_WEIGHTS** = ``128``
  174. Array format will include bone weights.
  175. .. _class_ArrayMesh_constant_ARRAY_FORMAT_INDEX:
  176. .. rst-class:: classref-enumeration-constant
  177. :ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_INDEX** = ``256``
  178. Index array will be used.
  179. .. rst-class:: classref-section-separator
  180. ----
  181. .. rst-class:: classref-descriptions-group
  182. Constants
  183. ---------
  184. .. _class_ArrayMesh_constant_NO_INDEX_ARRAY:
  185. .. rst-class:: classref-constant
  186. **NO_INDEX_ARRAY** = ``-1``
  187. Value used internally when no indices are present.
  188. .. _class_ArrayMesh_constant_ARRAY_WEIGHTS_SIZE:
  189. .. rst-class:: classref-constant
  190. **ARRAY_WEIGHTS_SIZE** = ``4``
  191. Amount of weights/bone indices per vertex (always 4).
  192. .. rst-class:: classref-section-separator
  193. ----
  194. .. rst-class:: classref-descriptions-group
  195. Property Descriptions
  196. ---------------------
  197. .. _class_ArrayMesh_property_blend_shape_mode:
  198. .. rst-class:: classref-property
  199. :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **blend_shape_mode** = ``1``
  200. .. rst-class:: classref-property-setget
  201. - void **set_blend_shape_mode** **(** :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` value **)**
  202. - :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **get_blend_shape_mode** **(** **)**
  203. Sets the blend shape mode to one of :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>`.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_ArrayMesh_property_custom_aabb:
  207. .. rst-class:: classref-property
  208. :ref:`AABB<class_AABB>` **custom_aabb** = ``AABB( 0, 0, 0, 0, 0, 0 )``
  209. .. rst-class:: classref-property-setget
  210. - void **set_custom_aabb** **(** :ref:`AABB<class_AABB>` value **)**
  211. - :ref:`AABB<class_AABB>` **get_custom_aabb** **(** **)**
  212. Overrides the :ref:`AABB<class_AABB>` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
  213. .. rst-class:: classref-section-separator
  214. ----
  215. .. rst-class:: classref-descriptions-group
  216. Method Descriptions
  217. -------------------
  218. .. _class_ArrayMesh_method_add_blend_shape:
  219. .. rst-class:: classref-method
  220. void **add_blend_shape** **(** :ref:`String<class_String>` name **)**
  221. Adds name for a blend shape that will be added with :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`. Must be called before surface is added.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_ArrayMesh_method_add_surface_from_arrays:
  225. .. rst-class:: classref-method
  226. void **add_surface_from_arrays** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)**
  227. Creates a new surface.
  228. Surfaces are created to be rendered using a ``primitive``, which may be any of the types defined in :ref:`PrimitiveType<enum_Mesh_PrimitiveType>`. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) :ref:`Mesh.get_surface_count<class_Mesh_method_get_surface_count>` will become the ``surf_idx`` for this new surface.
  229. The ``arrays`` argument is an array of arrays. See :ref:`ArrayType<enum_ArrayMesh_ArrayType>` for the values used in this array. For example, ``arrays[0]`` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for :ref:`ARRAY_INDEX<class_ArrayMesh_constant_ARRAY_INDEX>` if it is used.
  230. \ ``compress_flags`` is a bitfield made of :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` values. It defaults to :ref:`Mesh.ARRAY_COMPRESS_DEFAULT<class_Mesh_constant_ARRAY_COMPRESS_DEFAULT>`.
  231. \ **Note:** The default ``compress_flags`` enable :ref:`Mesh.ARRAY_COMPRESS_COLOR<class_Mesh_constant_ARRAY_COMPRESS_COLOR>`, which makes vertex colors stored as 8-bit unsigned integers. This will clamp overbright vertex colors to ``Color(1, 1, 1, 1)`` and reduce their precision. To store HDR vertex colors, remove the vertex color compression flag by passing ``Mesh.ARRAY_COMPRESS_DEFAULT ^ Mesh.ARRAY_COMPRESS_COLOR`` as the value of ``compress_flags``.
  232. .. rst-class:: classref-item-separator
  233. ----
  234. .. _class_ArrayMesh_method_clear_blend_shapes:
  235. .. rst-class:: classref-method
  236. void **clear_blend_shapes** **(** **)**
  237. Removes all blend shapes from this **ArrayMesh**.
  238. .. rst-class:: classref-item-separator
  239. ----
  240. .. _class_ArrayMesh_method_clear_surfaces:
  241. .. rst-class:: classref-method
  242. void **clear_surfaces** **(** **)**
  243. Removes all surfaces from this **ArrayMesh**.
  244. .. rst-class:: classref-item-separator
  245. ----
  246. .. _class_ArrayMesh_method_get_blend_shape_count:
  247. .. rst-class:: classref-method
  248. :ref:`int<class_int>` **get_blend_shape_count** **(** **)** |const|
  249. Returns the number of blend shapes that the **ArrayMesh** holds.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_ArrayMesh_method_get_blend_shape_name:
  253. .. rst-class:: classref-method
  254. :ref:`String<class_String>` **get_blend_shape_name** **(** :ref:`int<class_int>` index **)** |const|
  255. Returns the name of the blend shape at this index.
  256. .. rst-class:: classref-item-separator
  257. ----
  258. .. _class_ArrayMesh_method_lightmap_unwrap:
  259. .. rst-class:: classref-method
  260. :ref:`Error<enum_@GlobalScope_Error>` **lightmap_unwrap** **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)**
  261. Will perform a UV unwrap on the **ArrayMesh** to prepare the mesh for lightmapping.
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_ArrayMesh_method_regen_normalmaps:
  265. .. rst-class:: classref-method
  266. void **regen_normalmaps** **(** **)**
  267. Will regenerate normal maps for the **ArrayMesh**.
  268. .. rst-class:: classref-item-separator
  269. ----
  270. .. _class_ArrayMesh_method_set_blend_shape_name:
  271. .. rst-class:: classref-method
  272. void **set_blend_shape_name** **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)**
  273. .. container:: contribute
  274. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_ArrayMesh_method_surface_find_by_name:
  278. .. rst-class:: classref-method
  279. :ref:`int<class_int>` **surface_find_by_name** **(** :ref:`String<class_String>` name **)** |const|
  280. Returns the index of the first surface with this name held within this **ArrayMesh**. If none are found, -1 is returned.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_ArrayMesh_method_surface_get_array_index_len:
  284. .. rst-class:: classref-method
  285. :ref:`int<class_int>` **surface_get_array_index_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
  286. Returns the length in indices of the index array in the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
  287. .. rst-class:: classref-item-separator
  288. ----
  289. .. _class_ArrayMesh_method_surface_get_array_len:
  290. .. rst-class:: classref-method
  291. :ref:`int<class_int>` **surface_get_array_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
  292. Returns the length in vertices of the vertex array in the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_ArrayMesh_method_surface_get_format:
  296. .. rst-class:: classref-method
  297. :ref:`int<class_int>` **surface_get_format** **(** :ref:`int<class_int>` surf_idx **)** |const|
  298. Returns the format mask of the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
  299. .. rst-class:: classref-item-separator
  300. ----
  301. .. _class_ArrayMesh_method_surface_get_name:
  302. .. rst-class:: classref-method
  303. :ref:`String<class_String>` **surface_get_name** **(** :ref:`int<class_int>` surf_idx **)** |const|
  304. Gets the name assigned to this surface.
  305. .. rst-class:: classref-item-separator
  306. ----
  307. .. _class_ArrayMesh_method_surface_get_primitive_type:
  308. .. rst-class:: classref-method
  309. :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **surface_get_primitive_type** **(** :ref:`int<class_int>` surf_idx **)** |const|
  310. Returns the primitive type of the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
  311. .. rst-class:: classref-item-separator
  312. ----
  313. .. _class_ArrayMesh_method_surface_remove:
  314. .. rst-class:: classref-method
  315. void **surface_remove** **(** :ref:`int<class_int>` surf_idx **)**
  316. Removes a surface at position ``surf_idx``, shifting greater surfaces one ``surf_idx`` slot down.
  317. .. rst-class:: classref-item-separator
  318. ----
  319. .. _class_ArrayMesh_method_surface_set_name:
  320. .. rst-class:: classref-method
  321. void **surface_set_name** **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)**
  322. Sets a name for a given surface.
  323. .. rst-class:: classref-item-separator
  324. ----
  325. .. _class_ArrayMesh_method_surface_update_region:
  326. .. rst-class:: classref-method
  327. void **surface_update_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)**
  328. Updates a specified region of mesh arrays on the GPU.
  329. \ **Warning:** Only use if you know what you are doing. You can easily cause crashes by calling this function with improper arguments.
  330. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  331. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  332. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  333. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`