user: How do I use Mesh Data in Blender? Include parameters, examples, warnings and best practices.

assistant: rn type:
        :   boolean

    validate_material_indices()
    :   Validate material indices of polygons, return True when the mesh has had invalid indices corrected (to default 0)

        Returns:
        :   Result

        Return type:
        :   boolean

    count_selected_items()
    :   Return the number of selected items (vert, edge, face)

        Returns:
        :   Result

        Return type:
        :   int array of 3 items in [0, inf]

    edge_creases_ensure()

    edge_creases_remove()

    from_pydata(*vertices*, *edges*, *faces*, *shade_flat=True*)
    :   Make a mesh from a list of vertices/edges/faces
        Until we have a nicer way to make geometry, use this.

        Parameters:
        :   - **vertices** (*Iterable**[**Sequence**[**float**]**]*) – float triplets each representing (X, Y, Z)
              eg: [(0.0, 1.0, 0.5), …].
            - **edges** (*Iterable**[**Sequence**[**int**]**]*) –

              int pairs, each pair contains two indices to the
              *vertices* argument. eg: [(1, 2), …]

              When an empty iterable is passed in, the edges are inferred from the polygons.
            - **faces** (*Iterable**[**Sequence**[**int**]**]*) – iterator of faces, each faces contains three or more indices to
              the *vertices* argument. eg: [(5, 6, 8, 9), (1, 2, 3), …]

    shade_flat()
    :   Render and display faces uniform, using face normals,
        setting the “sharp_face” attribute true for every face

    shade_smooth()
    :   Render and display faces smooth, using interpolated vertex normals,
        removing the “sharp_face” attribute

    vertex_creases_ensure()

    vertex_creases_remove()

    vertex_paint_mask_ensure()

    vertex_paint_mask_remove()

    *classmethod* bl_rna_get_subclass(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The RNA type or default when not found.

        Return type:
        :   [`bpy.types.Struct`](bpy.types.Struct.html#bpy.types.Struct "bpy.types.Struct") subclass

    *classmethod* bl_rna_get_subclass_py(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The class or default when not found.

        Return type:
        :   type

### Inherited Properties

|  |  |
| --- | --- |
| - [`bpy_struct.id_data`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_data "bpy.types.bpy_struct.id_data") - [`ID.name`](bpy.types.ID.html#bpy.types.ID.name "bpy.types.ID.name") - [`ID.name_full`](bpy.types.ID.html#bpy.types.ID.name_full "bpy.types.ID.name_full") - [`ID.id_type`](bpy.types.ID.html#bpy.types.ID.id_type "bpy.types.ID.id_type") - [`ID.session_uid`](bpy.types.ID.html#bpy.types.ID.session_uid "bpy.types.ID.session_uid") - [`ID.is_evaluated`](bpy.types.ID.html#bpy.types.ID.is_evaluated "bpy.types.ID.is_evaluated") - [`ID.original`](bpy.types.ID.html#bpy.types.ID.original "bpy.types.ID.original") - [`ID.users`](bpy.types.ID.html#bpy.types.ID.users "bpy.types.ID.users") - [`ID.use_fake_user`](bpy.types.ID.html#bpy.types.ID.use_fake_user "bpy.types.ID.use_fake_user") - [`ID.use_extra_user`](bpy.types.ID.html#bpy.types.ID.use_extra_user "bpy.types.ID.use_extra_user") - [`ID.is_embedded_data`](bpy.types.ID.html#bpy.types.ID.is_embedded_data "bpy.types.ID.is_embedded_data") | - [`ID.is_linked_packed`](bpy.types.ID.html#bpy.types.ID.is_linked_packed "bpy.types.ID.is_linked_packed") - [`ID.is_missing`](bpy.types.ID.html#bpy.types.ID.is_missing "bpy.types.ID.is_missing") - [`ID.is_runtime_data`](bpy.types.ID.html#bpy.types.ID.is_runtime_data "bpy.types.ID.is_runtime_data") - [`ID.is_editable`](bpy.types.ID.html#bpy.types.ID.is_editable "bpy.types.ID.is_editable") - [`ID.tag`](bpy.types.ID.html#bpy.types.ID.tag "bpy.types.ID.tag") - [`ID.is_library_indirect`](bpy.types.ID.html#bpy.types.ID.is_library_indirect "bpy.types.ID.is_library_indirect") - [`ID.library`](bpy.types.ID.html#bpy.types.ID.library "bpy.types.ID.library") - [`ID.library_weak_reference`](bpy.types.ID.html#bpy.types.ID.library_weak_reference "bpy.types.ID.library_weak_reference") - [`ID.asset_data`](bpy.types.ID.html#bpy.types.ID.asset_data "bpy.types.ID.asset_data") - [`ID.override_library`](bpy.types.ID.html#bpy.types.ID.override_library "bpy.types.ID.override_library") - [`ID.preview`](bpy.types.ID.html#bpy.types.ID.preview "bpy.types.ID.preview") |

### Inherited Functions

|  |  |
| --- | --- |
| - [`bpy_struct.as_pointer`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.as_pointer "bpy.types.bpy_struct.as_pointer") - [`bpy_struct.driver_add`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.driver_add "bpy.types.bpy_struct.driver_add") - [`bpy_struct.driver_remove`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.driver_remove "bpy.types.bpy_struct.driver_remove") - [`bpy_struct.get`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.get "bpy.types.bpy_struct.get") - [`bpy_struct.id_properties_clear`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_properties_clear "bpy.types.bpy_struct.id_properties_clear") - [`bpy_struct.id_properties_ensure`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_properties_ensure "bpy.types.bpy_struct.id_properties_ensure") - [`bpy_struct.id_properties_ui`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_properties_ui "bpy.types.bpy_struct.id_properties_ui") - [`bpy_struct.is_property_hidden`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_hidden "bpy.types.bpy_struct.is_property_hidden") - [`bpy_struct.is_property_overridable_library`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_overridable_library "bpy.types.bpy_struct.is_property_overridable_library") - [`bpy_struct.is_property_readonly`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_readonly "bpy.types.bpy_struct.is_property_readonly") - [`bpy_struct.is_property_set`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_set "bpy.types.bpy_struct.is_property_set") - [`bpy_struct.items`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.items "bpy.types.bpy_struct.items") - [`bpy_struct.keyframe_delete`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.keyframe_delete "bpy.types.bpy_struct.keyframe_delete") - [`bpy_struct.keyframe_insert`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.keyframe_insert "bpy.types.bpy_struct.keyframe_insert") - [`bpy_struct.keys`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.keys "bpy.types.bpy_struct.keys") - [`bpy_struct.path_from_id`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.path_from_id "bpy.types.bpy_struct.path_from_id") - [`bpy_struct.path_from_module`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.path_from_module "bpy.types.bpy_struct.path_from_module") - [`bpy_struct.path_resolve`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.path_resolve "bpy.types.bpy_struct.path_resolve") - [`bpy_struct.pop`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.pop "bpy.types.bpy_struct.pop") - [`bpy_struct.property_overridable_library_set`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.property_overridable_library_set "bpy.types.bpy_struct.property_overridable_library_set") - [`bpy_struct.property_unset`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.property_unset "bpy.types.bpy_struct.property_unset") - [`bpy_struct.rna_ancestors`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.rna_ancestors "bpy.types.bpy_struct.rna_ancestors") | - [`bpy_struct.type_recast`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.type_recast "bpy.types.bpy_struct.type_recast") - [`bpy_struct.values`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.values "bpy.types.bpy_struct.values") - [`ID.bl_system_properties_get`](bpy.types.ID.html#bpy.types.ID.bl_system_properties_get "bpy.types.ID.bl_system_properties_get") - [`ID.rename`](bpy.types.ID.html#bpy.types.ID.rename "bpy.types.ID.rename") - [`ID.evaluated_get`](bpy.types.ID.html#bpy.types.ID.evaluated_get "bpy.types.ID.evaluated_get") - [`ID.copy`](bpy.types.ID.html#bpy.types.ID.copy "bpy.types.ID.copy") - [`ID.asset_mark`](bpy.types.ID.html#bpy.types.ID.asset_mark "bpy.types.ID.asset_mark") - [`ID.asset_clear`](bpy.types.ID.html#bpy.types.ID.asset_clear "bpy.types.ID.asset_clear") - [`ID.asset_generate_preview`](bpy.types.ID.html#bpy.types.ID.asset_generate_preview "bpy.types.ID.asset_generate_preview") - [`ID.override_create`](bpy.types.ID.html#bpy.types.ID.override_create "bpy.types.ID.override_create") - [`ID.override_hierarchy_create`](bpy.types.ID.html#bpy.types.ID.override_hierarchy_create "bpy.types.ID.override_hierarchy_create") - [`ID.user_clear`](bpy.types.ID.html#bpy.types.ID.user_clear "bpy.types.ID.user_clear") - [`ID.user_remap`](bpy.types.ID.html#bpy.types.ID.user_remap "bpy.types.ID.user_remap") - [`ID.make_local`](bpy.types.ID.html#bpy.types.ID.make_local "bpy.types.ID.make_local") - [`ID.user_of_id`](bpy.types.ID.html#bpy.types.ID.user_of_id "bpy.types.ID.user_of_id") - [`ID.animation_data_create`](bpy.types.ID.html#bpy.types.ID.animation_data_create "bpy.types.ID.animation_data_create") - [`ID.animation_data_clear`](bpy.types.ID.html#bpy.types.ID.animation_data_clear "bpy.types.ID.animation_data_clear") - [`ID.update_tag`](bpy.types.ID.html#bpy.types.ID.update_tag "bpy.types.ID.update_tag") - [`ID.preview_ensure`](bpy.types.ID.html#bpy.types.ID.preview_ensure "bpy.types.ID.preview_ensure") - [`ID.bl_rna_get_subclass`](bpy.types.ID.html#bpy.types.ID.bl_rna_get_subclass "bpy.types.ID.bl_rna_get_subclass") - [`ID.bl_rna_get_subclass_py`](bpy.types.ID.html#bpy.types.ID.bl_rna_get_subclass_py "bpy.types.ID.bl_rna_get_subclass_py") |

### References

|  |  |
| --- | --- |
| - [`bpy.context.mesh`](bpy.context.html#bpy.context.mesh "bpy.context.mesh") - [`BlendData.meshes`](bpy.types.BlendData.html#bpy.types.BlendData.meshes "bpy.types.BlendData.meshes") - [`BlendDataMeshes.new`](bpy.types.BlendDataMeshes.html#bpy.types.BlendDataMeshes.new "bpy.types.BlendDataMeshes.new") - [`BlendDataMeshes.new_from_object`](bpy.types.BlendDataMeshes.html#bpy.types.BlendDataMeshes.new_from_object "bpy.types.BlendDataMeshes.new_from_object") - [`BlendDataMeshes.remove`](bpy.types.BlendDataMeshes.html#bpy.types.BlendDataMeshes.remove "bpy.types.BlendDataMeshes.remove") | - [`Mesh.texco_mesh`](#bpy.types.Mesh.texco_mesh "bpy.types.Mesh.texco_mesh") - [`Mesh.texture_mesh`](#bpy.types.Mesh.texture_mesh "bpy.types.Mesh.texture_mesh") - [`Mesh.unit_test_compare`](#bpy.types.Mesh.unit_test_compare "bpy.types.Mesh.unit_test_compare") - [`Object.to_mesh`](bpy.types.Object.html#bpy.types.Object.to_mesh "bpy.types.Object.to_mesh") |