45 #include "../generic/py_capi_utils.h"
50 ".. method:: new(use_operators=True)\n"
52 " :arg use_operators: Support calling operators in :mod:`bmesh.ops` (uses some "
53 "extra memory per vert/edge/face).\n"
54 " :type use_operators: bool\n"
55 " :return: Return a new, empty BMesh.\n"
56 " :rtype: :class:`bmesh.types.BMesh`\n");
60 static const char *kwlist[] = {
"use_operators",
NULL};
63 bool use_operators =
true;
65 if (!PyArg_ParseTupleAndKeywords(
66 args, kw,
"|$O&:new", (
char **)kwlist,
PyC_ParseBool, &use_operators)) {
72 .use_toolflags = use_operators,
79 ".. method:: from_edit_mesh(mesh)\n"
81 " Return a BMesh from this mesh, currently the mesh must already be in editmode.\n"
83 " :arg mesh: The editmode mesh.\n"
84 " :type mesh: :class:`bpy.types.Mesh`\n"
85 " :return: the BMesh associated with this mesh.\n"
86 " :rtype: :class:`bmesh.types.BMesh`\n");
97 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
107 ".. method:: update_edit_mesh(mesh, loop_triangles=True, destructive=True)\n"
109 " Update the mesh after changes to the BMesh in editmode,\n"
110 " optionally recalculating n-gon tessellation.\n"
112 " :arg mesh: The editmode mesh.\n"
113 " :type mesh: :class:`bpy.types.Mesh`\n"
114 " :arg loop_triangles: Option to recalculate n-gon tessellation.\n"
115 " :type loop_triangles: boolean\n"
116 " :arg destructive: Use when geometry has been added or removed.\n"
117 " :type destructive: boolean\n");
120 static const char *kwlist[] = {
"mesh",
"loop_triangles",
"destructive",
NULL};
123 bool do_loop_triangles =
true;
124 bool is_destructive =
true;
126 if (!PyArg_ParseTupleAndKeywords(args,
128 "O|O&O&:update_edit_mesh",
145 PyErr_SetString(PyExc_ValueError,
"The mesh must be in editmode");
151 struct Mesh * me,
const bool do_tessface,
const bool is_destructive);
160 {
"new", (PyCFunction)
bpy_bm_new, METH_VARARGS | METH_KEYWORDS, bpy_bm_new_doc},
164 METH_VARARGS | METH_KEYWORDS,
165 bpy_bm_update_edit_mesh_doc},
170 "This module provides access to blenders bmesh data structures.\n"
172 ".. include:: include__bmesh.rst\n");
174 PyModuleDef_HEAD_INIT,
189 PyObject *sys_modules = PyImport_GetModuleDict();
200 PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
204 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);
void EDBM_update_generic(struct Mesh *me, const bool do_tessellation, const 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)
BMesh Make Mesh.
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)