Mesh(ID)

base classes — bpy_struct, ID

class bpy.types.Mesh(ID)

Mesh datablock defining geometric surfaces

animation_data

Animation data for this datablock

Type :AnimData, (readonly)
auto_smooth_angle

Defines maximum angle between face normals that ‘Auto Smooth’ will operate on

Type :int in [1, 80], default 0
edges

Edges of the mesh

Type :MeshEdges collection of MeshEdge, (readonly)
faces

Faces of the mesh

Type :MeshFaces collection of MeshFace, (readonly)
layers_float
Type :Collection of MeshFloatPropertyLayer, (readonly)
layers_int
Type :Collection of MeshIntPropertyLayer, (readonly)
layers_string
Type :Collection of MeshStringPropertyLayer, (readonly)
materials
Type :IDMaterials collection of Material, (readonly)
shape_keys
Type :Key, (readonly)
show_all_edges

Displays all edges for wireframe in all view modes in the 3D view

Type :boolean, default False
show_double_sided

Render/display the mesh with double or single sided lighting

Type :boolean, default False
show_edge_bevel_weight

Displays weights created for the Bevel modifier

Type :boolean, default False
show_edge_crease

Displays creases created for subsurf weighting

Type :boolean, default False
show_edge_seams

Displays UV unwrapping seams

Type :boolean, default False
show_edge_sharp

Displays sharp edges, used with the EdgeSplit modifier

Type :boolean, default False
show_edges

Displays selected edges using highlights in the 3D view and UV editor

Type :boolean, default False
show_extra_edge_length

Displays selected edge lengths, Using global values when set in the transform panel

Type :boolean, default False
show_extra_face_angle

Displays the angles in the selected edges in degrees, Using global values when set in the transform panel

Type :boolean, default False
show_extra_face_area

Displays the area of selected faces, Using global values when set in the transform panel

Type :boolean, default False
show_faces

Displays all faces as shades in the 3D view and UV editor

Type :boolean, default False
show_normal_face

Displays face normals as lines

Type :boolean, default False
show_normal_vertex

Displays vertex normals as lines

Type :boolean, default False
sticky

Sticky texture coordinates

Type :Collection of MeshSticky, (readonly)
texco_mesh

Derive texture coordinates from another mesh

Type :Mesh
texspace_location

Texture space location

Type :float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.0)
texspace_size

Texture space size

Type :float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.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_smooth

Treats all set-smoothed faces with angles less than the specified angle as ‘smooth’ during render

Type :boolean, default False
use_auto_texspace

Adjusts active object’s texture space automatically when transforming object

Type :boolean, default False
use_mirror_topology

Use topology based mirroring

Type :boolean, default False
use_mirror_x

X Axis mirror editing

Type :boolean, default False
use_paint_mask

Face selection masking for painting

Type :boolean, default False
uv_texture_clone

UV texture to be used as cloning source

Type :MeshTextureFaceLayer
uv_texture_clone_index

Clone UV texture index

Type :int in [0, inf], default 0
uv_texture_stencil

UV texture to mask the painted area

Type :MeshTextureFaceLayer
uv_texture_stencil_index

Mask UV texture index

Type :int in [0, inf], default 0
uv_textures
Type :UVTextures collection of MeshTextureFaceLayer, (readonly)
vertex_colors
Type :VertexColors collection of MeshColorLayer, (readonly)
vertices

Vertices of the mesh

Type :MeshVertices collection of MeshVertex, (readonly)
edge_face_count

(readonly)

edge_face_count_dict

(readonly)

edge_keys

(readonly)

transform(matrix)

Transform mesh vertices by a matrix.

Parameters:matrix (float array of 16 items in [-inf, inf]) – Matrix.
calc_normals()

Calculate vertex normals.

update(calc_edges=False)

update

Parameters:calc_edges (boolean, (optional)) – Calculate Edges, Force recalculation of edges.
validate(verbose=False)

validate geometry, return True when the mesh has had invalid geometry corrected/removed.

Parameters:verbose (boolean, (optional)) – Verbose, Output information about the errors found
Returns:Result
Return type:boolean
edge_loops_from_edges(edges=None)

Edge loops defined by edges

Takes me.edges or a list of edges and returns the edge loops

return a list of vertex indices. [ [1, 6, 7, 2], ...]

closed loops have matching start and end values.

edge_loops_from_faces(faces=None, seams=())

Edge loops defined by faces

Takes me.faces or a list of faces and returns the edge loops These edge loops are the edges that sit between quads, so they dont touch 1 quad, note: not connected will make 2 edge loops, both only containing 2 edges.

return a list of edge key lists [ [(0,1), (4, 8), (3,8)], ...]

return a list of edge vertex index lists

from_pydata(vertices, edges, faces)

Make a mesh from a list of verts/edges/faces Until we have a nicer way to make geometry, use this.

Parameters:
  • vertices (iterable object) – float triplets each representing (X, Y, Z) eg: [(0.0, 1.0, 0.5), ...].
  • edges (iterable object) – int pairs, each pair contains two indices to the vertices argument. eg: [(1, 2), ...]
  • faces (iterable object) – iterator of faces, each faces contains three or four indices to the vertices argument. eg: [(5, 6, 8, 9), (1, 2, 3), ...]

Inherited Properties

Inherited Functions

References

Previous topic

Menu(bpy_struct)

Next topic

MeshColor(bpy_struct)