Files
godot-docs-l10n/classes/zh_Hant/class_importermesh.rst
Rémi Verschelde c3f2364c10 Sync classref with 4.6 branch
Lots of translations invalidated (fuzzied) as we just synced Weblate.
2025-12-19 16:39:51 +01:00

405 lines
37 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_ImporterMesh:
ImporterMesh
============
**繼承:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
在匯入過程中,包含基於頂點陣列的幾何體的 :ref:`Resource<class_Resource>`\ 。
.. rst-class:: classref-introduction-group
說明
----
ImporterMesh 是一種類似於 :ref:`ArrayMesh<class_ArrayMesh>`:ref:`Resource<class_Resource>`\ 。它包含基於頂點陣列的幾何體,被分為\ *表面*\ 。每個表面都包含一個完全獨立的陣列和一個用於繪製它的材質。在設計方面,具有多個表面的網格優於單個表面,因為在 3D 編輯軟體中建立的對象通常包含多種材質。
與其運作時對應物不同,\ **ImporterMesh** 在各種匯入步驟(例如 lod 和陰影網格生成)發生之前包含網格資料。修改表面資料時,通過先呼叫 :ref:`clear()<class_ImporterMesh_method_clear>` ,然後為每個表面呼叫 :ref:`add_surface()<class_ImporterMesh_method_add_surface>`\ 。
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_blend_shape<class_ImporterMesh_method_add_blend_shape>`\ (\ name\: :ref:`String<class_String>`\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_surface<class_ImporterMesh_method_add_surface>`\ (\ primitive\: :ref:`PrimitiveType<enum_Mesh_PrimitiveType>`, arrays\: :ref:`Array<class_Array>`, blend_shapes\: :ref:`Array<class_Array>`\[:ref:`Array<class_Array>`\] = [], lods\: :ref:`Dictionary<class_Dictionary>` = {}, material\: :ref:`Material<class_Material>` = null, name\: :ref:`String<class_String>` = "", flags\: :ref:`int<class_int>` = 0\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`clear<class_ImporterMesh_method_clear>`\ (\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ImporterMesh<class_ImporterMesh>` | :ref:`from_mesh<class_ImporterMesh_method_from_mesh>`\ (\ mesh\: :ref:`Mesh<class_Mesh>`\ ) |static| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`generate_lods<class_ImporterMesh_method_generate_lods>`\ (\ normal_merge_angle\: :ref:`float<class_float>`, normal_split_angle\: :ref:`float<class_float>`, bone_transform_array\: :ref:`Array<class_Array>`\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_shape_count<class_ImporterMesh_method_get_blend_shape_count>`\ (\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` | :ref:`get_blend_shape_mode<class_ImporterMesh_method_get_blend_shape_mode>`\ (\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_blend_shape_name<class_ImporterMesh_method_get_blend_shape_name>`\ (\ blend_shape_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_lightmap_size_hint<class_ImporterMesh_method_get_lightmap_size_hint>`\ (\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`get_mesh<class_ImporterMesh_method_get_mesh>`\ (\ base_mesh\: :ref:`ArrayMesh<class_ArrayMesh>` = null\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_surface_arrays<class_ImporterMesh_method_get_surface_arrays>`\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_surface_blend_shape_arrays<class_ImporterMesh_method_get_surface_blend_shape_arrays>`\ (\ surface_idx\: :ref:`int<class_int>`, blend_shape_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_surface_count<class_ImporterMesh_method_get_surface_count>`\ (\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_surface_format<class_ImporterMesh_method_get_surface_format>`\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_surface_lod_count<class_ImporterMesh_method_get_surface_lod_count>`\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_surface_lod_indices<class_ImporterMesh_method_get_surface_lod_indices>`\ (\ surface_idx\: :ref:`int<class_int>`, lod_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_surface_lod_size<class_ImporterMesh_method_get_surface_lod_size>`\ (\ surface_idx\: :ref:`int<class_int>`, lod_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Material<class_Material>` | :ref:`get_surface_material<class_ImporterMesh_method_get_surface_material>`\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_surface_name<class_ImporterMesh_method_get_surface_name>`\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` | :ref:`get_surface_primitive_type<class_ImporterMesh_method_get_surface_primitive_type>`\ (\ surface_idx\: :ref:`int<class_int>`\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_blend_shape_mode<class_ImporterMesh_method_set_blend_shape_mode>`\ (\ mode\: :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>`\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_lightmap_size_hint<class_ImporterMesh_method_set_lightmap_size_hint>`\ (\ size\: :ref:`Vector2i<class_Vector2i>`\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_surface_material<class_ImporterMesh_method_set_surface_material>`\ (\ surface_idx\: :ref:`int<class_int>`, material\: :ref:`Material<class_Material>`\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_surface_name<class_ImporterMesh_method_set_surface_name>`\ (\ surface_idx\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法說明
--------
.. _class_ImporterMesh_method_add_blend_shape:
.. rst-class:: classref-method
|void| **add_blend_shape**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_ImporterMesh_method_add_blend_shape>`
為將使用 :ref:`add_surface()<class_ImporterMesh_method_add_surface>` 新增的混合形狀新增名稱。必須在表面被新增之前調用。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_add_surface:
.. rst-class:: classref-method
|void| **add_surface**\ (\ primitive\: :ref:`PrimitiveType<enum_Mesh_PrimitiveType>`, arrays\: :ref:`Array<class_Array>`, blend_shapes\: :ref:`Array<class_Array>`\[:ref:`Array<class_Array>`\] = [], lods\: :ref:`Dictionary<class_Dictionary>` = {}, material\: :ref:`Material<class_Material>` = null, name\: :ref:`String<class_String>` = "", flags\: :ref:`int<class_int>` = 0\ ) :ref:`🔗<class_ImporterMesh_method_add_surface>`
建立新的曲面。\ :ref:`Mesh.get_surface_count()<class_Mesh_method_get_surface_count>` 的返回值將成為此曲面的 ``surf_idx``\ 。
曲面會以 ``primitive`` 指定的圖元型別進行繪製,可為 :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` 中的任一值。
\ ``arrays`` 是「陣列的陣列」。在 :ref:`Mesh.ARRAY_MAX<class_Mesh_constant_ARRAY_MAX>` 個元素中,每個元素要嘛包含由 :ref:`ArrayType<enum_Mesh_ArrayType>` 相對應成員所描述的曲面資料,要嘛為未使用時的 ``null``\ 。例如,\ ``arrays[0]`` 為頂點陣列;此子陣列為必填,其餘則為可選。若加上索引陣列,即會進入「索引模式」,此時頂點與其他陣列成為資料來源,而索引陣列決定頂點次序。除非使用 :ref:`Mesh.ARRAY_INDEX<class_Mesh_constant_ARRAY_INDEX>`\ ,否則所有子陣列長度必須等於頂點陣列長度(或為其整數倍,當一個頂點對應多個子陣列元素時),或保持空陣列。
\ ``blend_shapes`` 是每個混合形狀的頂點資料陣列。其結構與 ``arrays`` 相同,但僅當 ``arrays`` 內有設定 :ref:`Mesh.ARRAY_VERTEX<class_Mesh_constant_ARRAY_VERTEX>`\ 、\ :ref:`Mesh.ARRAY_NORMAL<class_Mesh_constant_ARRAY_NORMAL>`:ref:`Mesh.ARRAY_TANGENT<class_Mesh_constant_ARRAY_TANGENT>` 時,對應項目才會被設定;其餘皆為 ``null``\ 。
\ ``lods`` 為字典,鍵值為 :ref:`float<class_float>`\ 、內容為 :ref:`PackedInt32Array<class_PackedInt32Array>`\ 。每一項代表此曲面的一級 LOD其中值為該 LOD 使用的 :ref:`Mesh.ARRAY_INDEX<class_Mesh_constant_ARRAY_INDEX>` 陣列,鍵值大致對應開始啟用該 LOD 的距離;鍵越大,啟用距離亦越遠。
\ ``flags`` 為多個旗標的位元 OR對於每個使用中的自訂通道:ref:`ArrayCustomFormat<enum_Mesh_ArrayCustomFormat>` 的值左移 ``ARRAY_FORMAT_CUSTOMn_SHIFT``\ ;亦可加入 :ref:`Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE<class_Mesh_constant_ARRAY_FLAG_USE_DYNAMIC_UPDATE>`\ 、\ :ref:`Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS<class_Mesh_constant_ARRAY_FLAG_USE_8_BONE_WEIGHTS>`\ 、\ :ref:`Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY<class_Mesh_constant_ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY>`\ 。
\ **注意:**\ 使用索引時建議僅使用點、線或三角形圖元。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_clear:
.. rst-class:: classref-method
|void| **clear**\ (\ ) :ref:`🔗<class_ImporterMesh_method_clear>`
從該 **ImporterMesh** 中,移除所有表面和混合形狀。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_from_mesh:
.. rst-class:: classref-method
:ref:`ImporterMesh<class_ImporterMesh>` **from_mesh**\ (\ mesh\: :ref:`Mesh<class_Mesh>`\ ) |static| :ref:`🔗<class_ImporterMesh_method_from_mesh>`
Converts the given :ref:`Mesh<class_Mesh>` into an **ImporterMesh** by copying all its surfaces, blend shapes, materials, and metadata into a new **ImporterMesh** object.
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_generate_lods:
.. rst-class:: classref-method
|void| **generate_lods**\ (\ normal_merge_angle\: :ref:`float<class_float>`, normal_split_angle\: :ref:`float<class_float>`, bone_transform_array\: :ref:`Array<class_Array>`\ ) :ref:`🔗<class_ImporterMesh_method_generate_lods>`
Generates all lods for this ImporterMesh.
\ ``normal_merge_angle`` is in degrees and used in the same way as the importer settings in ``lods``.
\ ``normal_split_angle`` is not used and only remains for compatibility with older versions of the API.
The number of generated lods can be accessed using :ref:`get_surface_lod_count()<class_ImporterMesh_method_get_surface_lod_count>`, and each LOD is available in :ref:`get_surface_lod_size()<class_ImporterMesh_method_get_surface_lod_size>` and :ref:`get_surface_lod_indices()<class_ImporterMesh_method_get_surface_lod_indices>`.
\ ``bone_transform_array`` is an :ref:`Array<class_Array>` which can be either empty or contain :ref:`Transform3D<class_Transform3D>`\ s which, for each of the mesh's bone IDs, will apply mesh skinning when generating the LOD mesh variations. This is usually used to account for discrepancies in scale between the mesh itself and its skinning data.
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_blend_shape_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_blend_shape_count**\ (\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_blend_shape_count>`
返回該網格包含的混合形狀的數量。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_blend_shape_mode:
.. rst-class:: classref-method
:ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **get_blend_shape_mode**\ (\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_blend_shape_mode>`
返回該網格的混合形狀模式。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_blend_shape_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_blend_shape_name**\ (\ blend_shape_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_blend_shape_name>`
回傳此索引處混合形狀的名稱。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_lightmap_size_hint:
.. rst-class:: classref-method
:ref:`Vector2i<class_Vector2i>` **get_lightmap_size_hint**\ (\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_lightmap_size_hint>`
返回該網格的大小提示,用於在 UV 空間中展開光照貼圖。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_mesh:
.. rst-class:: classref-method
:ref:`ArrayMesh<class_ArrayMesh>` **get_mesh**\ (\ base_mesh\: :ref:`ArrayMesh<class_ArrayMesh>` = null\ ) :ref:`🔗<class_ImporterMesh_method_get_mesh>`
將該 **ImporterMesh** 表示的網格資料作為一個可用的 :ref:`ArrayMesh<class_ArrayMesh>` 返回。
這個方法快取了返回的網格,後續的呼叫將返回快取的資料,直到 :ref:`clear()<class_ImporterMesh_method_clear>` 被呼叫。
如果還沒有快取並且提供了 ``base_mesh``\ ,則 ``base_mesh`` 將被使用並被改變。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_arrays:
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_surface_arrays**\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_arrays>`
Returns the arrays for the vertices, normals, UVs, etc. that make up the requested surface. See :ref:`add_surface()<class_ImporterMesh_method_add_surface>`.
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_blend_shape_arrays:
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_surface_blend_shape_arrays**\ (\ surface_idx\: :ref:`int<class_int>`, blend_shape_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_blend_shape_arrays>`
為一個表面請求的混合形狀索引,返回一組混合形狀陣列。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_surface_count**\ (\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_count>`
返回該網格擁有的表面數。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_format:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_surface_format**\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_format>`
返回該網格擁有的表面的格式。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_lod_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_surface_lod_count**\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_lod_count>`
返回該網格在給定表面上保留的 lod 數。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_lod_indices:
.. rst-class:: classref-method
:ref:`PackedInt32Array<class_PackedInt32Array>` **get_surface_lod_indices**\ (\ surface_idx\: :ref:`int<class_int>`, lod_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_lod_indices>`
返回表面的 lod 的索引緩衝區。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_lod_size:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_surface_lod_size**\ (\ surface_idx\: :ref:`int<class_int>`, lod_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_lod_size>`
返回為一個表面啟動 lod 的螢幕比率。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_material:
.. rst-class:: classref-method
:ref:`Material<class_Material>` **get_surface_material**\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_material>`
返回給定面的 :ref:`Material<class_Material>` 材質。面將由該材質來算繪。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_surface_name**\ (\ surface_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ImporterMesh_method_get_surface_name>`
取得此曲面設定的名稱。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_get_surface_primitive_type:
.. rst-class:: classref-method
:ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **get_surface_primitive_type**\ (\ surface_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ImporterMesh_method_get_surface_primitive_type>`
返回所請求表面的基元型別(參見 :ref:`add_surface()<class_ImporterMesh_method_add_surface>`\ )。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_set_blend_shape_mode:
.. rst-class:: classref-method
|void| **set_blend_shape_mode**\ (\ mode\: :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>`\ ) :ref:`🔗<class_ImporterMesh_method_set_blend_shape_mode>`
Sets the blend shape mode.
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_set_lightmap_size_hint:
.. rst-class:: classref-method
|void| **set_lightmap_size_hint**\ (\ size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_ImporterMesh_method_set_lightmap_size_hint>`
設定該網格的大小提示,以便在 UV 空間中展開光照貼圖。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_set_surface_material:
.. rst-class:: classref-method
|void| **set_surface_material**\ (\ surface_idx\: :ref:`int<class_int>`, material\: :ref:`Material<class_Material>`\ ) :ref:`🔗<class_ImporterMesh_method_set_surface_material>`
設定給定面的 :ref:`Material<class_Material>` 材質。該面將會使用此材質算繪。
.. rst-class:: classref-item-separator
----
.. _class_ImporterMesh_method_set_surface_name:
.. rst-class:: classref-method
|void| **set_surface_name**\ (\ surface_idx\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_ImporterMesh_method_set_surface_name>`
為指定曲面設定名稱。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
.. |void| replace:: :abbr:`void (無回傳值。)`