class_mesh.rst 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/Mesh.xml.
  6. .. _class_Mesh:
  7. Mesh
  8. ====
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`ArrayMesh<class_ArrayMesh>`, :ref:`ImmediateMesh<class_ImmediateMesh>`, :ref:`PlaceholderMesh<class_PlaceholderMesh>`, :ref:`PrimitiveMesh<class_PrimitiveMesh>`
  11. A :ref:`Resource<class_Resource>` that contains vertex array-based geometry.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Mesh is a type of :ref:`Resource<class_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.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - `3D Material Testers Demo <https://godotengine.org/asset-library/asset/123>`__
  20. - `3D Kinematic Character Demo <https://godotengine.org/asset-library/asset/126>`__
  21. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
  22. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  23. .. rst-class:: classref-reftable-group
  24. Properties
  25. ----------
  26. .. table::
  27. :widths: auto
  28. +---------------------------------+-------------------------------------------------------------------+--------------------+
  29. | :ref:`Vector2i<class_Vector2i>` | :ref:`lightmap_size_hint<class_Mesh_property_lightmap_size_hint>` | ``Vector2i(0, 0)`` |
  30. +---------------------------------+-------------------------------------------------------------------+--------------------+
  31. .. rst-class:: classref-reftable-group
  32. Methods
  33. -------
  34. .. table::
  35. :widths: auto
  36. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`AABB<class_AABB>` | :ref:`_get_aabb<class_Mesh_method__get_aabb>` **(** **)** |virtual| |const| |
  38. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`int<class_int>` | :ref:`_get_blend_shape_count<class_Mesh_method__get_blend_shape_count>` **(** **)** |virtual| |const| |
  40. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`StringName<class_StringName>` | :ref:`_get_blend_shape_name<class_Mesh_method__get_blend_shape_name>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  42. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`_get_surface_count<class_Mesh_method__get_surface_count>` **(** **)** |virtual| |const| |
  44. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`_set_blend_shape_name<class_Mesh_method__set_blend_shape_name>` **(** :ref:`int<class_int>` index, :ref:`StringName<class_StringName>` name **)** |virtual| |
  46. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`_surface_get_array_index_len<class_Mesh_method__surface_get_array_index_len>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  48. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`_surface_get_array_len<class_Mesh_method__surface_get_array_len>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  50. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`Array<class_Array>` | :ref:`_surface_get_arrays<class_Mesh_method__surface_get_arrays>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  52. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`Array[]<class_Array>` | :ref:`_surface_get_blend_shape_arrays<class_Mesh_method__surface_get_blend_shape_arrays>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  54. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`int<class_int>` | :ref:`_surface_get_format<class_Mesh_method__surface_get_format>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  56. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`Dictionary<class_Dictionary>` | :ref:`_surface_get_lods<class_Mesh_method__surface_get_lods>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  58. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Material<class_Material>` | :ref:`_surface_get_material<class_Mesh_method__surface_get_material>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  60. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`_surface_get_primitive_type<class_Mesh_method__surface_get_primitive_type>` **(** :ref:`int<class_int>` index **)** |virtual| |const| |
  62. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`_surface_set_material<class_Mesh_method__surface_set_material>` **(** :ref:`int<class_int>` index, :ref:`Material<class_Material>` material **)** |virtual| |
  64. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`ConvexPolygonShape3D<class_ConvexPolygonShape3D>` | :ref:`create_convex_shape<class_Mesh_method_create_convex_shape>` **(** :ref:`bool<class_bool>` clean=true, :ref:`bool<class_bool>` simplify=false **)** |const| |
  66. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Mesh<class_Mesh>` | :ref:`create_outline<class_Mesh_method_create_outline>` **(** :ref:`float<class_float>` margin **)** |const| |
  68. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Resource<class_Resource>` | :ref:`create_placeholder<class_Mesh_method_create_placeholder>` **(** **)** |const| |
  70. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`ConcavePolygonShape3D<class_ConcavePolygonShape3D>` | :ref:`create_trimesh_shape<class_Mesh_method_create_trimesh_shape>` **(** **)** |const| |
  72. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`TriangleMesh<class_TriangleMesh>` | :ref:`generate_triangle_mesh<class_Mesh_method_generate_triangle_mesh>` **(** **)** |const| |
  74. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`AABB<class_AABB>` | :ref:`get_aabb<class_Mesh_method_get_aabb>` **(** **)** |const| |
  76. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`get_faces<class_Mesh_method_get_faces>` **(** **)** |const| |
  78. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`int<class_int>` | :ref:`get_surface_count<class_Mesh_method_get_surface_count>` **(** **)** |const| |
  80. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`Array<class_Array>` | :ref:`surface_get_arrays<class_Mesh_method_surface_get_arrays>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  82. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`Array[]<class_Array>` | :ref:`surface_get_blend_shape_arrays<class_Mesh_method_surface_get_blend_shape_arrays>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  84. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`Material<class_Material>` | :ref:`surface_get_material<class_Mesh_method_surface_get_material>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
  86. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`surface_set_material<class_Mesh_method_surface_set_material>` **(** :ref:`int<class_int>` surf_idx, :ref:`Material<class_Material>` material **)** |
  88. +-----------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. .. rst-class:: classref-section-separator
  90. ----
  91. .. rst-class:: classref-descriptions-group
  92. Enumerations
  93. ------------
  94. .. _enum_Mesh_PrimitiveType:
  95. .. rst-class:: classref-enumeration
  96. enum **PrimitiveType**:
  97. .. _class_Mesh_constant_PRIMITIVE_POINTS:
  98. .. rst-class:: classref-enumeration-constant
  99. :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **PRIMITIVE_POINTS** = ``0``
  100. Render array as points (one vertex equals one point).
  101. .. _class_Mesh_constant_PRIMITIVE_LINES:
  102. .. rst-class:: classref-enumeration-constant
  103. :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **PRIMITIVE_LINES** = ``1``
  104. Render array as lines (every two vertices a line is created).
  105. .. _class_Mesh_constant_PRIMITIVE_LINE_STRIP:
  106. .. rst-class:: classref-enumeration-constant
  107. :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **PRIMITIVE_LINE_STRIP** = ``2``
  108. Render array as line strip.
  109. .. _class_Mesh_constant_PRIMITIVE_TRIANGLES:
  110. .. rst-class:: classref-enumeration-constant
  111. :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **PRIMITIVE_TRIANGLES** = ``3``
  112. Render array as triangles (every three vertices a triangle is created).
  113. .. _class_Mesh_constant_PRIMITIVE_TRIANGLE_STRIP:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **PRIMITIVE_TRIANGLE_STRIP** = ``4``
  116. Render array as triangle strips.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _enum_Mesh_ArrayType:
  120. .. rst-class:: classref-enumeration
  121. enum **ArrayType**:
  122. .. _class_Mesh_constant_ARRAY_VERTEX:
  123. .. rst-class:: classref-enumeration-constant
  124. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_VERTEX** = ``0``
  125. :ref:`PackedVector3Array<class_PackedVector3Array>`, :ref:`PackedVector2Array<class_PackedVector2Array>`, or :ref:`Array<class_Array>` of vertex positions.
  126. .. _class_Mesh_constant_ARRAY_NORMAL:
  127. .. rst-class:: classref-enumeration-constant
  128. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_NORMAL** = ``1``
  129. :ref:`PackedVector3Array<class_PackedVector3Array>` of vertex normals.
  130. .. _class_Mesh_constant_ARRAY_TANGENT:
  131. .. rst-class:: classref-enumeration-constant
  132. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_TANGENT** = ``2``
  133. :ref:`PackedFloat32Array<class_PackedFloat32Array>` 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.
  134. .. _class_Mesh_constant_ARRAY_COLOR:
  135. .. rst-class:: classref-enumeration-constant
  136. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_COLOR** = ``3``
  137. :ref:`PackedColorArray<class_PackedColorArray>` of vertex colors.
  138. .. _class_Mesh_constant_ARRAY_TEX_UV:
  139. .. rst-class:: classref-enumeration-constant
  140. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_TEX_UV** = ``4``
  141. :ref:`PackedVector2Array<class_PackedVector2Array>` for UV coordinates.
  142. .. _class_Mesh_constant_ARRAY_TEX_UV2:
  143. .. rst-class:: classref-enumeration-constant
  144. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_TEX_UV2** = ``5``
  145. :ref:`PackedVector2Array<class_PackedVector2Array>` for second UV coordinates.
  146. .. _class_Mesh_constant_ARRAY_CUSTOM0:
  147. .. rst-class:: classref-enumeration-constant
  148. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_CUSTOM0** = ``6``
  149. Contains custom color channel 0. :ref:`PackedByteArray<class_PackedByteArray>` if ``(format >> [constant ARRAY_FORMAT_CUSTOM0_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])`` is :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RG_HALF<class_Mesh_constant_ARRAY_CUSTOM_RG_HALF>` or :ref:`ARRAY_CUSTOM_RGBA_HALF<class_Mesh_constant_ARRAY_CUSTOM_RGBA_HALF>`. :ref:`PackedFloat32Array<class_PackedFloat32Array>` otherwise.
  150. .. _class_Mesh_constant_ARRAY_CUSTOM1:
  151. .. rst-class:: classref-enumeration-constant
  152. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_CUSTOM1** = ``7``
  153. Contains custom color channel 1. :ref:`PackedByteArray<class_PackedByteArray>` if ``(format >> [constant ARRAY_FORMAT_CUSTOM1_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])`` is :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RG_HALF<class_Mesh_constant_ARRAY_CUSTOM_RG_HALF>` or :ref:`ARRAY_CUSTOM_RGBA_HALF<class_Mesh_constant_ARRAY_CUSTOM_RGBA_HALF>`. :ref:`PackedFloat32Array<class_PackedFloat32Array>` otherwise.
  154. .. _class_Mesh_constant_ARRAY_CUSTOM2:
  155. .. rst-class:: classref-enumeration-constant
  156. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_CUSTOM2** = ``8``
  157. Contains custom color channel 2. :ref:`PackedByteArray<class_PackedByteArray>` if ``(format >> [constant ARRAY_FORMAT_CUSTOM2_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])`` is :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RG_HALF<class_Mesh_constant_ARRAY_CUSTOM_RG_HALF>` or :ref:`ARRAY_CUSTOM_RGBA_HALF<class_Mesh_constant_ARRAY_CUSTOM_RGBA_HALF>`. :ref:`PackedFloat32Array<class_PackedFloat32Array>` otherwise.
  158. .. _class_Mesh_constant_ARRAY_CUSTOM3:
  159. .. rst-class:: classref-enumeration-constant
  160. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_CUSTOM3** = ``9``
  161. Contains custom color channel 3. :ref:`PackedByteArray<class_PackedByteArray>` if ``(format >> [constant ARRAY_FORMAT_CUSTOM3_SHIFT]) & [constant ARRAY_FORMAT_CUSTOM_MASK])`` is :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RGBA8_UNORM<class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM>`, :ref:`ARRAY_CUSTOM_RG_HALF<class_Mesh_constant_ARRAY_CUSTOM_RG_HALF>` or :ref:`ARRAY_CUSTOM_RGBA_HALF<class_Mesh_constant_ARRAY_CUSTOM_RGBA_HALF>`. :ref:`PackedFloat32Array<class_PackedFloat32Array>` otherwise.
  162. .. _class_Mesh_constant_ARRAY_BONES:
  163. .. rst-class:: classref-enumeration-constant
  164. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_BONES** = ``10``
  165. :ref:`PackedFloat32Array<class_PackedFloat32Array>` or :ref:`PackedInt32Array<class_PackedInt32Array>` of bone indices. Contains either 4 or 8 numbers per vertex depending on the presence of the :ref:`ARRAY_FLAG_USE_8_BONE_WEIGHTS<class_Mesh_constant_ARRAY_FLAG_USE_8_BONE_WEIGHTS>` flag.
  166. .. _class_Mesh_constant_ARRAY_WEIGHTS:
  167. .. rst-class:: classref-enumeration-constant
  168. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_WEIGHTS** = ``11``
  169. :ref:`PackedFloat32Array<class_PackedFloat32Array>` or :ref:`PackedFloat64Array<class_PackedFloat64Array>` of bone weights in the range ``0.0`` to ``1.0`` (inclusive). Contains either 4 or 8 numbers per vertex depending on the presence of the :ref:`ARRAY_FLAG_USE_8_BONE_WEIGHTS<class_Mesh_constant_ARRAY_FLAG_USE_8_BONE_WEIGHTS>` flag.
  170. .. _class_Mesh_constant_ARRAY_INDEX:
  171. .. rst-class:: classref-enumeration-constant
  172. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_INDEX** = ``12``
  173. :ref:`PackedInt32Array<class_PackedInt32Array>` 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.
  174. 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.
  175. .. _class_Mesh_constant_ARRAY_MAX:
  176. .. rst-class:: classref-enumeration-constant
  177. :ref:`ArrayType<enum_Mesh_ArrayType>` **ARRAY_MAX** = ``13``
  178. Represents the size of the :ref:`ArrayType<enum_Mesh_ArrayType>` enum.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _enum_Mesh_ArrayCustomFormat:
  182. .. rst-class:: classref-enumeration
  183. enum **ArrayCustomFormat**:
  184. .. _class_Mesh_constant_ARRAY_CUSTOM_RGBA8_UNORM:
  185. .. rst-class:: classref-enumeration-constant
  186. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_RGBA8_UNORM** = ``0``
  187. Indicates this custom channel contains unsigned normalized byte colors from 0 to 1, encoded as :ref:`PackedByteArray<class_PackedByteArray>`.
  188. .. _class_Mesh_constant_ARRAY_CUSTOM_RGBA8_SNORM:
  189. .. rst-class:: classref-enumeration-constant
  190. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_RGBA8_SNORM** = ``1``
  191. Indicates this custom channel contains signed normalized byte colors from -1 to 1, encoded as :ref:`PackedByteArray<class_PackedByteArray>`.
  192. .. _class_Mesh_constant_ARRAY_CUSTOM_RG_HALF:
  193. .. rst-class:: classref-enumeration-constant
  194. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_RG_HALF** = ``2``
  195. Indicates this custom channel contains half precision float colors, encoded as :ref:`PackedByteArray<class_PackedByteArray>`. Only red and green channels are used.
  196. .. _class_Mesh_constant_ARRAY_CUSTOM_RGBA_HALF:
  197. .. rst-class:: classref-enumeration-constant
  198. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_RGBA_HALF** = ``3``
  199. Indicates this custom channel contains half precision float colors, encoded as :ref:`PackedByteArray<class_PackedByteArray>`.
  200. .. _class_Mesh_constant_ARRAY_CUSTOM_R_FLOAT:
  201. .. rst-class:: classref-enumeration-constant
  202. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_R_FLOAT** = ``4``
  203. Indicates this custom channel contains full float colors, in a :ref:`PackedFloat32Array<class_PackedFloat32Array>`. Only the red channel is used.
  204. .. _class_Mesh_constant_ARRAY_CUSTOM_RG_FLOAT:
  205. .. rst-class:: classref-enumeration-constant
  206. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_RG_FLOAT** = ``5``
  207. Indicates this custom channel contains full float colors, in a :ref:`PackedFloat32Array<class_PackedFloat32Array>`. Only red and green channels are used.
  208. .. _class_Mesh_constant_ARRAY_CUSTOM_RGB_FLOAT:
  209. .. rst-class:: classref-enumeration-constant
  210. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_RGB_FLOAT** = ``6``
  211. Indicates this custom channel contains full float colors, in a :ref:`PackedFloat32Array<class_PackedFloat32Array>`. Only red, green and blue channels are used.
  212. .. _class_Mesh_constant_ARRAY_CUSTOM_RGBA_FLOAT:
  213. .. rst-class:: classref-enumeration-constant
  214. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_RGBA_FLOAT** = ``7``
  215. Indicates this custom channel contains full float colors, in a :ref:`PackedFloat32Array<class_PackedFloat32Array>`.
  216. .. _class_Mesh_constant_ARRAY_CUSTOM_MAX:
  217. .. rst-class:: classref-enumeration-constant
  218. :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` **ARRAY_CUSTOM_MAX** = ``8``
  219. Represents the size of the :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` enum.
  220. .. rst-class:: classref-item-separator
  221. ----
  222. .. _enum_Mesh_ArrayFormat:
  223. .. rst-class:: classref-enumeration
  224. flags **ArrayFormat**:
  225. .. _class_Mesh_constant_ARRAY_FORMAT_VERTEX:
  226. .. rst-class:: classref-enumeration-constant
  227. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_VERTEX** = ``1``
  228. Mesh array contains vertices. All meshes require a vertex array so this should always be present.
  229. .. _class_Mesh_constant_ARRAY_FORMAT_NORMAL:
  230. .. rst-class:: classref-enumeration-constant
  231. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_NORMAL** = ``2``
  232. Mesh array contains normals.
  233. .. _class_Mesh_constant_ARRAY_FORMAT_TANGENT:
  234. .. rst-class:: classref-enumeration-constant
  235. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_TANGENT** = ``4``
  236. Mesh array contains tangents.
  237. .. _class_Mesh_constant_ARRAY_FORMAT_COLOR:
  238. .. rst-class:: classref-enumeration-constant
  239. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_COLOR** = ``8``
  240. Mesh array contains colors.
  241. .. _class_Mesh_constant_ARRAY_FORMAT_TEX_UV:
  242. .. rst-class:: classref-enumeration-constant
  243. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_TEX_UV** = ``16``
  244. Mesh array contains UVs.
  245. .. _class_Mesh_constant_ARRAY_FORMAT_TEX_UV2:
  246. .. rst-class:: classref-enumeration-constant
  247. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_TEX_UV2** = ``32``
  248. Mesh array contains second UV.
  249. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM0:
  250. .. rst-class:: classref-enumeration-constant
  251. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM0** = ``64``
  252. Mesh array contains custom channel index 0.
  253. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM1:
  254. .. rst-class:: classref-enumeration-constant
  255. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM1** = ``128``
  256. Mesh array contains custom channel index 1.
  257. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM2:
  258. .. rst-class:: classref-enumeration-constant
  259. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM2** = ``256``
  260. Mesh array contains custom channel index 2.
  261. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM3:
  262. .. rst-class:: classref-enumeration-constant
  263. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM3** = ``512``
  264. Mesh array contains custom channel index 3.
  265. .. _class_Mesh_constant_ARRAY_FORMAT_BONES:
  266. .. rst-class:: classref-enumeration-constant
  267. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_BONES** = ``1024``
  268. Mesh array contains bones.
  269. .. _class_Mesh_constant_ARRAY_FORMAT_WEIGHTS:
  270. .. rst-class:: classref-enumeration-constant
  271. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_WEIGHTS** = ``2048``
  272. Mesh array contains bone weights.
  273. .. _class_Mesh_constant_ARRAY_FORMAT_INDEX:
  274. .. rst-class:: classref-enumeration-constant
  275. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_INDEX** = ``4096``
  276. Mesh array uses indices.
  277. .. _class_Mesh_constant_ARRAY_FORMAT_BLEND_SHAPE_MASK:
  278. .. rst-class:: classref-enumeration-constant
  279. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_BLEND_SHAPE_MASK** = ``7``
  280. Mask of mesh channels permitted in blend shapes.
  281. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM_BASE:
  282. .. rst-class:: classref-enumeration-constant
  283. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM_BASE** = ``13``
  284. Shift of first custom channel.
  285. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM_BITS:
  286. .. rst-class:: classref-enumeration-constant
  287. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM_BITS** = ``3``
  288. Number of format bits per custom channel. See :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>`.
  289. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM0_SHIFT:
  290. .. rst-class:: classref-enumeration-constant
  291. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM0_SHIFT** = ``13``
  292. Amount to shift :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` for custom channel index 0.
  293. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM1_SHIFT:
  294. .. rst-class:: classref-enumeration-constant
  295. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM1_SHIFT** = ``16``
  296. Amount to shift :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` for custom channel index 1.
  297. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM2_SHIFT:
  298. .. rst-class:: classref-enumeration-constant
  299. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM2_SHIFT** = ``19``
  300. Amount to shift :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` for custom channel index 2.
  301. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM3_SHIFT:
  302. .. rst-class:: classref-enumeration-constant
  303. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM3_SHIFT** = ``22``
  304. Amount to shift :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` for custom channel index 3.
  305. .. _class_Mesh_constant_ARRAY_FORMAT_CUSTOM_MASK:
  306. .. rst-class:: classref-enumeration-constant
  307. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FORMAT_CUSTOM_MASK** = ``7``
  308. Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See :ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>`.
  309. .. _class_Mesh_constant_ARRAY_COMPRESS_FLAGS_BASE:
  310. .. rst-class:: classref-enumeration-constant
  311. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_COMPRESS_FLAGS_BASE** = ``25``
  312. Shift of first compress flag. Compress flags should be passed to :ref:`ArrayMesh.add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>` and :ref:`SurfaceTool.commit<class_SurfaceTool_method_commit>`.
  313. .. _class_Mesh_constant_ARRAY_FLAG_USE_2D_VERTICES:
  314. .. rst-class:: classref-enumeration-constant
  315. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FLAG_USE_2D_VERTICES** = ``33554432``
  316. Flag used to mark that the array contains 2D vertices.
  317. .. _class_Mesh_constant_ARRAY_FLAG_USE_DYNAMIC_UPDATE:
  318. .. rst-class:: classref-enumeration-constant
  319. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FLAG_USE_DYNAMIC_UPDATE** = ``67108864``
  320. Flag indices that the mesh data will use ``GL_DYNAMIC_DRAW`` on GLES. Unused on Vulkan.
  321. .. _class_Mesh_constant_ARRAY_FLAG_USE_8_BONE_WEIGHTS:
  322. .. rst-class:: classref-enumeration-constant
  323. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FLAG_USE_8_BONE_WEIGHTS** = ``134217728``
  324. Flag used to mark that the mesh contains up to 8 bone influences per vertex. This flag indicates that :ref:`ARRAY_BONES<class_Mesh_constant_ARRAY_BONES>` and :ref:`ARRAY_WEIGHTS<class_Mesh_constant_ARRAY_WEIGHTS>` elements will have double length.
  325. .. _class_Mesh_constant_ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY:
  326. .. rst-class:: classref-enumeration-constant
  327. :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` **ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY** = ``268435456``
  328. Flag used to mark that the mesh intentionally contains no vertex array.
  329. .. rst-class:: classref-item-separator
  330. ----
  331. .. _enum_Mesh_BlendShapeMode:
  332. .. rst-class:: classref-enumeration
  333. enum **BlendShapeMode**:
  334. .. _class_Mesh_constant_BLEND_SHAPE_MODE_NORMALIZED:
  335. .. rst-class:: classref-enumeration-constant
  336. :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **BLEND_SHAPE_MODE_NORMALIZED** = ``0``
  337. Blend shapes are normalized.
  338. .. _class_Mesh_constant_BLEND_SHAPE_MODE_RELATIVE:
  339. .. rst-class:: classref-enumeration-constant
  340. :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **BLEND_SHAPE_MODE_RELATIVE** = ``1``
  341. Blend shapes are relative to base weight.
  342. .. rst-class:: classref-section-separator
  343. ----
  344. .. rst-class:: classref-descriptions-group
  345. Property Descriptions
  346. ---------------------
  347. .. _class_Mesh_property_lightmap_size_hint:
  348. .. rst-class:: classref-property
  349. :ref:`Vector2i<class_Vector2i>` **lightmap_size_hint** = ``Vector2i(0, 0)``
  350. .. rst-class:: classref-property-setget
  351. - void **set_lightmap_size_hint** **(** :ref:`Vector2i<class_Vector2i>` value **)**
  352. - :ref:`Vector2i<class_Vector2i>` **get_lightmap_size_hint** **(** **)**
  353. Sets a hint to be used for lightmap resolution.
  354. .. rst-class:: classref-section-separator
  355. ----
  356. .. rst-class:: classref-descriptions-group
  357. Method Descriptions
  358. -------------------
  359. .. _class_Mesh_method__get_aabb:
  360. .. rst-class:: classref-method
  361. :ref:`AABB<class_AABB>` **_get_aabb** **(** **)** |virtual| |const|
  362. Virtual method to override the :ref:`AABB<class_AABB>` for a custom class extending **Mesh**.
  363. .. rst-class:: classref-item-separator
  364. ----
  365. .. _class_Mesh_method__get_blend_shape_count:
  366. .. rst-class:: classref-method
  367. :ref:`int<class_int>` **_get_blend_shape_count** **(** **)** |virtual| |const|
  368. Virtual method to override the number of blend shapes for a custom class extending **Mesh**.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_Mesh_method__get_blend_shape_name:
  372. .. rst-class:: classref-method
  373. :ref:`StringName<class_StringName>` **_get_blend_shape_name** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  374. Virtual method to override the retrieval of blend shape names for a custom class extending **Mesh**.
  375. .. rst-class:: classref-item-separator
  376. ----
  377. .. _class_Mesh_method__get_surface_count:
  378. .. rst-class:: classref-method
  379. :ref:`int<class_int>` **_get_surface_count** **(** **)** |virtual| |const|
  380. Virtual method to override the surface count for a custom class extending **Mesh**.
  381. .. rst-class:: classref-item-separator
  382. ----
  383. .. _class_Mesh_method__set_blend_shape_name:
  384. .. rst-class:: classref-method
  385. void **_set_blend_shape_name** **(** :ref:`int<class_int>` index, :ref:`StringName<class_StringName>` name **)** |virtual|
  386. Virtual method to override the names of blend shapes for a custom class extending **Mesh**.
  387. .. rst-class:: classref-item-separator
  388. ----
  389. .. _class_Mesh_method__surface_get_array_index_len:
  390. .. rst-class:: classref-method
  391. :ref:`int<class_int>` **_surface_get_array_index_len** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  392. Virtual method to override the surface array index length for a custom class extending **Mesh**.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_Mesh_method__surface_get_array_len:
  396. .. rst-class:: classref-method
  397. :ref:`int<class_int>` **_surface_get_array_len** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  398. Virtual method to override the surface array length for a custom class extending **Mesh**.
  399. .. rst-class:: classref-item-separator
  400. ----
  401. .. _class_Mesh_method__surface_get_arrays:
  402. .. rst-class:: classref-method
  403. :ref:`Array<class_Array>` **_surface_get_arrays** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  404. Virtual method to override the surface arrays for a custom class extending **Mesh**.
  405. .. rst-class:: classref-item-separator
  406. ----
  407. .. _class_Mesh_method__surface_get_blend_shape_arrays:
  408. .. rst-class:: classref-method
  409. :ref:`Array[]<class_Array>` **_surface_get_blend_shape_arrays** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  410. Virtual method to override the blend shape arrays for a custom class extending **Mesh**.
  411. .. rst-class:: classref-item-separator
  412. ----
  413. .. _class_Mesh_method__surface_get_format:
  414. .. rst-class:: classref-method
  415. :ref:`int<class_int>` **_surface_get_format** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  416. Virtual method to override the surface format for a custom class extending **Mesh**.
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_Mesh_method__surface_get_lods:
  420. .. rst-class:: classref-method
  421. :ref:`Dictionary<class_Dictionary>` **_surface_get_lods** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  422. Virtual method to override the surface LODs for a custom class extending **Mesh**.
  423. .. rst-class:: classref-item-separator
  424. ----
  425. .. _class_Mesh_method__surface_get_material:
  426. .. rst-class:: classref-method
  427. :ref:`Material<class_Material>` **_surface_get_material** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  428. Virtual method to override the surface material for a custom class extending **Mesh**.
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_Mesh_method__surface_get_primitive_type:
  432. .. rst-class:: classref-method
  433. :ref:`int<class_int>` **_surface_get_primitive_type** **(** :ref:`int<class_int>` index **)** |virtual| |const|
  434. Virtual method to override the surface primitive type for a custom class extending **Mesh**.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _class_Mesh_method__surface_set_material:
  438. .. rst-class:: classref-method
  439. void **_surface_set_material** **(** :ref:`int<class_int>` index, :ref:`Material<class_Material>` material **)** |virtual|
  440. Virtual method to override the setting of a ``material`` at the given ``index`` for a custom class extending **Mesh**.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_Mesh_method_create_convex_shape:
  444. .. rst-class:: classref-method
  445. :ref:`ConvexPolygonShape3D<class_ConvexPolygonShape3D>` **create_convex_shape** **(** :ref:`bool<class_bool>` clean=true, :ref:`bool<class_bool>` simplify=false **)** |const|
  446. Calculate a :ref:`ConvexPolygonShape3D<class_ConvexPolygonShape3D>` from the mesh.
  447. If ``clean`` is ``true`` (default), duplicate and interior vertices are removed automatically. You can set it to ``false`` to make the process faster if not needed.
  448. If ``simplify`` is ``true``, the geometry can be further simplified to reduce the number of vertices. Disabled by default.
  449. .. rst-class:: classref-item-separator
  450. ----
  451. .. _class_Mesh_method_create_outline:
  452. .. rst-class:: classref-method
  453. :ref:`Mesh<class_Mesh>` **create_outline** **(** :ref:`float<class_float>` margin **)** |const|
  454. Calculate an outline mesh at a defined offset (margin) from the original mesh.
  455. \ **Note:** This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise).
  456. .. rst-class:: classref-item-separator
  457. ----
  458. .. _class_Mesh_method_create_placeholder:
  459. .. rst-class:: classref-method
  460. :ref:`Resource<class_Resource>` **create_placeholder** **(** **)** |const|
  461. Creates a placeholder version of this resource (:ref:`PlaceholderMesh<class_PlaceholderMesh>`).
  462. .. rst-class:: classref-item-separator
  463. ----
  464. .. _class_Mesh_method_create_trimesh_shape:
  465. .. rst-class:: classref-method
  466. :ref:`ConcavePolygonShape3D<class_ConcavePolygonShape3D>` **create_trimesh_shape** **(** **)** |const|
  467. Calculate a :ref:`ConcavePolygonShape3D<class_ConcavePolygonShape3D>` from the mesh.
  468. .. rst-class:: classref-item-separator
  469. ----
  470. .. _class_Mesh_method_generate_triangle_mesh:
  471. .. rst-class:: classref-method
  472. :ref:`TriangleMesh<class_TriangleMesh>` **generate_triangle_mesh** **(** **)** |const|
  473. Generate a :ref:`TriangleMesh<class_TriangleMesh>` from the mesh. Considers only surfaces using one of these primitive types: :ref:`PRIMITIVE_TRIANGLES<class_Mesh_constant_PRIMITIVE_TRIANGLES>`, :ref:`PRIMITIVE_TRIANGLE_STRIP<class_Mesh_constant_PRIMITIVE_TRIANGLE_STRIP>`.
  474. .. rst-class:: classref-item-separator
  475. ----
  476. .. _class_Mesh_method_get_aabb:
  477. .. rst-class:: classref-method
  478. :ref:`AABB<class_AABB>` **get_aabb** **(** **)** |const|
  479. Returns the smallest :ref:`AABB<class_AABB>` enclosing this mesh in local space. Not affected by ``custom_aabb``.
  480. \ **Note:** This is only implemented for :ref:`ArrayMesh<class_ArrayMesh>` and :ref:`PrimitiveMesh<class_PrimitiveMesh>`.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_Mesh_method_get_faces:
  484. .. rst-class:: classref-method
  485. :ref:`PackedVector3Array<class_PackedVector3Array>` **get_faces** **(** **)** |const|
  486. Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_Mesh_method_get_surface_count:
  490. .. rst-class:: classref-method
  491. :ref:`int<class_int>` **get_surface_count** **(** **)** |const|
  492. Returns the number of surfaces that the **Mesh** holds.
  493. .. rst-class:: classref-item-separator
  494. ----
  495. .. _class_Mesh_method_surface_get_arrays:
  496. .. rst-class:: classref-method
  497. :ref:`Array<class_Array>` **surface_get_arrays** **(** :ref:`int<class_int>` surf_idx **)** |const|
  498. Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see :ref:`ArrayMesh.add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_Mesh_method_surface_get_blend_shape_arrays:
  502. .. rst-class:: classref-method
  503. :ref:`Array[]<class_Array>` **surface_get_blend_shape_arrays** **(** :ref:`int<class_int>` surf_idx **)** |const|
  504. Returns the blend shape arrays for the requested surface.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_Mesh_method_surface_get_material:
  508. .. rst-class:: classref-method
  509. :ref:`Material<class_Material>` **surface_get_material** **(** :ref:`int<class_int>` surf_idx **)** |const|
  510. Returns a :ref:`Material<class_Material>` in a given surface. Surface is rendered using this material.
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _class_Mesh_method_surface_set_material:
  514. .. rst-class:: classref-method
  515. void **surface_set_material** **(** :ref:`int<class_int>` surf_idx, :ref:`Material<class_Material>` material **)**
  516. Sets a :ref:`Material<class_Material>` for a given surface. Surface will be rendered using this material.
  517. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  518. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  519. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  520. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  521. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  522. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`