Blender  V3.3
Functions | Variables
bmesh_py_utils.c File Reference
#include <Python.h>
#include "BLI_math_base.h"
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
#include "../mathutils/mathutils.h"
#include "bmesh.h"
#include "bmesh_py_types.h"
#include "bmesh_py_utils.h"
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"

Go to the source code of this file.

Functions

 PyDoc_STRVAR (bpy_bm_utils_vert_collapse_edge_doc, ".. method:: vert_collapse_edge(vert, edge)\n" "\n" " Collapse a vertex into an edge.\n" "\n" " :arg vert: The vert that will be collapsed.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg edge: The edge to collapse into.\n" " :type edge: :class:`bmesh.types.BMEdge`\n" " :return: The resulting edge from the collapse operation.\n" " :rtype: :class:`bmesh.types.BMEdge`\n")
 
static PyObject * bpy_bm_utils_vert_collapse_edge (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_vert_collapse_faces_doc, ".. method:: vert_collapse_faces(vert, edge, fac, join_faces)\n" "\n" " Collapses a vertex that has only two manifold edges onto a vertex it shares an " "edge with.\n" "\n" " :arg vert: The vert that will be collapsed.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg edge: The edge to collapse into.\n" " :type edge: :class:`bmesh.types.BMEdge`\n" " :arg fac: The factor to use when merging customdata [0 - 1].\n" " :type fac: float\n" " :arg join_faces: When true the faces around the vertex will be joined otherwise " "collapse the vertex by merging the 2 edges this vertex connects to into one.\n" " :type join_faces: bool\n" " :return: The resulting edge from the collapse operation.\n" " :rtype: :class:`bmesh.types.BMEdge`\n")
 
static PyObject * bpy_bm_utils_vert_collapse_faces (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_vert_dissolve_doc, ".. method:: vert_dissolve(vert)\n" "\n" " Dissolve this vertex (will be removed).\n" "\n" " :arg vert: The vert to be dissolved.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :return: True when the vertex dissolve is successful.\n" " :rtype: boolean\n")
 
static PyObject * bpy_bm_utils_vert_dissolve (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_vert_splice_doc, ".. method:: vert_splice(vert, vert_target)\n" "\n" " Splice vert into vert_target.\n" "\n" " :arg vert: The vertex to be removed.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg vert_target: The vertex to use.\n" " :type vert_target: :class:`bmesh.types.BMVert`\n" "\n" " .. note:: The verts mustn't share an edge or face.\n")
 
static PyObject * bpy_bm_utils_vert_splice (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_vert_separate_doc, ".. method:: vert_separate(vert, edges)\n" "\n" " Separate this vertex at every edge.\n" "\n" " :arg vert: The vert to be separated.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg edges: The edges to separated.\n" " :type edges: :class:`bmesh.types.BMEdge`\n" " :return: The newly separated verts (including the vertex passed).\n" " :rtype: tuple of :class:`bmesh.types.BMVert`\n")
 
static PyObject * bpy_bm_utils_vert_separate (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_edge_split_doc, ".. method:: edge_split(edge, vert, fac)\n" "\n" " Split an edge, return the newly created data.\n" "\n" " :arg edge: The edge to split.\n" " :type edge: :class:`bmesh.types.BMEdge`\n" " :arg vert: One of the verts on the edge, defines the split direction.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg fac: The point on the edge where the new vert will be created [0 - 1].\n" " :type fac: float\n" " :return: The newly created (edge, vert) pair.\n" " :rtype: tuple\n")
 
static PyObject * bpy_bm_utils_edge_split (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_edge_rotate_doc, ".. method:: edge_rotate(edge, ccw=False)\n" "\n" " Rotate the edge and return the newly created edge.\n" " If rotating the edge fails, None will be returned.\n" "\n" " :arg edge: The edge to rotate.\n" " :type edge: :class:`bmesh.types.BMEdge`\n" " :arg ccw: When True the edge will be rotated counter clockwise.\n" " :type ccw: boolean\n" " :return: The newly rotated edge.\n" " :rtype: :class:`bmesh.types.BMEdge`\n")
 
static PyObject * bpy_bm_utils_edge_rotate (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_face_split_doc, ".. method:: face_split(face, vert_a, vert_b, coords=(), use_exist=True, example=None)\n" "\n" " Face split with optional intermediate points.\n" "\n" " :arg face: The face to cut.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg vert_a: First vertex to cut in the face (face must contain the vert).\n" " :type vert_a: :class:`bmesh.types.BMVert`\n" " :arg vert_b: Second vertex to cut in the face (face must contain the vert).\n" " :type vert_b: :class:`bmesh.types.BMVert`\n" " :arg coords: Optional argument to define points in between *vert_a* and *vert_b*.\n" " :type coords: sequence of float triplets\n" " :arg use_exist: .Use an existing edge if it exists (Only used when *coords* argument is " "empty or omitted)\n" " :type use_exist: boolean\n" " :arg example: Newly created edge will copy settings from this one.\n" " :type example: :class:`bmesh.types.BMEdge`\n" " :return: The newly created face or None on failure.\n" " :rtype: (:class:`bmesh.types.BMFace`, :class:`bmesh.types.BMLoop`) pair\n")
 
static PyObject * bpy_bm_utils_face_split (PyObject *UNUSED(self), PyObject *args, PyObject *kw)
 
 PyDoc_STRVAR (bpy_bm_utils_face_split_edgenet_doc, ".. method:: face_split_edgenet(face, edgenet)\n" "\n" " Splits a face into any number of regions defined by an edgenet.\n" "\n" " :arg face: The face to split.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg face: The face to split.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg edgenet: Sequence of edges.\n" " :type edgenet: :class:`bmesh.types.BMEdge`\n" " :return: The newly created faces.\n" " :rtype: tuple of (:class:`bmesh.types.BMFace`)\n" "\n" " .. note::\n" "\n" " Regions defined by edges need to connect to the face, otherwise they're " "ignored as loose edges.\n")
 
static PyObject * bpy_bm_utils_face_split_edgenet (PyObject *UNUSED(self), PyObject *args, PyObject *kw)
 
 PyDoc_STRVAR (bpy_bm_utils_face_join_doc, ".. method:: face_join(faces, remove=True)\n" "\n" " Joins a sequence of faces.\n" "\n" " :arg faces: Sequence of faces.\n" " :type faces: :class:`bmesh.types.BMFace`\n" " :arg remove: Remove the edges and vertices between the faces.\n" " :type remove: boolean\n" " :return: The newly created face or None on failure.\n" " :rtype: :class:`bmesh.types.BMFace`\n")
 
static PyObject * bpy_bm_utils_face_join (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_face_vert_separate_doc, ".. method:: face_vert_separate(face, vert)\n" "\n" " Rip a vertex in a face away and add a new vertex.\n" "\n" " :arg face: The face to separate.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg vert: A vertex in the face to separate.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :return vert: The newly created vertex or None on failure.\n" " :rtype vert: :class:`bmesh.types.BMVert`\n" "\n" " .. note::\n" "\n" " This is the same as loop_separate, and has only been added for convenience.\n")
 
static PyObject * bpy_bm_utils_face_vert_separate (PyObject *UNUSED(self), PyObject *args)
 
 PyDoc_STRVAR (bpy_bm_utils_face_flip_doc, ".. method:: face_flip(faces)\n" "\n" " Flip the faces direction.\n" "\n" " :arg face: Face to flip.\n" " :type face: :class:`bmesh.types.BMFace`\n")
 
static PyObject * bpy_bm_utils_face_flip (PyObject *UNUSED(self), BPy_BMFace *value)
 
 PyDoc_STRVAR (bpy_bm_utils_loop_separate_doc, ".. method:: loop_separate(loop)\n" "\n" " Rip a vertex in a face away and add a new vertex.\n" "\n" " :arg loop: The loop to separate.\n" " :type loop: :class:`bmesh.types.BMLoop`\n" " :return vert: The newly created vertex or None on failure.\n" " :rtype vert: :class:`bmesh.types.BMVert`\n")
 
static PyObject * bpy_bm_utils_loop_separate (PyObject *UNUSED(self), BPy_BMLoop *value)
 
 PyDoc_STRVAR (BPy_BM_utils_doc, "This module provides access to blenders bmesh data structures.")
 
PyObject * BPyInit_bmesh_utils (void)
 

Variables

static struct PyMethodDef BPy_BM_utils_methods []
 
static struct PyModuleDef BPy_BM_utils_module_def
 

Detailed Description

This file defines the 'bmesh.utils' module. Utility functions for operating on 'bmesh.types'

Definition in file bmesh_py_utils.c.

Function Documentation

◆ bpy_bm_utils_edge_rotate()

static PyObject* bpy_bm_utils_edge_rotate ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_edge_split()

static PyObject* bpy_bm_utils_edge_split ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_face_flip()

static PyObject* bpy_bm_utils_face_flip ( PyObject *  UNUSEDself,
BPy_BMFace value 
)
static

◆ bpy_bm_utils_face_join()

static PyObject* bpy_bm_utils_face_join ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_face_split()

static PyObject* bpy_bm_utils_face_split ( PyObject *  UNUSEDself,
PyObject *  args,
PyObject *  kw 
)
static

◆ bpy_bm_utils_face_split_edgenet()

static PyObject* bpy_bm_utils_face_split_edgenet ( PyObject *  UNUSEDself,
PyObject *  args,
PyObject *  kw 
)
static

◆ bpy_bm_utils_face_vert_separate()

static PyObject* bpy_bm_utils_face_vert_separate ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_loop_separate()

static PyObject* bpy_bm_utils_loop_separate ( PyObject *  UNUSEDself,
BPy_BMLoop value 
)
static

◆ bpy_bm_utils_vert_collapse_edge()

static PyObject* bpy_bm_utils_vert_collapse_edge ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_vert_collapse_faces()

static PyObject* bpy_bm_utils_vert_collapse_faces ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_vert_dissolve()

static PyObject* bpy_bm_utils_vert_dissolve ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_vert_separate()

static PyObject* bpy_bm_utils_vert_separate ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ bpy_bm_utils_vert_splice()

static PyObject* bpy_bm_utils_vert_splice ( PyObject *  UNUSEDself,
PyObject *  args 
)
static

◆ BPyInit_bmesh_utils()

PyObject* BPyInit_bmesh_utils ( void  )

Definition at line 831 of file bmesh_py_utils.c.

References BPy_BM_utils_module_def.

Referenced by BPyInit_bmesh().

◆ PyDoc_STRVAR() [1/14]

PyDoc_STRVAR ( BPy_BM_utils_doc  ,
"This module provides access to blenders bmesh data structures."   
)

◆ PyDoc_STRVAR() [2/14]

PyDoc_STRVAR ( bpy_bm_utils_edge_rotate_doc  ,
".. method:: edge_rotate(edge, ccw=False)\n" "\n" " Rotate the edge and return the newly created edge.\n" " If rotating the edge  fails,
None will be returned.\n" "\n" " :arg edge:The edge to rotate.\n" " :type edge::class:`bmesh.types.BMEdge`\n" " :arg ccw:When True the edge will be rotated counter clockwise.\n" " :type ccw:boolean\n" " :return:The newly rotated edge.\n" " :rtype::class:`bmesh.types.BMEdge`\n"   
)

◆ PyDoc_STRVAR() [3/14]

PyDoc_STRVAR ( bpy_bm_utils_edge_split_doc  ,
".. method:: edge_split(edge, vert, fac)\n" "\n" " Split an  edge,
return the newly created data.\n" "\n" " :arg edge:The edge to split.\n" " :type edge::class:`bmesh.types.BMEdge`\n" " :arg vert:One of the verts on the  edge,
defines the split direction.\n" " :type vert::class:`bmesh.types.BMVert`\n" " :arg fac:The point on the edge where the new vert will be created .\n" " :type fac:float\n" " :return:The newly created(edge, vert) pair.\n" " :rtype:tuple\n"  [0 - 1] 
)

◆ PyDoc_STRVAR() [4/14]

PyDoc_STRVAR ( bpy_bm_utils_face_flip_doc  ,
".. method:: face_flip(faces)\n" "\n" " Flip the faces direction.\n" "\n" " :arg face: Face to flip.\n" " :type face: :class:`bmesh.types.BMFace`\n"   
)

◆ PyDoc_STRVAR() [5/14]

PyDoc_STRVAR ( bpy_bm_utils_face_join_doc  ,
".. method:: face_join(faces, remove=True)\n" "\n" " Joins a sequence of faces.\n" "\n" " :arg faces: Sequence of faces.\n" " :type faces: :class:`bmesh.types.BMFace`\n" " :arg remove: Remove the edges and vertices between the faces.\n" " :type remove: boolean\n" " :return: The newly created face or None on failure.\n" " :rtype: :class:`bmesh.types.BMFace`\n"   
)

◆ PyDoc_STRVAR() [6/14]

PyDoc_STRVAR ( bpy_bm_utils_face_split_doc  ,
".. method:: face_split(face, vert_a, vert_b, coords=(), use_exist=True, example=None)\n" "\n" " Face split with optional intermediate points.\n" "\n" " :arg face: The face to cut.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg vert_a: First vertex to cut in the face (face must contain the vert).\n" " :type vert_a: :class:`bmesh.types.BMVert`\n" " :arg vert_b: Second vertex to cut in the face (face must contain the vert).\n" " :type vert_b: :class:`bmesh.types.BMVert`\n" " :arg coords: Optional argument to define points in between *vert_a* and *vert_b*.\n" " :type coords: sequence of float triplets\n" " :arg use_exist: .Use an existing edge if it exists (Only used when *coords* argument is " "empty or omitted)\n" " :type use_exist: boolean\n" " :arg example: Newly created edge will copy settings from this one.\n" " :type example: :class:`bmesh.types.BMEdge`\n" " :return: The newly created face or None on failure.\n" " :rtype: (:class:`bmesh.types.BMFace`, :class:`bmesh.types.BMLoop`) pair\n"   
)

◆ PyDoc_STRVAR() [7/14]

PyDoc_STRVAR ( bpy_bm_utils_face_split_edgenet_doc  ,
".. method:: face_split_edgenet(face, edgenet)\n" "\n" " Splits a face into any number of regions defined by an edgenet.\n" "\n" " :arg face: The face to split.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg face: The face to split.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg edgenet: Sequence of edges.\n" " :type edgenet: :class:`bmesh.types.BMEdge`\n" " :return: The newly created faces.\n" " :rtype: tuple of (:class:`bmesh.types.BMFace`)\n" "\n" " .. note::\n" "\n" " Regions defined by edges need to connect to the  face,
otherwise they 're " "ignored as loose edges.\n"   
)

◆ PyDoc_STRVAR() [8/14]

PyDoc_STRVAR ( bpy_bm_utils_face_vert_separate_doc  ,
".. method:: face_vert_separate(face, vert)\n" "\n" " Rip a vertex in a face away and add a new vertex.\n" "\n" " :arg face: The face to separate.\n" " :type face: :class:`bmesh.types.BMFace`\n" " :arg vert: A vertex in the face to separate.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :return vert: The newly created vertex or None on failure.\n" " :rtype vert: :class:`bmesh.types.BMVert`\n" "\n" " .. note::\n" "\n" " This is the same as  loop_separate,
and has only been added for convenience.\n"   
)

◆ PyDoc_STRVAR() [9/14]

PyDoc_STRVAR ( bpy_bm_utils_loop_separate_doc  ,
".. method:: loop_separate(loop)\n" "\n" " Rip a vertex in a face away and add a new vertex.\n" "\n" " :arg loop: The loop to separate.\n" " :type loop: :class:`bmesh.types.BMLoop`\n" " :return vert: The newly created vertex or None on failure.\n" " :rtype vert: :class:`bmesh.types.BMVert`\n"   
)

◆ PyDoc_STRVAR() [10/14]

PyDoc_STRVAR ( bpy_bm_utils_vert_collapse_edge_doc  ,
".. method:: vert_collapse_edge(vert, edge)\n" "\n" " Collapse a vertex into an edge.\n" "\n" " :arg vert: The vert that will be collapsed.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg edge: The edge to collapse into.\n" " :type edge: :class:`bmesh.types.BMEdge`\n" " :return: The resulting edge from the collapse operation.\n" " :rtype: :class:`bmesh.types.BMEdge`\n"   
)

◆ PyDoc_STRVAR() [11/14]

PyDoc_STRVAR ( bpy_bm_utils_vert_collapse_faces_doc  ,
".. method:: vert_collapse_faces(vert, edge, fac, join_faces)\n" "\n" " Collapses a vertex that has only two manifold edges onto a vertex it shares an " "edge with.\n" "\n" " :arg vert: The vert that will be collapsed.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg edge: The edge to collapse into.\n" " :type edge: :class:`bmesh.types.BMEdge`\n" " :arg fac: The factor to use when merging customdata .\n" " :type fac: float\n" " :arg join_faces: When true the faces around the vertex will be joined otherwise " "collapse the vertex by merging the 2 edges this vertex connects to into one.\n" " :type join_faces: bool\n" " :return: The resulting edge from the collapse operation.\n" " :rtype: :class:`bmesh.types.BMEdge`\n"  [0 - 1] 
)

◆ PyDoc_STRVAR() [12/14]

PyDoc_STRVAR ( bpy_bm_utils_vert_dissolve_doc  ,
".. method:: vert_dissolve(vert)\n" "\n" " Dissolve this vertex (will be removed).\n" "\n" " :arg vert: The vert to be dissolved.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :return: True when the vertex dissolve is successful.\n" " :rtype: boolean\n"   
)

◆ PyDoc_STRVAR() [13/14]

PyDoc_STRVAR ( bpy_bm_utils_vert_separate_doc  ,
".. method:: vert_separate(vert, edges)\n" "\n" " Separate this vertex at every edge.\n" "\n" " :arg vert: The vert to be separated.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg edges: The edges to separated.\n" " :type edges: :class:`bmesh.types.BMEdge`\n" " :return: The newly separated verts (including the vertex passed).\n" " :rtype: tuple of :class:`bmesh.types.BMVert`\n"   
)

◆ PyDoc_STRVAR() [14/14]

PyDoc_STRVAR ( bpy_bm_utils_vert_splice_doc  ,
".. method:: vert_splice(vert, vert_target)\n" "\n" " Splice vert into vert_target.\n" "\n" " :arg vert: The vertex to be removed.\n" " :type vert: :class:`bmesh.types.BMVert`\n" " :arg vert_target: The vertex to use.\n" " :type vert_target: :class:`bmesh.types.BMVert`\n" "\n" " .. note:: The verts mustn't share an edge or face.\n"   
)

Variable Documentation

◆ BPy_BM_utils_methods

struct PyMethodDef BPy_BM_utils_methods[]
static

Definition at line 740 of file bmesh_py_utils.c.

◆ BPy_BM_utils_module_def

struct PyModuleDef BPy_BM_utils_module_def
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
"bmesh.utils",
BPy_BM_utils_doc,
0,
NULL,
NULL,
NULL,
NULL,
}
static struct PyMethodDef BPy_BM_utils_methods[]

Definition at line 818 of file bmesh_py_utils.c.

Referenced by BPyInit_bmesh_utils().