Blender
V3.3
|
#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 |
This file defines the 'bmesh.utils' module. Utility functions for operating on 'bmesh.types'
Definition in file bmesh_py_utils.c.
|
static |
Definition at line 366 of file bmesh_py_utils.c.
References bm, BPy_BMEdge::bm, BM_edge_rotate(), BPY_BM_CHECK_OBJ, BPy_BMEdge_CreatePyObject(), BPy_BMEdge_Type, BPy_BMEdge::e, NULL, and PyC_ParseBool().
|
static |
Definition at line 308 of file bmesh_py_utils.c.
References bm, BPy_BMEdge::bm, BM_edge_split(), BPY_BM_CHECK_OBJ, BPy_BMEdge_CreatePyObject(), BPy_BMEdge_Type, BPy_BMVert_CreatePyObject(), BPy_BMVert_Type, clamp_f(), BPy_BMEdge::e, NULL, PyTuple_SET_ITEMS, ret, BPy_BMVert::v, BMEdge::v1, and BMEdge::v2.
|
static |
Definition at line 715 of file bmesh_py_utils.c.
References BPy_BMFace::bm, BM_face_normal_flip(), BPY_BM_CHECK_OBJ, BPy_BMFace_Check, BPy_BMFace::f, and NULL.
|
static |
Definition at line 619 of file bmesh_py_utils.c.
References bm, BM_FACE, BM_faces_join(), BPy_BMElem_PySeq_As_Array(), BPy_BMFace_CreatePyObject(), NULL, and PyC_ParseBool().
|
static |
Definition at line 413 of file bmesh_py_utils.c.
References bm, BPy_BMFace::bm, BM_face_split(), BM_face_split_n(), BM_face_vert_share_loop(), BM_loop_is_adjacent(), BPY_BM_CHECK_OBJ, BPy_BMEdge_Type, BPy_BMFace_CreatePyObject(), BPy_BMFace_Type, BPy_BMLoop_CreatePyObject(), BPy_BMVert_Type, BPy_BMEdge::e, BPy_BMFace::f, l_b, mathutils_array_parse_alloc_v(), NULL, PyC_ParseBool(), PyTuple_SET_ITEMS, ret, and BPy_BMVert::v.
|
static |
Definition at line 543 of file bmesh_py_utils.c.
References bm, BPy_BMFace::bm, BM_EDGE, BM_face_split_edgenet(), BPY_BM_CHECK_OBJ, BPy_BMElem_PySeq_As_Array(), BPy_BMFace_Array_As_Tuple(), BPy_BMFace_Type, BPy_BMFace::f, MEM_freeN, NULL, and ret.
|
static |
Definition at line 668 of file bmesh_py_utils.c.
References bm, BPy_BMFace::bm, BM_face_loop_separate(), BM_face_vert_share_loop(), BPY_BM_CHECK_OBJ, BPY_BM_CHECK_SOURCE_OBJ, BPy_BMFace_Type, BPy_BMVert_CreatePyObject(), BPy_BMVert_Type, BPy_BMFace::f, l, NULL, BMLoop::v, and BPy_BMVert::v.
|
static |
Definition at line 740 of file bmesh_py_utils.c.
References bm, BPy_BMLoop::bm, BM_face_loop_separate(), BPY_BM_CHECK_OBJ, BPy_BMLoop_Check, BPy_BMVert_CreatePyObject(), l, BPy_BMLoop::l, NULL, and BMLoop::v.
|
static |
Definition at line 38 of file bmesh_py_utils.c.
References bm, BPy_BMEdge::bm, BM_vert_collapse_edge(), BM_vert_edge_count_is_over, BPY_BM_CHECK_OBJ, BPy_BMEdge_CreatePyObject(), BPy_BMEdge_Type, BPy_BMVert_Type, BPy_BMEdge::e, NULL, BPy_BMVert::v, BMEdge::v1, and BMEdge::v2.
|
static |
Definition at line 101 of file bmesh_py_utils.c.
References bm, BPy_BMEdge::bm, BM_vert_collapse_faces(), BM_vert_edge_count_is_over, BPY_BM_CHECK_OBJ, BPy_BMEdge_CreatePyObject(), BPy_BMEdge_Type, BPy_BMVert_Type, clamp_f(), BPy_BMEdge::e, NULL, BPy_BMVert::v, BMEdge::v1, and BMEdge::v2.
|
static |
Definition at line 162 of file bmesh_py_utils.c.
References bm, BPy_BMVert::bm, BM_vert_dissolve(), BPY_BM_CHECK_OBJ, BPy_BMVert_Type, NULL, and BPy_BMVert::v.
|
static |
Definition at line 248 of file bmesh_py_utils.c.
References bm, BPy_BMVert::bm, BM_EDGE, BM_vert_separate(), BPY_BM_CHECK_OBJ, BPy_BMElem_PySeq_As_Array(), BPy_BMVert_Array_As_Tuple(), BPy_BMVert_Type, MEM_freeN, NULL, ret, and BPy_BMVert::v.
|
static |
Definition at line 190 of file bmesh_py_utils.c.
References BLI_assert, bm, BPy_BMVert::bm, BM_edge_exists(), BM_vert_pair_share_face_check(), BM_vert_splice(), BPY_BM_CHECK_OBJ, BPY_BM_CHECK_SOURCE_OBJ, BPy_BMVert_Type, NULL, UNUSED_VARS_NDEBUG, and BPy_BMVert::v.
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 | ( | BPy_BM_utils_doc | , |
"This module provides access to blenders bmesh data structures." | |||
) |
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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 |
Definition at line 740 of file bmesh_py_utils.c.
|
static |
Definition at line 818 of file bmesh_py_utils.c.
Referenced by BPyInit_bmesh_utils().