user: Describe Bpy.Types.Mesh from the Blender manual or Python API, including usage steps and snippets.

assistant: 1.0, 1.0) texture_mesh ¶ Use another mesh for texture indices (vertex indices must be aligned) Type : Mesh total_edge_sel ¶ Selected edge count in editmode Type : int in [0, inf], default 0, (readonly) total_face_sel ¶ Selected face count in editmode Type : int in [0, inf], default 0, (readonly) total_vert_sel ¶ Selected vertex count in editmode Type : int in [0, inf], default 0, (readonly) use_auto_texspace ¶ Adjust active object’s texture space automatically when transforming object Type : boolean, default True use_mirror_topology ¶ Use topology based mirroring (for when both sides of mesh have matching, unique topology) Type : boolean, default False use_mirror_vertex_groups ¶ Mirror the left/right vertex groups when painting. The symmetry axis is determined by the symmetry settings. Type : boolean, default True use_mirror_x ¶ Enable symmetry in the X axis Type : boolean, default False use_mirror_y ¶ Enable symmetry in the Y axis Type : boolean, default False use_mirror_z ¶ Enable symmetry in the Z axis Type : boolean, default False use_paint_bone_selection ¶ Bone selection during painting Type : boolean, default True use_paint_mask ¶ Face selection masking for painting Type : boolean, default False use_paint_mask_vertex ¶ Vertex selection masking for painting Type : boolean, default False use_remesh_fix_poles ¶ Produces fewer poles and a better topology flow Type : boolean, default False use_remesh_preserve_attributes ¶ Transfer all attributes to the new mesh Type : boolean, default False use_remesh_preserve_volume ¶ Projects the mesh to preserve the volume and details of the original mesh Type : boolean, default False uv_layer_clone ¶ UV loop layer to be used as cloning source Type : MeshUVLoopLayer uv_layer_clone_index ¶ Clone UV loop layer index Type : int in [0, inf], default 0 uv_layer_stencil ¶ UV loop layer to mask the painted area Type : MeshUVLoopLayer uv_layer_stencil_index ¶ Mask UV loop layer index Type : int in [0, inf], default 0 uv_layers ¶ All UV loop layers Type : UVLoopLayers bpy_prop_collection of MeshUVLoopLayer , (readonly) vertex_colors ¶ Legacy vertex color layers. Deprecated, use color attributes instead. Type : LoopColors bpy_prop_collection of MeshLoopColorLayer , (readonly) vertex_normals ¶ The normal direction of each vertex, defined as the average of the surrounding face normals Type : bpy_prop_collection of MeshNormalValue , (readonly) vertices ¶ Vertices of the mesh Type : MeshVertices bpy_prop_collection of MeshVertex , (readonly) edge_creases ¶ Edge crease values for subdivision surface, corresponding to the “crease_edge” attribute. (readonly) edge_keys ¶ (readonly) vertex_creases ¶ Vertex crease values for subdivision surface, corresponding to the “crease_vert” attribute. (readonly) vertex_paint_mask ¶ Mask values for sculpting and painting, corresponding to the “.sculpt_mask” attribute. (readonly) transform ( matrix , * , shape_keys = False ) ¶ Transform mesh vertices by a matrix (Warning: inverts normals if matrix is negative) Parameters : matrix ( mathutils.Matrix of 4 * 4 items in [-inf, inf]) – Matrix shape_keys ( boolean , ( optional ) ) – Transform Shape Keys flip_normals ( ) ¶ Invert winding of all polygons (clears tessellation, does not handle custom normals) set_sharp_from_angle ( * , angle = 3.14159 ) ¶ Reset and fill the “sharp_edge” attribute based on the angle of faces neighboring manifold edges Parameters : angle ( float in [ 0 , 3.14159 ] , ( optional ) ) – Angle, Angle between faces beyond which edges are marked sharp split_faces ( ) ¶ Split faces based on the edge angle calc_tangents ( * , uvmap = '' ) ¶ Compute tangents and bitangent signs, to be used together with the custom normals to get a complete tangent space for normal mapping (custom normals are also computed if not yet present) Parameters : uvmap ( string , ( optional , never None ) ) – Name of the UV map to use for tangent space computation free_tangents ( ) ¶ Free tangents calc_loop_triangles ( ) ¶ Calculate loop triangle tessellation (supports editmode too) calc_smooth_groups ( * , use_bitflags = False , use_boundary_vertices_for_bitflags = False ) ¶ Calculate smooth groups from sharp edges Parameters : use_bitflags ( boolean , ( optional ) ) – Produce bitflags groups instead of simple numeric values use_boundary_vertices_for_bitflags ( boolean , ( optional ) ) – Also consider different smoothgroups sharing only vertices (but without any common edge) as neighbors, preventing them from sharing the same bitflag value. Only effective when use_bitflags is set. WARNING: Will overflow (run out of available bits) easily with some types of topology, e.g. large fans of sharp edges Returns : poly_groups , Smooth Groups, int array of 1 items in [-inf, inf] groups , Total number of groups, int in [0, inf] Return type : (int array of 1 items in [-inf, inf], int in [0, inf]) normals_split_custom_set ( normals ) ¶ Define custom normals of this mesh (use zero-vectors to keep auto ones) Parameters : normals ( float multi-dimensional array of 1 * 3 items in [ -1 , 1 ] ) – Normals normals_split_custom_set_from_vertices ( normals ) ¶ Define custom normals of this mesh, from vertices’ normals (use zero-vectors to keep auto ones) Parameters : normals ( float multi-dimensional array of 1 * 3 items in [ -1 , 1 ] ) – Normals update ( * , calc_edges = False , calc_edges_loose = False ) ¶ update Parameters : calc_edges ( boolean , ( optional ) ) – Calculate Edges, Force recalculation of edges calc_edges_loose ( boolean , ( optional ) ) – Calculate Loose Edges, Calculate the loose state of each edge update_gpu_tag ( ) ¶ update_gpu_tag unit_test_compare ( * , mesh = None , threshold = 7.1526e-06 ) ¶ unit_test_compare Parameters : mesh ( Mesh , (optional)) – Mesh to compare to threshold ( float in [ 0 , inf ] , ( optional ) ) – Threshold, Comparison tolerance threshold Returns : Return value, String description of result of comparison Return type : string, (never None) clear_geometry ( ) ¶ Remove all geometry from the mesh. Note that this does not free shape keys or materials. validate ( * , verbose = False , clean_customdata = True ) ¶ Validate geometry, return True when the mesh has had invalid geometry corrected/removed Parameters : verbose ( boolean , ( optional ) ) – Verbose, Output information about the errors found clean_customdata ( boolean , ( optional ) ) – Clean Custom Data, Remove temp/cached custom-data layers, like e.g. normals… Returns : Result Return 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), …] Warning Invalid mesh data (out of range indices, edges with matching indices, 2 sided faces… etc) are not prevented. If the data used for mesh creation isn’t known to be valid, run Mesh.validate after this function. 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 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 ID.name ID.name_full ID.id_type ID.session_uid ID.is_evaluated ID.original ID.users ID.use_fake_user ID.use_extra_user ID.is_embedded_data ID.is_linked_packed ID.is_missing ID.is_runtime_data ID.is_editable ID.tag ID.is_library_indirect ID.library ID.library_weak_reference ID.asset_data ID.override_library ID.preview Inherited Functions ¶ bpy_struct.as_pointer bpy_struct.driver_add bpy_struct.driver_remove bpy_struct.get bpy_struct.id_properties_clear bpy_struct.id_properties_ensure bpy_struct.id_properties_ui bpy_struct.is_property_hidden bpy_struct.is_property_overridable_library bpy_struct.is_property_readonly bpy_struct.is_property_set bpy_struct.items bpy_struct.keyframe_delete bpy_struct.keyframe_insert bpy_struct.keys bpy_struct.path_from_id bpy_struct.path_from_module bpy_struct.path_resolve bpy_struct.pop bpy_struct.property_overridable_library_set bpy_struct.property_unset bpy_struct.rna_ancestors bpy_struct.type_recast bpy_struct.values ID.bl_system_properties_get ID.rename ID.evaluated_get ID.copy ID.asset_mark ID.asset_clear ID.asset_generate_preview ID.override_create ID.override_hierarchy_create ID.user_clear ID.user_remap ID.make_local ID.user_of_id ID.animation_data_create ID.animation_data_clear ID.update_tag ID.preview_ensure ID.bl_rna_get_subclass ID.bl_rna_get_subclass_py References ¶ bpy.context.mesh BlendData.meshes BlendDataMeshes.new BlendDataMeshes.new_from_object BlendDataMeshes.remove Mesh.texco_mesh Mesh.texture_mesh Mesh.unit_test_compare Object.to_mesh Next MeshCacheModifier(Modifier) Previous Menu(bpy_struct) Copyright &#169; Blender Authors Made with Furo Report issue on this page On this page Mesh(ID) Mesh Data Mesh Mesh.animation_data Mesh.attributes Mesh.auto_texspace Mesh.color_attributes Mesh.corner_normals Mesh.cycles Mesh.edges Mesh.has_custom_normals Mesh.is_editmode Mesh.loop_triangle_polygons Mesh.loop_triangles Mesh.loops Mesh.materials Mesh.normals_domain Mesh.polygon_normals Mesh.polygons Mesh.radial_symmetry Mesh.remesh_mode Mesh.remesh_voxel_adaptivity Mesh.remesh_voxel_size Mesh.shape_keys Mesh.skin_vertices Mesh.texco_mesh Mesh.texspace_location Mesh.texspace_size Mesh.texture_mesh Mesh.total_edge_sel Mesh.total_face_sel Mesh.total_vert_sel Mesh.use_auto_texspace Mesh.use_mirror_topology Mesh.use_mirror_vertex_groups Mesh.use_mirror_x Mesh.use_mirror_y Mesh.use_mirror_z Mesh.use_paint_bone_selection Mesh.use_paint_mask Mesh.use_paint_mask_vertex Mesh.use_remesh_fix_poles Mesh.use_remesh_preserve_attributes Mesh.use_remesh_preserve_volume Mesh.uv_layer_clone Mesh.uv_layer_clone_index Mesh.uv_layer_stencil Mesh.uv_layer_stencil_index Mesh.uv_layers Mesh.vertex_colors Mesh.vertex_normals Mesh.vertices Mesh.edge_creases Mesh.edge_keys Mesh.vertex_creases Mesh.vertex_paint_mask Mesh.transform() Mesh.flip_normals() Mesh.set_sharp_from_angle() Mesh.split_faces() Mesh.calc_tangents() Mesh.free_tangents() Mesh.calc_loop_triangles() Mesh.calc_smooth_groups() Mesh.normals_split_custom_set() Mesh.normals_split_custom_set_from_vertices() Mesh.update() Mesh.update_gpu_tag() Mesh.unit_test_compare() Mesh.clear_geometry() Mesh.validate() Mesh.validate_material_indices() Mesh.count_selected_items() Mesh.edge_creases_ensure() Mesh.edge_creases_remove() Mesh.from_pydata() Mesh.shade_flat() Mesh.shade_smooth() Mesh.vertex_creases_ensure() Mesh.vertex_creases_remove() Mesh.vertex_paint_mask_ensure() Mesh.vertex_paint_mask_remove() Mesh.bl_rna_get_subclass() Mesh.bl_rna_get_subclass_py() Inherited Properties Inherited Functions References