38 ".. method:: new(use_operators=True)\n"
40 " :arg use_operators: Support calling operators in :mod:`bmesh.ops` (uses some "
41 "extra memory per vert/edge/face).\n"
42 " :type use_operators: bool\n"
43 " :return: Return a new, empty BMesh.\n"
44 " :rtype: :class:`bmesh.types.BMesh`\n");
46static PyObject *
bpy_bm_new(PyObject * , PyObject *args, PyObject *kw)
48 static const char *kwlist[] = {
"use_operators",
nullptr};
51 bool use_operators =
true;
53 if (!PyArg_ParseTupleAndKeywords(
54 args, kw,
"|$O&:new", (
char **)kwlist,
PyC_ParseBool, &use_operators))
60 params.use_toolflags = use_operators;
68 bpy_bm_from_edit_mesh_doc,
69 ".. method:: from_edit_mesh(mesh)\n"
71 " Return a BMesh from this mesh, currently the mesh must already be in editmode.\n"
73 " :arg mesh: The editmode mesh.\n"
74 " :type mesh: :class:`bpy.types.Mesh`\n"
75 " :return: the BMesh associated with this mesh.\n"
76 " :rtype: :class:`bmesh.types.BMesh`\n");
82 if (mesh ==
nullptr) {
86 if (mesh->runtime->edit_mesh ==
nullptr) {
87 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
91 bm = mesh->runtime->edit_mesh->bm;
100 bpy_bm_update_edit_mesh_doc,
101 ".. method:: update_edit_mesh(mesh, loop_triangles=True, destructive=True)\n"
103 " Update the mesh after changes to the BMesh in editmode,\n"
104 " optionally recalculating n-gon tessellation.\n"
106 " :arg mesh: The editmode mesh.\n"
107 " :type mesh: :class:`bpy.types.Mesh`\n"
108 " :arg loop_triangles: Option to recalculate n-gon tessellation.\n"
109 " :type loop_triangles: bool\n"
110 " :arg destructive: Use when geometry has been added or removed.\n"
111 " :type destructive: bool\n");
114 static const char *kwlist[] = {
"mesh",
"loop_triangles",
"destructive",
nullptr};
117 bool do_loop_triangles =
true;
118 bool is_destructive =
true;
120 if (!PyArg_ParseTupleAndKeywords(args,
122 "O|$O&O&:update_edit_mesh",
135 if (mesh ==
nullptr) {
139 if (mesh->runtime->edit_mesh ==
nullptr) {
140 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
151#if (defined(__GNUC__) && !defined(__clang__))
152# pragma GCC diagnostic push
153# pragma GCC diagnostic ignored "-Wcast-function-type"
157 {
"new", (PyCFunction)
bpy_bm_new, METH_VARARGS | METH_KEYWORDS, bpy_bm_new_doc},
161 METH_VARARGS | METH_KEYWORDS,
162 bpy_bm_update_edit_mesh_doc},
163 {
nullptr,
nullptr, 0,
nullptr},
166#if (defined(__GNUC__) && !defined(__clang__))
167# pragma GCC diagnostic pop
173 "This module provides access to blenders bmesh data structures.\n"
175 ".. include:: include__bmesh.rst\n");
177 PyModuleDef_HEAD_INIT,
192 PyObject *sys_modules = PyImport_GetModuleDict();
203 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
207 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
210 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
213 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
ATTR_WARN_UNUSED_RESULT BMesh * bm
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
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()
void EDBM_update_extern(Mesh *mesh, const bool do_tessface, const bool is_destructive)
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()
void * PyC_RNA_AsPointer(PyObject *value, const char *type_name)
int PyC_ParseBool(PyObject *o, void *p)
ccl_device_inline int mod(int x, int m)