37 ".. method:: new(*, use_operators=True)\n"
39 " :arg use_operators: Support calling operators in :mod:`bmesh.ops` (uses some "
40 "extra memory per vert/edge/face).\n"
41 " :type use_operators: bool\n"
42 " :return: Return a new, empty BMesh.\n"
43 " :rtype: :class:`bmesh.types.BMesh`\n");
44static PyObject *
bpy_bm_new(PyObject * , PyObject *args, PyObject *kw)
46 static const char *kwlist[] = {
"use_operators",
nullptr};
49 bool use_operators =
true;
51 if (!PyArg_ParseTupleAndKeywords(
52 args, kw,
"|$O&:new", (
char **)kwlist,
PyC_ParseBool, &use_operators))
58 params.use_toolflags = use_operators;
67 bpy_bm_from_edit_mesh_doc,
68 ".. method:: from_edit_mesh(mesh)\n"
70 " Return a BMesh from this mesh, currently the mesh must already be in editmode.\n"
72 " :arg mesh: The editmode mesh.\n"
73 " :type mesh: :class:`bpy.types.Mesh`\n"
74 " :return: the BMesh associated with this mesh.\n"
75 " :rtype: :class:`bmesh.types.BMesh`\n");
81 if (mesh ==
nullptr) {
85 if (mesh->
runtime->edit_mesh ==
nullptr) {
86 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
99 bpy_bm_update_edit_mesh_doc,
100 ".. method:: update_edit_mesh(mesh, *, loop_triangles=True, destructive=True)\n"
102 " Update the mesh after changes to the BMesh in editmode,\n"
103 " optionally recalculating n-gon tessellation.\n"
105 " :arg mesh: The editmode mesh.\n"
106 " :type mesh: :class:`bpy.types.Mesh`\n"
107 " :arg loop_triangles: Option to recalculate n-gon tessellation.\n"
108 " :type loop_triangles: bool\n"
109 " :arg destructive: Use when geometry has been added or removed.\n"
110 " :type destructive: bool\n");
113 static const char *kwlist[] = {
"mesh",
"loop_triangles",
"destructive",
nullptr};
116 bool do_loop_triangles =
true;
117 bool is_destructive =
true;
119 if (!PyArg_ParseTupleAndKeywords(args,
121 "O|$O&O&:update_edit_mesh",
134 if (mesh ==
nullptr) {
138 if (mesh->
runtime->edit_mesh ==
nullptr) {
139 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
152# pragma clang diagnostic push
153# pragma clang diagnostic ignored "-Wcast-function-type"
155# pragma GCC diagnostic push
156# pragma GCC diagnostic ignored "-Wcast-function-type"
161 {
"new", (PyCFunction)
bpy_bm_new, METH_VARARGS | METH_KEYWORDS, bpy_bm_new_doc},
165 METH_VARARGS | METH_KEYWORDS,
166 bpy_bm_update_edit_mesh_doc},
167 {
nullptr,
nullptr, 0,
nullptr},
172# pragma clang diagnostic pop
174# pragma GCC diagnostic pop
181 "This module provides access to blenders bmesh data structures.\n"
183 ".. include:: include__bmesh.rst\n");
200 PyObject *sys_modules = PyImport_GetModuleDict();
211 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
215 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
218 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
221 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
const BMAllocTemplate bm_mesh_allocsize_default
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
static PyObject * bpy_bm_from_edit_mesh(PyObject *, PyObject *value)
static PyMethodDef BPy_BM_methods[]
static PyObject * bpy_bm_update_edit_mesh(PyObject *, PyObject *args, PyObject *kw)
static PyObject * bpy_bm_new(PyObject *, PyObject *args, PyObject *kw)
static PyModuleDef BPy_BM_module_def
PyObject * BPyInit_bmesh()
void EDBM_update_extern(Mesh *mesh, const bool do_tessface, const bool is_destructive)
PyDoc_STRVAR(bpy_bm_new_doc, ".. method:: new(*, use_operators=True)\n" "\n" " :arg use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
PyObject * BPyInit_bmesh_geometry()
PyObject * BPyInit_bmesh_ops()
PyObject * BPy_BMesh_CreatePyObject(BMesh *bm, int flag)
PyObject * BPyInit_bmesh_types()
void BPy_BM_init_types_customdata()
void BPy_BM_init_types_meshdata()
void BPy_BM_init_types_select()
PyObject * BPyInit_bmesh_utils()
VecBase< float, D > constexpr mod(VecOp< float, D >, VecOp< float, D >) RET
void * PyC_RNA_AsPointer(PyObject *value, const char *type_name)
int PyC_ParseBool(PyObject *o, void *p)
MeshRuntimeHandle * runtime