BMesh Utilities (bmesh.utils)

This module provides access to blenders bmesh data structures.

bmesh.utils.edge_rotate(edge, ccw=False)

Rotate the edge and return the newly created edge. If rotating the edge fails, None will be returned.

Parameters:
  • edge (bmesh.types.BMEdge) – The edge to rotate.
  • ccw (boolean) – When True the edge will be rotated counter clockwise.
Returns:

The newly rotated edge.

Return type:

bmesh.types.BMEdge

bmesh.utils.edge_split(edge, vert, fac)

Split an edge, return the newly created data.

Parameters:
  • edge (bmesh.types.BMEdge) – The edge to split.
  • vert (bmesh.types.BMVert) – One of the verts on the edge, defines the split direction.
  • fac (float) – The point on the edge where the new vert will be created [0 - 1].
Returns:

The newly created (edge, vert) pair.

Return type:

tuple

bmesh.utils.face_flip(faces)

Flip the faces direction.

Parameters:face (bmesh.types.BMFace) – Face to flip.
bmesh.utils.face_join(faces, remove=True)

Joins a sequence of faces.

Parameters:
  • faces (bmesh.types.BMFace) – Sequence of faces.
  • remove (boolean) – Remove the edges and vertices between the faces.
Returns:

The newly created face or None on failure.

Return type:

bmesh.types.BMFace

bmesh.utils.face_split(face, vert_a, vert_b, coords=(), use_exist=True, example=None)

Face split with optional intermediate points.

Parameters:
  • face (bmesh.types.BMFace) – The face to cut.
  • vert_a (bmesh.types.BMVert) – First vertex to cut in the face (face must contain the vert).
  • vert_b (bmesh.types.BMVert) – Second vertex to cut in the face (face must contain the vert).
  • coords (sequence of float triplets) – Optional argument to define points inbetween vert_a and vert_b.
  • use_exist (boolean) – .Use an existing edge if it exists (Only used when coords argument is empty or omitted)
  • example (bmesh.types.BMEdge) – Newly created edge will copy settings from this one.
Returns:

The newly created face or None on failure.

Return type:

(bmesh.types.BMFace, bmesh.types.BMLoop) pair

bmesh.utils.face_vert_separate(face, vert)

Rip a vertex in a face away and add a new vertex.

Parameters:
Return vert:

The newly created vertex or None of failure.

Rtype vert:

bmesh.types.BMVert

Note

This is the same as loop_separate, and has only been added for convenience.

bmesh.utils.loop_separate(loop)

Rip a vertex in a face away and add a new vertex.

Parameters:loop (bmesh.types.BMFace) – The to separate.
Return vert:The newly created vertex or None of failure.
Rtype vert:bmesh.types.BMVert
bmesh.utils.vert_collapse_edge(vert, edge)

Collapse a vertex into an edge.

Parameters:
Returns:

The resulting edge from the collapse operation.

Return type:

bmesh.types.BMEdge

bmesh.utils.vert_collapse_faces(vert, edge, fac, join_faces)

Split an edge, return the newly created data.

Parameters:
  • vert (bmesh.types.BMVert) – The vert that will be collapsed.
  • edge (bmesh.types.BMEdge) – The edge to collapse into.
  • fac (float) – The factor to use when merging customdata [0 - 1].
Returns:

The resulting edge from the collapse operation.

Return type:

bmesh.types.BMEdge

bmesh.utils.vert_dissolve(vert)

Dissolve this vertex (will be removed).

Parameters:vert (bmesh.types.BMVert) – The vert to be dissolved.
Returns:True when the vertex dissolve is successful.
Return type:boolean
bmesh.utils.vert_separate(vert, edges)

Separate this vertex at every edge.

Parameters:
Returns:

The newly separated verts (including the vertex passed).

Return type:

tuple of bmesh.types.BMVert

Previous topic

BMesh Types (bmesh.types)

Next topic

Game Types (bge.types)