BMesh Types (bmesh.types)

class bmesh.types.BMEdge

The BMesh edge connecting 2 verts

calc_face_angle()

Return the angle between 2 connected faces.

Returns:The angle between both faces in radians.
Return type:float
copy_from(other)

Copy values from another element of matching type.

normal_update()

Update edges vertex normals.

other_vert(vert)

Return the other vertex on this edge or None if the vertex is not used by this edge.

Parameters:vert (BMVert) – a vert in this edge.
Returns:The edges other vert.
Return type:BMVert or None
select_set(select)

Set the selection. This is different from the select attribute because it updates the selection state of assosiated geometry.

Parameters:select (boolean) – Select or de-select.
hide

Hidden state of this element.

Type :boolean
index

Index of this element.

Type :int

Note

This value is not necessarily valid, while editing the mesh it can become dirty.

It’s also possible to assign any number to this attribute for a scripts internal logic.

To ensure the value is up to date - see BMElemSeq.index_update.

is_boundary

True when this edge is at the boundary of a face (read-only).

Type :boolean
is_manifold

True when this edge is manifold (read-only).

Type :boolean
is_valid

True when this element is valid (hasn’t been removed).

Type :boolean
is_wire

True when this edge is not connected to any faces (read-only).

Type :boolean

Faces connected to this edge, (read-only).

Type :BMElemSeq of BMFace

Loops connected to this edge, (read-only).

Type :BMElemSeq of BMLoop
seam

Smooth state of this element.

Type :boolean
select

Selected state of this element.

Type :boolean
smooth

Smooth state of this element.

Type :boolean
tag

Generic attribute scripts can use for own logic

Type :boolean
verts

Verts this edge uses (always 2), (read-only).

Type :BMElemSeq of BMVert
class bmesh.types.BMElemSeq

General sequence type used for accessing any sequence of BMVert, BMEdge, BMFace, BMLoop.

When accessed via BMesh.verts, BMesh.edges, BMesh.faces there are also functions to create/remomove items.

get(verts, fallback=None)

Return a face/edge which uses the verts passed.

Parameters:
  • verts (BMVert) – Sequence of verts.
  • fallback – Return this value if nothing is found.
index_update()

Initialize the index values of this sequence.

This is the equivalent of looping over all elements and assigning the index values.

for index, ele in enumerate(sequence):
    ele.index = index

Note

Running this on sequences besides BMesh.verts, BMesh.edges, BMesh.faces works but wont result in each element having a valid index, insted its order in the sequence will be set.

new(co=(0.0, 0.0, 0.0), example=None)

Vertex Sequence

Parameters:
  • co (float triplet) – The initial location of the vertex (optional argument).
  • example (BMVert) – Existing vert to initialize settings.
Returns:

The newly created edge.

Return type:

BMVert

new(verts, example=None)

Edge Sequence

Parameters:
  • verts (pair of BMVert) – Vertex pair.
  • example (BMEdge) – Existing edge to initialize settings (optional argument).
Returns:

The newly created edge.

Return type:

BMEdge

new(verts, example=None)

Face Sequence

Create a new vert/edge/face.

Parameters:
  • verts (BMVert) – Sequence of 3 or more verts.
  • example (BMFace) – Existing face to initialize settings (optional argument).
Returns:

The newly created face.

Return type:

BMFace

remove(elem)

Remove a vert/edge/face.

class bmesh.types.BMFace

The BMesh face with 3 or more sides

calc_area()

Return the area of the face.

Returns:Return the area of the face.
Return type:float
calc_center_bounds()

Return bounds center of the face.

Returns:a 3D vector.
Return type:mathutils.Vector
calc_center_median()

Return median center of the face.

Returns:a 3D vector.
Return type:mathutils.Vector
copy(verts=True, edges=True)

Make a copy of this face.

Parameters:
  • verts (boolean) – When set, the faces verts will be duplicated too.
  • edges (boolean) – When set, the faces edges will be duplicated too.
Returns:

The newly created face.

Return type:

BMFace

copy_from(other)

Copy values from another element of matching type.

copy_from_face_interp(face)

Interpolate the customdata from another face onto this one (faces should overlap).

Parameters:face (BMFace) – The face to interpolate data from.
normal_update()

Update faces normal.

select_set(select)

Set the selection. This is different from the select attribute because it updates the selection state of assosiated geometry.

Parameters:select (boolean) – Select or de-select.
edges

Edges of this face, (read-only).

Type :BMElemSeq of BMEdge
hide

Hidden state of this element.

Type :boolean
index

Index of this element.

Type :int

Note

This value is not necessarily valid, while editing the mesh it can become dirty.

It’s also possible to assign any number to this attribute for a scripts internal logic.

To ensure the value is up to date - see BMElemSeq.index_update.

is_valid

True when this element is valid (hasn’t been removed).

Type :boolean
loops

Loops of this face, (read-only).

Type :BMElemSeq of BMLoop
normal

The normal for this face as a 3D, wrapped vector.

Type :mathutils.Vector
select

Selected state of this element.

Type :boolean
smooth

Smooth state of this element.

Type :boolean
tag

Generic attribute scripts can use for own logic

Type :boolean
verts

Verts of this face, (read-only).

Type :BMElemSeq of BMVert
class bmesh.types.BMIter

Internal BMesh type for looping over verts/faces/edges, used for iterating over BMElemSeq types.

class bmesh.types.BMLoop

This is normally accessed from BMFace.loops where each face corner represents a corner of a face.

calc_face_angle()

Return angle at this loops corner of the face. This is calculated so sharper corners give lower angles.

Returns:The angle in radians.
Return type:float
copy_from(other)

Copy values from another element of matching type.

copy_from_face_interp(face, vert=True, multires=True)

Interpolate the customdata from a face onto this loop (the loops vert should overlap the face).

Parameters:
  • face (BMFace) – The face to interpolate data from.
  • vert (boolean) – When enabled, interpolate the loops vertex data (optional).
  • multires (boolean) – When enabled, interpolate the loops multires data (optional).
edge

The loops edge (between this loop and the next), (read-only).

Type :BMEdge
face

The face this loop makes (read-only).

Type :BMFace
index

Index of this element.

Type :int

Note

This value is not necessarily valid, while editing the mesh it can become dirty.

It’s also possible to assign any number to this attribute for a scripts internal logic.

To ensure the value is up to date - see BMElemSeq.index_update.

is_valid

True when this element is valid (hasn’t been removed).

Type :boolean

The next face corner (read-only).

Type :BMLoop

The previous face corner (read-only).

Type :BMLoop

Loops connected to this loop, (read-only).

Type :BMElemSeq of BMLoop
tag

Generic attribute scripts can use for own logic

Type :boolean
vert

The loops vertex (read-only).

Type :BMVert
class bmesh.types.BMVert

The BMesh vertex type

calc_edge_angle()

Return the angle between 2 connected edges.

Returns:The angle between both edges in radians.
Return type:float
copy_from(other)

Copy values from another element of matching type.

copy_from_face_interp(face)

Interpolate the customdata from a face onto this loop (the loops vert should overlap the face).

Parameters:face (BMFace) – The face to interpolate data from.
copy_from_vert_interp(vert_pair, fac)

Interpolate the customdata from a vert between 2 other verts.

Parameters:vert_pair (BMVert) – The vert to interpolate data from.
normal_update()

Update vertex normal.

select_set(select)

Set the selection. This is different from the select attribute because it updates the selection state of assosiated geometry.

Parameters:select (boolean) – Select or de-select.
co

The coordinates for this vertex as a 3D, wrapped vector.

Type :mathutils.Vector
hide

Hidden state of this element.

Type :boolean
index

Index of this element.

Type :int

Note

This value is not necessarily valid, while editing the mesh it can become dirty.

It’s also possible to assign any number to this attribute for a scripts internal logic.

To ensure the value is up to date - see BMElemSeq.index_update.

is_manifold

True when this vertex is manifold (read-only).

Type :boolean
is_valid

True when this element is valid (hasn’t been removed).

Type :boolean
is_wire

True when this vertex is not connected to any faces (read-only).

Type :boolean

Edges connected to this vertex (read-only).

Type :BMElemSeq of BMVert

Faces connected to this vertex (read-only).

Type :BMElemSeq of BMFace

Loops that use this vertex (read-only).

Type :BMElemSeq of BMLoop
normal

The normal for this vertex as a 3D, wrapped vector.

Type :mathutils.Vector
select

Selected state of this element.

Type :boolean
tag

Generic attribute scripts can use for own logic

Type :boolean
class bmesh.types.BMesh

The BMesh data structure

normal_update(skip_hidden=False)

Update mesh normals.

Parameters:skip_hidden (boolean) – When True hidden elements are ignored.
select_flush(select)

Flush selection, independent of the current selection mode.

Parameters:select (boolean) – flush selection or de-selected elements.
select_flush_mode()

flush selection based on the current mode current BMesh.select_mode.

transform(matrix, filter=None)

Transform the mesh (optionally filtering flagged data only).

Parameters:
  • matrix (4x4 mathutils.Matrix) – transform matrix.
  • filter (set) – set of values in (‘SELECT’, ‘HIDE’, ‘SEAM’, ‘SMOOTH’, ‘TAG’).
edges

This meshes edge sequence (read-only).

Type :BMElemSeq
faces

This meshes face sequence (read-only).

Type :BMElemSeq
is_valid

True when this element is valid (hasn’t been removed).

Type :boolean
select_mode

The selection mode, values can be {‘VERT’, ‘EDGE’, ‘FACE’}, can’t be assigned an empty set.

Type :set
verts

This meshes vert sequence (read-only).

Type :BMElemSeq

Previous topic

BMesh Module (bmesh)

Next topic

BMesh Utilities (bmesh.utils)