29 #include "../generic/py_capi_utils.h"
34 ".. method:: new(use_operators=True)\n"
36 " :arg use_operators: Support calling operators in :mod:`bmesh.ops` (uses some "
37 "extra memory per vert/edge/face).\n"
38 " :type use_operators: bool\n"
39 " :return: Return a new, empty BMesh.\n"
40 " :rtype: :class:`bmesh.types.BMesh`\n");
44 static const char *kwlist[] = {
"use_operators",
NULL};
47 bool use_operators =
true;
49 if (!PyArg_ParseTupleAndKeywords(
50 args, kw,
"|$O&:new", (
char **)kwlist,
PyC_ParseBool, &use_operators)) {
56 .use_toolflags = use_operators,
63 ".. method:: from_edit_mesh(mesh)\n"
65 " Return a BMesh from this mesh, currently the mesh must already be in editmode.\n"
67 " :arg mesh: The editmode mesh.\n"
68 " :type mesh: :class:`bpy.types.Mesh`\n"
69 " :return: the BMesh associated with this mesh.\n"
70 " :rtype: :class:`bmesh.types.BMesh`\n");
81 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
91 ".. method:: update_edit_mesh(mesh, loop_triangles=True, destructive=True)\n"
93 " Update the mesh after changes to the BMesh in editmode,\n"
94 " optionally recalculating n-gon tessellation.\n"
96 " :arg mesh: The editmode mesh.\n"
97 " :type mesh: :class:`bpy.types.Mesh`\n"
98 " :arg loop_triangles: Option to recalculate n-gon tessellation.\n"
99 " :type loop_triangles: boolean\n"
100 " :arg destructive: Use when geometry has been added or removed.\n"
101 " :type destructive: boolean\n");
104 static const char *kwlist[] = {
"mesh",
"loop_triangles",
"destructive",
NULL};
107 bool do_loop_triangles =
true;
108 bool is_destructive =
true;
110 if (!PyArg_ParseTupleAndKeywords(args,
112 "O|$O&O&:update_edit_mesh",
129 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
135 struct Mesh * me,
const bool do_tessface,
const bool is_destructive);
144 {
"new", (PyCFunction)
bpy_bm_new, METH_VARARGS | METH_KEYWORDS, bpy_bm_new_doc},
148 METH_VARARGS | METH_KEYWORDS,
149 bpy_bm_update_edit_mesh_doc},
154 "This module provides access to blenders bmesh data structures.\n"
156 ".. include:: include__bmesh.rst\n");
158 PyModuleDef_HEAD_INIT,
173 PyObject *sys_modules = PyImport_GetModuleDict();
184 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
188 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
191 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
194 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
void EDBM_update_extern(struct Mesh *me, bool do_tessellation, bool is_destructive)
ATTR_WARN_UNUSED_RESULT BMesh * bm
const BMAllocTemplate bm_mesh_allocsize_default
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const struct BMeshCreateParams *params)
static PyObject * bpy_bm_from_edit_mesh(PyObject *UNUSED(self), PyObject *value)
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")
static struct PyMethodDef BPy_BM_methods[]
static struct PyModuleDef BPy_BM_module_def
PyObject * BPyInit_bmesh(void)
static PyObject * bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
static PyObject * bpy_bm_new(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
PyObject * BPyInit_bmesh_geometry(void)
PyObject * BPyInit_bmesh_ops(void)
PyObject * BPyInit_bmesh_types(void)
void BPy_BM_init_types(void)
PyObject * BPy_BMesh_CreatePyObject(BMesh *bm, int flag)
void BPy_BM_init_types_customdata(void)
void BPy_BM_init_types_meshdata(void)
void BPy_BM_init_types_select(void)
PyObject * BPyInit_bmesh_utils(void)
void * PyC_RNA_AsPointer(PyObject *value, const char *type_name)
int PyC_ParseBool(PyObject *o, void *p)
struct BMEditMesh * edit_mesh
ccl_device_inline int mod(int x, int m)