28 #include "../mathutils/mathutils.h"
30 #include "../generic/py_capi_utils.h"
31 #include "../generic/python_utildefines.h"
66 #define BPY_BM_HFLAG_ALL_STR "('SELECT', 'HIDE', 'SEAM', 'SMOOTH', 'TAG')"
86 PyDoc_STRVAR(bpy_bm_elem_select_doc,
"Selected state of this element.\n\n:type: boolean");
87 PyDoc_STRVAR(bpy_bm_elem_hide_doc,
"Hidden state of this element.\n\n:type: boolean");
89 "Generic attribute scripts can use for own logic\n\n:type: boolean");
90 PyDoc_STRVAR(bpy_bm_elem_smooth_doc,
"Smooth state of this element.\n\n:type: boolean");
91 PyDoc_STRVAR(bpy_bm_elem_seam_doc,
"Seam for UV unwrapping.\n\n:type: boolean");
123 bpy_bm_elem_index_doc,
124 "Index of this element.\n"
130 " This value is not necessarily valid, while editing the mesh it can become *dirty*.\n"
132 " It's also possible to assign any number to this attribute for a scripts internal logic.\n"
134 " To ensure the value is up to date - see :class:`BMElemSeq.index_update`.\n");
148 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
156 self->bm->elem_index_dirty |=
self->ele->head.htype;
170 "This meshes vert sequence (read-only).\n\n:type: :class:`BMVertSeq`");
178 "This meshes edge sequence (read-only).\n\n:type: :class:`BMEdgeSeq`");
186 "This meshes face sequence (read-only).\n\n:type: :class:`BMFaceSeq`");
194 "This meshes loops (read-only).\n\n:type: :class:`BMLoopSeq`\n"
198 " Loops must be accessed via faces, this is only exposed for layer access.\n");
207 bpy_bmvert_link_edges_doc,
208 "Edges connected to this vertex (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMEdge`");
210 bpy_bmvert_link_faces_doc,
211 "Faces connected to this vertex (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMFace`");
213 bpy_bmvert_link_loops_doc,
214 "Loops that use this vertex (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
217 "Verts this edge uses (always 2), (read-only).\n\n:type: :class:`BMElemSeq` of "
220 bpy_bmedge_link_faces_doc,
221 "Faces connected to this edge, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMFace`");
223 bpy_bmedge_link_loops_doc,
224 "Loops connected to this edge, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
227 "Verts of this face, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMVert`");
229 "Edges of this face, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMEdge`");
231 "Loops of this face, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
234 bpy_bmloops_link_loops_doc,
235 "Loops connected to this loop, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
244 "True when this element is valid (hasn't been removed).\n\n:type: boolean");
251 bpy_bmesh_is_wrapped_doc,
252 "True when this mesh is owned by blender (typically the editmode BMesh).\n\n:type: boolean");
261 "The selection mode, values can be {'VERT', 'EDGE', 'FACE'}, can't be assigned an "
262 "empty set.\n\n:type: set");
280 PyErr_SetString(PyExc_TypeError,
"bm.select_mode: can't assign an empty value");
284 self->bm->selectmode = flag;
289 "Sequence of selected items (the last is displayed as active).\n\n:type: "
290 ":class:`BMEditSelSeq`");
309 "The coordinates for this vertex as a 3D, wrapped vector.\n\n:type: "
310 ":class:`mathutils.Vector`");
329 bpy_bmvert_normal_doc,
330 "The normal for this vertex as a 3D, wrapped vector.\n\n:type: :class:`mathutils.Vector`");
349 "True when this vertex is manifold (read-only).\n\n:type: boolean");
357 "True when this vertex is not connected to any faces (read-only).\n\n:type: boolean");
365 bpy_bmvert_is_boundary_doc,
366 "True when this vertex is connected to boundary edges (read-only).\n\n:type: boolean");
377 "True when this edge is manifold (read-only).\n\n:type: boolean");
385 "True when this edge is manifold, between two faces with the same winding "
386 "(read-only).\n\n:type: boolean");
394 "True when this edge joins two convex faces, depends on a valid face normal "
395 "(read-only).\n\n:type: boolean");
403 "True when this edge is not connected to any faces (read-only).\n\n:type: boolean");
411 "True when this edge is at the boundary of a face (read-only).\n\n:type: boolean");
422 bpy_bmface_normal_doc,
423 "The normal for this face as a 3D, wrapped vector.\n\n:type: :class:`mathutils.Vector`");
441 PyDoc_STRVAR(bpy_bmface_material_index_doc,
"The face's material index.\n\n:type: int");
445 return PyLong_FromLong(
self->f->mat_nr);
454 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
459 if ((param < 0) || (param >
MAXMAT)) {
461 PyErr_SetString(PyExc_ValueError,
"material index outside of usable range (0 - 32766)");
465 self->f->mat_nr = (short)param;
472 PyDoc_STRVAR(bpy_bmloop_vert_doc,
"The loop's vertex (read-only).\n\n:type: :class:`BMVert`");
481 "The loop's edge (between this loop and the next), (read-only).\n\n:type: :class:`BMEdge`");
489 "The face this loop makes (read-only).\n\n:type: :class:`BMFace`");
497 "The next face corner (read-only).\n\n:type: :class:`BMLoop`");
505 "The previous face corner (read-only).\n\n:type: :class:`BMLoop`");
513 "The next loop around the edge (read-only).\n\n:type: :class:`BMLoop`");
521 "The previous loop around the edge (read-only).\n\n:type: :class:`BMLoop`");
529 "True when this loop is at the convex corner of a face, depends on a valid face "
530 "normal (read-only).\n\n:type: boolean");
542 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessVert`");
544 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessEdge`");
546 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessFace`");
548 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessLoop`");
559 PyDoc_STRVAR(bpy_bmfaceseq_active_doc,
"active face.\n\n:type: :class:`BMFace` or None");
575 if (value == Py_None) {
586 PyErr_Format(PyExc_TypeError,
587 "faces.active = f: expected BMFace or None, not %.200s",
588 Py_TYPE(value)->tp_name);
600 bpy_bmesh_select_mode_doc,
606 bpy_bmesh_select_history_doc,
613 bpy_bmesh_is_wrapped_doc,
625 bpy_bm_elem_select_doc,
630 bpy_bm_elem_hide_doc,
640 bpy_bm_elem_index_doc,
647 bpy_bmvert_normal_doc,
654 bpy_bmvert_link_edges_doc,
659 bpy_bmvert_link_faces_doc,
664 bpy_bmvert_link_loops_doc,
671 bpy_bmvert_is_manifold_doc,
677 bpy_bmvert_is_boundary_doc,
689 bpy_bm_elem_select_doc,
694 bpy_bm_elem_hide_doc,
704 bpy_bm_elem_index_doc,
710 bpy_bm_elem_smooth_doc,
715 bpy_bm_elem_seam_doc,
722 bpy_bmedge_verts_doc,
728 bpy_bmedge_link_faces_doc,
733 bpy_bmedge_link_loops_doc,
740 bpy_bmedge_is_manifold_doc,
745 bpy_bmedge_is_contiguous_doc,
752 bpy_bmedge_is_boundary_doc,
764 bpy_bm_elem_select_doc,
769 bpy_bm_elem_hide_doc,
779 bpy_bm_elem_index_doc,
785 bpy_bm_elem_smooth_doc,
791 bpy_bmface_normal_doc,
797 bpy_bmface_material_index_doc,
804 bpy_bmface_verts_doc,
809 bpy_bmface_edges_doc,
814 bpy_bmface_loops_doc,
830 bpy_bm_elem_select_doc,
835 bpy_bm_elem_hide_doc,
846 bpy_bm_elem_index_doc,
857 bpy_bmloops_link_loops_doc,
862 bpy_bmloop_link_loop_next_doc,
867 bpy_bmloop_link_loop_prev_doc,
869 {
"link_loop_radial_next",
872 bpy_bmloop_link_loop_radial_next_doc,
874 {
"link_loop_radial_prev",
877 bpy_bmloop_link_loop_radial_prev_doc,
891 bpy_bmelemseq_layers_vert_doc,
899 bpy_bmelemseq_layers_edge_doc,
907 bpy_bmelemseq_layers_face_doc,
913 bpy_bmfaceseq_active_doc,
921 bpy_bmelemseq_layers_loop_doc,
933 ".. method:: copy()\n"
935 " :return: A copy of this BMesh.\n"
936 " :rtype: :class:`BMesh`\n");
952 PyErr_SetString(PyExc_SystemError,
"Unable to copy BMesh, internal error");
957 ".. method:: clear()\n"
959 " Clear all mesh data.\n");
975 ".. method:: free()\n"
977 " Explicitly free the BMesh data from memory, causing exceptions on further access.\n"
981 " The BMesh is freed automatically, typically when the script finishes executing.\n"
982 " However in some cases its hard to predict when this will be and its useful to\n"
983 " explicitly free the data.\n");
1002 ".. method:: to_mesh(mesh)\n"
1004 " Writes this BMesh data into an existing Mesh datablock.\n"
1006 " :arg mesh: The mesh data to write into.\n"
1007 " :type mesh: :class:`Mesh`\n");
1016 if (!PyArg_ParseTuple(args,
"O:to_mesh", &py_mesh) ||
1023 PyErr_Format(PyExc_ValueError,
"to_mesh(): Mesh '%s' is in editmode", me->
id.
name + 2);
1031 .update_shapekey_indices =
true,
1040 params.calc_object_remap =
true;
1053 ".. method:: from_object(object, depsgraph, cage=False, face_normals=True, "
1054 "vertex_normals=True)\n"
1056 " Initialize this bmesh from existing object data-block (only meshes are currently "
1059 " :arg object: The object data to load.\n"
1060 " :type object: :class:`Object`\n"
1061 " :arg cage: Get the mesh as a deformed cage.\n"
1062 " :type cage: boolean\n"
1063 " :arg face_normals: Calculate face normals.\n"
1064 " :type face_normals: boolean\n"
1065 " :arg vertex_normals: Calculate vertex normals.\n"
1066 " :type vertex_normals: boolean\n");
1069 static const char *kwlist[] = {
1070 "object",
"depsgraph",
"cage",
"face_normals",
"vertex_normals",
NULL};
1071 PyObject *py_object;
1072 PyObject *py_depsgraph;
1075 struct Scene *scene_eval;
1078 bool use_cage =
false;
1079 bool use_fnorm =
true;
1080 bool use_vert_normal =
true;
1085 if (!PyArg_ParseTupleAndKeywords(args,
1087 "OO|$O&O&O&:from_object",
1096 &use_vert_normal) ||
1103 PyErr_SetString(PyExc_ValueError,
1104 "from_object(...): currently only mesh objects are supported");
1111 bool need_free =
false;
1116 PyErr_SetString(PyExc_ValueError,
1117 "from_object(...): cage arg is unsupported when dependency graph "
1118 "evaluation mode is RENDER");
1134 if (me_eval ==
NULL) {
1135 PyErr_Format(PyExc_ValueError,
1136 "from_object(...): Object '%s' has no usable mesh data",
1146 .calc_face_normal = use_fnorm,
1147 .calc_vert_normal = use_vert_normal,
1158 bpy_bmesh_from_mesh_doc,
1159 ".. method:: from_mesh(mesh, face_normals=True, vertex_normals=True, use_shape_key=False, "
1160 "shape_key_index=0)\n"
1162 " Initialize this bmesh from existing mesh datablock.\n"
1164 " :arg mesh: The mesh data to load.\n"
1165 " :type mesh: :class:`Mesh`\n"
1166 " :arg use_shape_key: Use the locations from a shape key.\n"
1167 " :type use_shape_key: boolean\n"
1168 " :arg shape_key_index: The shape key index to use.\n"
1169 " :type shape_key_index: int\n"
1173 " Multiple calls can be used to join multiple meshes.\n"
1175 " Custom-data layers are only copied from ``mesh`` on initialization.\n"
1176 " Further calls will copy custom-data to matching layers, layers missing on the target "
1177 "mesh won't be added.\n");
1180 static const char *kwlist[] = {
1181 "mesh",
"face_normals",
"vertex_normals",
"use_shape_key",
"shape_key_index",
NULL};
1185 bool use_fnorm =
true;
1186 bool use_vert_normal =
true;
1187 bool use_shape_key =
false;
1188 int shape_key_index = 0;
1192 if (!PyArg_ParseTupleAndKeywords(args,
1194 "O|$O&O&O&i:from_mesh",
1203 &shape_key_index) ||
1213 .calc_face_normal = use_fnorm,
1214 .calc_vert_normal = use_vert_normal,
1215 .use_shapekey = use_shape_key,
1216 .active_shapekey = shape_key_index + 1,
1223 ".. method:: select_flush_mode()\n"
1225 " flush selection based on the current mode current :class:`BMesh.select_mode`.\n");
1236 ".. method:: select_flush(select)\n"
1238 " Flush selection, independent of the current selection mode.\n"
1240 " :arg select: flush selection or de-selected elements.\n"
1241 " :type select: boolean\n");
1263 bpy_bmesh_normal_update_doc,
1264 ".. method:: normal_update()\n"
1266 " Update normals of mesh faces and verts.\n"
1270 " The normal of any vertex where :attr:`is_wire` is True will be a zero vector.\n");
1282 ".. method:: transform(matrix, filter=None)\n"
1284 " Transform the mesh (optionally filtering flagged data only).\n"
1286 " :arg matrix: transform matrix.\n"
1287 " :type matrix: 4x4 :class:`mathutils.Matrix`\n"
1290 " :type filter: set\n");
1293 static const char *kwlist[] = {
"matrix",
"filter",
NULL};
1297 int filter_flags = 0;
1301 if (!PyArg_ParseTupleAndKeywords(args,
1320 PyErr_SetString(PyExc_ValueError,
"expected a 4x4 matrix");
1329 mat_ptr = mat->matrix;
1331 if (!filter_flags) {
1337 const char filter_flags_ch = (char)filter_flags;
1349 ".. method:: calc_volume(signed=False)\n"
1351 " Calculate mesh volume based on face normals.\n"
1353 " :arg signed: when signed is true, negative values may be returned.\n"
1354 " :type signed: bool\n"
1355 " :return: The volume of the mesh.\n"
1356 " :rtype: float\n");
1359 static const char *kwlist[] = {
"signed",
NULL};
1360 PyObject *is_signed = Py_False;
1364 if (!PyArg_ParseTupleAndKeywords(
1365 args, kw,
"|$O!:calc_volume", (
char **)kwlist, &PyBool_Type, &is_signed)) {
1373 ".. method:: calc_loop_triangles()\n"
1375 " Calculate triangle tessellation from quads/ngons.\n"
1377 " :return: The triangulated faces.\n"
1378 " :rtype: list of :class:`BMLoop` tuples\n");
1394 looptris = PyMem_MALLOC(
sizeof(*looptris) * looptris_tot);
1398 ret = PyList_New(looptris_tot);
1399 for (i = 0; i < looptris_tot; i++) {
1403 PyMem_FREE(looptris);
1412 ".. method:: select_set(select)\n"
1414 " Set the selection.\n"
1415 " This is different from the *select* attribute because it updates the selection "
1416 "state of associated geometry.\n"
1418 " :arg select: Select or de-select.\n"
1419 " :type select: boolean\n"
1423 " Currently this only flushes down, so selecting a face will select all its "
1424 "vertices but de-selecting a vertex "
1425 " won't de-select all the faces that use it, before finishing with a mesh "
1426 "typically flushing is still needed.\n");
1443 ".. method:: hide_set(hide)\n"
1445 " Set the hide state.\n"
1446 " This is different from the *hide* attribute because it updates the selection and "
1447 "hide state of associated geometry.\n"
1449 " :arg hide: Hidden or visible.\n"
1450 " :type hide: boolean\n");
1467 ".. method:: copy_from(other)\n"
1469 " Copy values from another element of matching type.\n");
1474 if (Py_TYPE(
self) != Py_TYPE(value)) {
1475 PyErr_Format(PyExc_TypeError,
1476 "expected element of type '%.200s' not '%.200s'",
1477 Py_TYPE(
self)->tp_name,
1478 Py_TYPE(value)->tp_name);
1482 if (value->
ele !=
self->ele) {
1493 ".. method:: copy_from_vert_interp(vert_pair, fac)\n"
1495 " Interpolate the customdata from a vert between 2 other verts.\n"
1497 " :arg vert_pair: The vert to interpolate data from.\n"
1498 " :type vert_pair: :class:`BMVert`\n");
1506 if (!PyArg_ParseTuple(args,
"Of:BMVert.copy_from_vert_interp", &vert_seq, &fac)) {
1512 Py_ssize_t vert_seq_len;
1522 "BMVert.copy_from_vert_interp(...)");
1524 if (vert_array ==
NULL) {
1530 PyMem_FREE(vert_array);
1535 ".. method:: copy_from_face_interp(face)\n"
1537 " Interpolate the customdata from a face onto this loop (the loops vert should "
1538 "overlap the face).\n"
1540 " :arg face: The face to interpolate data from.\n"
1541 " :type face: :class:`BMFace`\n");
1548 if (!PyArg_ParseTuple(args,
"O!:BMVert.copy_from_face_interp", &
BPy_BMFace_Type, &py_face)) {
1562 ".. method:: calc_edge_angle(fallback=None)\n"
1564 " Return the angle between this vert's two connected edges.\n"
1566 " :arg fallback: return this when the vert doesn't have 2 edges\n"
1567 " (instead of raising a :exc:`ValueError`).\n"
1568 " :type fallback: any\n"
1569 " :return: Angle between edges in radians.\n"
1570 " :rtype: float\n");
1573 const float angle_invalid = -1.0f;
1575 PyObject *fallback =
NULL;
1579 if (!PyArg_ParseTuple(args,
"|O:calc_edge_angle", &fallback)) {
1585 if (
angle == angle_invalid) {
1588 Py_INCREF(fallback);
1592 PyErr_SetString(PyExc_ValueError,
1593 "BMVert.calc_edge_angle(): "
1594 "vert must connect to exactly 2 edges");
1598 return PyFloat_FromDouble(
angle);
1602 bpy_bmvert_calc_shell_factor_doc,
1603 ".. method:: calc_shell_factor()\n"
1605 " Return a multiplier calculated based on the sharpness of the vertex.\n"
1606 " Where a flat surface gives 1.0, and higher values sharper edges.\n"
1607 " This is used to maintain shell thickness when offsetting verts along their normals.\n"
1609 " :return: offset multiplier\n"
1610 " :rtype: float\n");
1618 ".. method:: normal_update()\n"
1620 " Update vertex normal.\n"
1621 " This does not update the normals of adjoining faces.\n"
1625 " The vertex normal will be a zero vector if vertex :attr:`is_wire` is True.\n");
1639 ".. method:: calc_length()\n"
1641 " :return: The length between both verts.\n"
1642 " :rtype: float\n");
1650 ".. method:: calc_face_angle(fallback=None)\n"
1652 " :arg fallback: return this when the edge doesn't have 2 faces\n"
1653 " (instead of raising a :exc:`ValueError`).\n"
1654 " :type fallback: any\n"
1655 " :return: The angle between 2 connected faces in radians.\n"
1656 " :rtype: float\n");
1659 const float angle_invalid = -1.0f;
1661 PyObject *fallback =
NULL;
1665 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle", &fallback)) {
1671 if (
angle == angle_invalid) {
1674 Py_INCREF(fallback);
1678 PyErr_SetString(PyExc_ValueError,
1679 "BMEdge.calc_face_angle(): "
1680 "edge doesn't use 2 faces");
1684 return PyFloat_FromDouble(
angle);
1688 bpy_bmedge_calc_face_angle_signed_doc,
1689 ".. method:: calc_face_angle_signed(fallback=None)\n"
1691 " :arg fallback: return this when the edge doesn't have 2 faces\n"
1692 " (instead of raising a :exc:`ValueError`).\n"
1693 " :type fallback: any\n"
1694 " :return: The angle between 2 connected faces in radians (negative for concave join).\n"
1695 " :rtype: float\n");
1698 const float angle_invalid = -FLT_MAX;
1700 PyObject *fallback =
NULL;
1704 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle_signed", &fallback)) {
1710 if (
angle == angle_invalid) {
1713 Py_INCREF(fallback);
1717 PyErr_SetString(PyExc_ValueError,
1718 "BMEdge.calc_face_angle_signed(): "
1719 "edge doesn't use 2 faces");
1723 return PyFloat_FromDouble(
angle);
1727 bpy_bmedge_calc_tangent_doc,
1728 ".. method:: calc_tangent(loop)\n"
1730 " Return the tangent at this edge relative to a face (pointing inward into the face).\n"
1731 " This uses the face normal for calculation.\n"
1733 " :arg loop: The loop used for tangent calculation.\n"
1734 " :type loop: :class:`BMLoop`\n"
1735 " :return: a normalized vector.\n"
1736 " :rtype: :class:`mathutils.Vector`\n");
1742 if (!PyArg_ParseTuple(args,
"O!:BMEdge.calc_face_tangent", &
BPy_BMLoop_Type, &py_loop)) {
1754 bpy_bmedge_other_vert_doc,
1755 ".. method:: other_vert(vert)\n"
1757 " Return the other vertex on this edge or None if the vertex is not used by this edge.\n"
1759 " :arg vert: a vert in this edge.\n"
1760 " :type vert: :class:`BMVert`\n"
1761 " :return: The edges other vert.\n"
1762 " :rtype: :class:`BMVert` or None\n");
1769 PyErr_Format(PyExc_TypeError,
1770 "BMEdge.other_vert(vert): BMVert expected, not '%.200s'",
1771 Py_TYPE(value)->tp_name);
1788 bpy_bmedge_normal_update_doc,
1789 ".. method:: normal_update()\n"
1791 " Update normals of all connected faces and the edge verts.\n"
1795 " The normal of edge vertex will be a zero vector if vertex :attr:`is_wire` is True.\n");
1809 bpy_bmface_copy_from_face_interp_doc,
1810 ".. method:: copy_from_face_interp(face, vert=True)\n"
1812 " Interpolate the customdata from another face onto this one (faces should overlap).\n"
1814 " :arg face: The face to interpolate data from.\n"
1815 " :type face: :class:`BMFace`\n"
1816 " :arg vert: When True, also copy vertex data.\n"
1817 " :type vert: boolean\n");
1821 bool do_vertex =
true;
1825 if (!PyArg_ParseTuple(args,
1826 "O!|O&:BMFace.copy_from_face_interp",
1844 ".. method:: copy(verts=True, edges=True)\n"
1846 " Make a copy of this face.\n"
1848 " :arg verts: When set, the faces verts will be duplicated too.\n"
1849 " :type verts: boolean\n"
1850 " :arg edges: When set, the faces edges will be duplicated too.\n"
1851 " :type edges: boolean\n"
1852 " :return: The newly created face.\n"
1853 " :rtype: :class:`BMFace`\n");
1856 static const char *kwlist[] = {
"verts",
"edges",
NULL};
1859 bool do_verts =
true;
1860 bool do_edges =
true;
1865 if (!PyArg_ParseTupleAndKeywords(args,
1867 "|$O&O&:BMFace.copy",
1882 PyErr_SetString(PyExc_ValueError,
"BMFace.copy(): couldn't create the new face, internal error");
1887 ".. method:: calc_area()\n"
1889 " Return the area of the face.\n"
1891 " :return: Return the area of the face.\n"
1892 " :rtype: float\n");
1900 ".. method:: calc_perimeter()\n"
1902 " Return the perimeter of the face.\n"
1904 " :return: Return the perimeter of the face.\n"
1905 " :rtype: float\n");
1913 ".. method:: calc_tangent_edge()\n"
1915 " Return face tangent based on longest edge.\n"
1917 " :return: a normalized vector.\n"
1918 " :rtype: :class:`mathutils.Vector`\n");
1929 ".. method:: calc_tangent_edge_pair()\n"
1931 " Return face tangent based on the two longest disconnected edges.\n"
1933 " - Tris: Use the edge pair with the most similar lengths.\n"
1934 " - Quads: Use the longest edge pair.\n"
1935 " - NGons: Use the two longest disconnected edges.\n"
1937 " :return: a normalized vector.\n"
1938 " :rtype: :class:`mathutils.Vector`\n");
1949 ".. method:: calc_tangent_edge_diagonal()\n"
1951 " Return face tangent based on the edge farthest from any vertex.\n"
1953 " :return: a normalized vector.\n"
1954 " :rtype: :class:`mathutils.Vector`\n");
1965 ".. method:: calc_tangent_vert_diagonal()\n"
1967 " Return face tangent based on the two most distant vertices.\n"
1969 " :return: a normalized vector.\n"
1970 " :rtype: :class:`mathutils.Vector`\n");
1981 ".. method:: calc_center_median()\n"
1983 " Return median center of the face.\n"
1985 " :return: a 3D vector.\n"
1986 " :rtype: :class:`mathutils.Vector`\n");
1997 ".. method:: calc_center_median_weighted()\n"
1999 " Return median center of the face weighted by edge lengths.\n"
2001 " :return: a 3D vector.\n"
2002 " :rtype: :class:`mathutils.Vector`\n");
2013 ".. method:: calc_center_bounds()\n"
2015 " Return bounds center of the face.\n"
2017 " :return: a 3D vector.\n"
2018 " :rtype: :class:`mathutils.Vector`\n");
2029 ".. method:: normal_update()\n"
2031 " Update face normal based on the positions of the face verts.\n"
2032 " This does not update the normals of face verts.\n");
2043 ".. method:: normal_flip()\n"
2045 " Reverses winding of a face, which flips its normal.\n");
2059 ".. method:: copy_from_face_interp(face, vert=True, multires=True)\n"
2061 " Interpolate the customdata from a face onto this loop (the loops vert should "
2062 "overlap the face).\n"
2064 " :arg face: The face to interpolate data from.\n"
2065 " :type face: :class:`BMFace`\n"
2066 " :arg vert: When enabled, interpolate the loops vertex data (optional).\n"
2067 " :type vert: boolean\n"
2068 " :arg multires: When enabled, interpolate the loops multires data (optional).\n"
2069 " :type multires: boolean\n");
2073 bool do_vertex =
true;
2074 bool do_multires =
true;
2078 if (!PyArg_ParseTuple(args,
2079 "O!|O&O&:BMLoop.copy_from_face_interp",
2099 ".. method:: calc_angle()\n"
2101 " Return the angle at this loops corner of the face.\n"
2102 " This is calculated so sharper corners give lower angles.\n"
2104 " :return: The angle in radians.\n"
2105 " :rtype: float\n");
2113 ".. method:: calc_normal()\n"
2115 " Return normal at this loops corner of the face.\n"
2116 " Falls back to the face normal for straight lines.\n"
2118 " :return: a normalized vector.\n"
2119 " :rtype: :class:`mathutils.Vector`\n");
2129 bpy_bmloop_calc_tangent_doc,
2130 ".. method:: calc_tangent()\n"
2132 " Return the tangent at this loops corner of the face (pointing inward into the face).\n"
2133 " Falls back to the face normal for straight lines.\n"
2135 " :return: a normalized vector.\n"
2136 " :rtype: :class:`mathutils.Vector`\n");
2148 ".. method:: new(co=(0.0, 0.0, 0.0), example=None)\n"
2150 " Create a new vertex.\n"
2152 " :arg co: The initial location of the vertex (optional argument).\n"
2153 " :type co: float triplet\n"
2154 " :arg example: Existing vert to initialize settings.\n"
2155 " :type example: :class:`BMVert`\n"
2156 " :return: The newly created edge.\n"
2157 " :rtype: :class:`BMVert`\n");
2160 PyObject *py_co =
NULL;
2165 if (!PyArg_ParseTuple(args,
"|OO!:verts.new", &py_co, &
BPy_BMVert_Type, &py_vert_example)) {
2171 float co[3] = {0.0f, 0.0f, 0.0f};
2173 if (py_vert_example) {
2184 PyErr_SetString(PyExc_ValueError,
2185 "faces.new(verts): couldn't create the new face, internal error");
2189 if (py_vert_example) {
2199 ".. method:: new(verts, example=None)\n"
2201 " Create a new edge from a given pair of verts.\n"
2203 " :arg verts: Vertex pair.\n"
2204 " :type verts: pair of :class:`BMVert`\n"
2205 " :arg example: Existing edge to initialize settings (optional argument).\n"
2206 " :type example: :class:`BMEdge`\n"
2207 " :return: The newly created edge.\n"
2208 " :rtype: :class:`BMEdge`\n");
2216 if (!PyArg_ParseTuple(args,
"O|O!:edges.new", &vert_seq, &
BPy_BMEdge_Type, &py_edge_example)) {
2223 Py_ssize_t vert_seq_len;
2226 if (py_edge_example) {
2231 &
bm, vert_seq, 2, 2, &vert_seq_len,
BM_VERT,
true,
true,
"edges.new(...)");
2233 if (vert_array ==
NULL) {
2238 PyErr_SetString(PyExc_ValueError,
"edges.new(): this edge exists");
2245 PyErr_SetString(PyExc_ValueError,
2246 "faces.new(verts): couldn't create the new face, internal error");
2250 if (py_edge_example) {
2258 PyMem_FREE(vert_array);
2266 ".. method:: new(verts, example=None)\n"
2268 " Create a new face from a given set of verts.\n"
2270 " :arg verts: Sequence of 3 or more verts.\n"
2271 " :type verts: :class:`BMVert`\n"
2272 " :arg example: Existing face to initialize settings (optional argument).\n"
2273 " :type example: :class:`BMFace`\n"
2274 " :return: The newly created face.\n"
2275 " :rtype: :class:`BMFace`\n");
2283 if (!PyArg_ParseTuple(args,
"O|O!:faces.new", &vert_seq, &
BPy_BMFace_Type, &py_face_example)) {
2288 Py_ssize_t vert_seq_len;
2296 if (py_face_example) {
2301 &
bm, vert_seq, 3, PY_SSIZE_T_MAX, &vert_seq_len,
BM_VERT,
true,
true,
"faces.new(...)");
2303 if (vert_array ==
NULL) {
2309 PyErr_SetString(PyExc_ValueError,
"faces.new(verts): face already exists");
2319 py_face_example ? py_face_example->
f :
NULL,
2324 PyErr_SetString(PyExc_ValueError,
2325 "faces.new(verts): couldn't create the new face, internal error");
2334 PyMem_FREE(vert_array);
2343 ".. method:: remove(vert)\n"
2345 " Remove a vert.\n");
2365 ".. method:: remove(edge)\n"
2367 " Remove an edge.\n");
2387 ".. method:: remove(face)\n"
2389 " Remove a face.\n");
2409 ".. method:: get(verts, fallback=None)\n"
2411 " Return an edge which uses the **verts** passed.\n"
2413 " :arg verts: Sequence of verts.\n"
2414 " :type verts: :class:`BMVert`\n"
2415 " :arg fallback: Return this value if nothing is found.\n"
2416 " :return: The edge found or None\n"
2417 " :rtype: :class:`BMEdge`\n");
2421 PyObject *fallback = Py_None;
2425 if (!PyArg_ParseTuple(args,
"O|O:edges.get", &vert_seq, &fallback)) {
2432 Py_ssize_t vert_seq_len;
2436 &
bm, vert_seq, 2, 2, &vert_seq_len,
BM_VERT,
true,
true,
"edges.get(...)");
2438 if (vert_array ==
NULL) {
2450 PyMem_FREE(vert_array);
2455 ".. method:: get(verts, fallback=None)\n"
2457 " Return a face which uses the **verts** passed.\n"
2459 " :arg verts: Sequence of verts.\n"
2460 " :type verts: :class:`BMVert`\n"
2461 " :arg fallback: Return this value if nothing is found.\n"
2462 " :return: The face found or None\n"
2463 " :rtype: :class:`BMFace`\n");
2467 PyObject *fallback = Py_None;
2471 if (!PyArg_ParseTuple(args,
"O|O:faces.get", &vert_seq, &fallback)) {
2478 Py_ssize_t vert_seq_len;
2482 &
bm, vert_seq, 1, PY_SSIZE_T_MAX, &vert_seq_len,
BM_VERT,
true,
true,
"faces.get(...)");
2484 if (vert_array ==
NULL) {
2497 PyMem_FREE(vert_array);
2502 bpy_bmelemseq_index_update_doc,
2503 ".. method:: index_update()\n"
2505 " Initialize the index values of this sequence.\n"
2507 " This is the equivalent of looping over all elements and assigning the index values.\n"
2509 " .. code-block:: python\n"
2511 " for index, ele in enumerate(sequence):\n"
2512 " ele.index = index\n"
2516 " Running this on sequences besides :class:`BMesh.verts`, :class:`BMesh.edges`, "
2517 ":class:`BMesh.faces`\n"
2518 " works but won't result in each element having a valid index, instead its order in the "
2519 "sequence will be set.\n");
2559 ".. method:: ensure_lookup_table()\n"
2561 " Ensure internal data needed for int subscription is initialized with "
2562 "verts/edges/faces, eg ``bm.verts[index]``.\n"
2564 " This needs to be called again after adding/removing data in this sequence.");
2575 bpy_bmelemseq_sort_doc,
2576 ".. method:: sort(key=None, reverse=False)\n"
2578 " Sort the elements of this sequence, using an optional custom sort key.\n"
2579 " Indices of elements are not changed, BMElemeSeq.index_update() can be used for that.\n"
2581 " :arg key: The key that sets the ordering of the elements.\n"
2582 " :type key: :function: returning a number\n"
2583 " :arg reverse: Reverse the order of the elements\n"
2584 " :type reverse: :boolean:\n"
2588 " When the 'key' argument is not provided, the elements are reordered following their "
2589 "current index value.\n"
2590 " In particular this can be used by setting indices manually before calling this "
2595 " Existing references to the N'th element, will continue to point the data at that "
2611 const void *index2_v,
2614 const double *keys = keys_v;
2615 const int *index1 = (
int *)index1_v;
2616 const int *index2 = (
int *)index2_v;
2618 if (keys[*index1] < keys[*index2]) {
2621 if (keys[*index1] > keys[*index2]) {
2629 const void *index2_v,
2637 static const char *kwlist[] = {
"key",
"reverse",
NULL};
2638 PyObject *keyfunc =
NULL;
2639 bool do_reverse =
false;
2650 int (*elem_idx_compare_by_keys)(
const void *,
const void *,
void *);
2662 if (!PyArg_ParseTupleAndKeywords(args,
2664 "|$OO&:BMElemSeq.sort",
2673 if (keyfunc !=
NULL && !PyCallable_Check(keyfunc)) {
2674 PyErr_SetString(PyExc_TypeError,
"the 'key' argument is not a callable object");
2684 keys = PyMem_MALLOC(
sizeof(*keys) * n_elem);
2692 if (keyfunc !=
NULL) {
2697 index = PyObject_CallFunctionObjArgs(keyfunc, py_elem,
NULL);
2699 if (index ==
NULL) {
2706 if ((keys[i] = PyFloat_AsDouble(index)) == -1 && PyErr_Occurred()) {
2707 PyErr_SetString(PyExc_ValueError,
2708 "the value returned by the 'key' function is not a number");
2725 elem_idx = PyMem_MALLOC(
sizeof(*elem_idx) * n_elem);
2726 if (elem_idx ==
NULL) {
2743 BLI_qsort_r(elem_idx, n_elem,
sizeof(*elem_idx), elem_idx_compare_by_keys, keys);
2745 elem_map_idx = PyMem_MALLOC(
sizeof(*elem_map_idx) * n_elem);
2746 if (elem_map_idx ==
NULL) {
2748 PyMem_FREE(elem_idx);
2758 for (i = 0; i < n_elem; i++) {
2759 elem_map_idx[elem_idx[i]] = i;
2764 vert_idx = elem_map_idx;
2767 edge_idx = elem_map_idx;
2770 face_idx = elem_map_idx;
2773 PyErr_Format(PyExc_TypeError,
"element type %d not supported",
self->itype);
2774 PyMem_FREE(elem_map_idx);
2775 PyMem_FREE(elem_idx);
2782 PyMem_FREE(elem_map_idx);
2783 PyMem_FREE(elem_idx);
2791 {
"copy", (PyCFunction)
bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
2792 {
"clear", (PyCFunction)
bpy_bmesh_clear, METH_NOARGS, bpy_bmesh_clear_doc},
2793 {
"free", (PyCFunction)
bpy_bmesh_free, METH_NOARGS, bpy_bmesh_free_doc},
2798 METH_VARARGS | METH_KEYWORDS,
2799 bpy_bmesh_from_object_doc},
2802 METH_VARARGS | METH_KEYWORDS,
2803 bpy_bmesh_from_mesh_doc},
2804 {
"to_mesh", (PyCFunction)
bpy_bmesh_to_mesh, METH_VARARGS, bpy_bmesh_to_mesh_doc},
2807 {
"select_flush_mode",
2810 bpy_bmesh_select_flush_mode_doc},
2815 bpy_bmesh_normal_update_doc},
2818 METH_VARARGS | METH_KEYWORDS,
2819 bpy_bmesh_transform_doc},
2824 METH_VARARGS | METH_KEYWORDS,
2825 bpy_bmesh_calc_volume_doc},
2826 {
"calc_loop_triangles",
2829 bpy_bmesh_calc_loop_triangles_doc},
2837 {
"copy_from_face_interp",
2840 bpy_bmvert_copy_from_face_interp_doc},
2841 {
"copy_from_vert_interp",
2844 bpy_bmvert_copy_from_vert_interp_doc},
2849 bpy_bmvert_calc_edge_angle_doc},
2850 {
"calc_shell_factor",
2853 bpy_bmvert_calc_shell_factor_doc},
2858 bpy_bmvert_normal_update_doc},
2874 bpy_bmedge_calc_face_angle_doc},
2875 {
"calc_face_angle_signed",
2878 bpy_bmedge_calc_face_angle_signed_doc},
2882 bpy_bmedge_calc_tangent_doc},
2887 bpy_bmedge_normal_update_doc},
2897 {
"copy_from_face_interp",
2900 bpy_bmface_copy_from_face_interp_doc},
2902 {
"copy", (PyCFunction)
bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc},
2908 bpy_bmface_calc_perimeter_doc},
2909 {
"calc_tangent_edge",
2912 bpy_bmface_calc_tangent_edge_doc},
2913 {
"calc_tangent_edge_pair",
2916 bpy_bmface_calc_tangent_edge_pair_doc},
2917 {
"calc_tangent_edge_diagonal",
2920 bpy_bmface_calc_tangent_edge_diagonal_doc},
2921 {
"calc_tangent_vert_diagonal",
2924 bpy_bmface_calc_tangent_vert_diagonal_doc},
2925 {
"calc_center_median",
2928 bpy_bmface_calc_center_median_doc},
2929 {
"calc_center_median_weighted",
2932 bpy_bmface_calc_center_median_weighted_doc},
2933 {
"calc_center_bounds",
2936 bpy_bmface_calc_center_bounds_doc},
2941 bpy_bmface_normal_update_doc},
2949 {
"copy_from_face_interp",
2952 bpy_bmloop_copy_from_face_interp_doc},
2959 bpy_bmloop_calc_tangent_doc},
2968 bpy_bmelemseq_index_update_doc},
2980 bpy_bmelemseq_index_update_doc},
2981 {
"ensure_lookup_table",
2984 bpy_bmelemseq_ensure_lookup_table_doc},
2987 METH_VARARGS | METH_KEYWORDS,
2988 bpy_bmelemseq_sort_doc},
3002 bpy_bmelemseq_index_update_doc},
3003 {
"ensure_lookup_table",
3006 bpy_bmelemseq_ensure_lookup_table_doc},
3009 METH_VARARGS | METH_KEYWORDS,
3010 bpy_bmelemseq_sort_doc},
3024 bpy_bmelemseq_index_update_doc},
3025 {
"ensure_lookup_table",
3028 bpy_bmelemseq_ensure_lookup_table_doc},
3031 METH_VARARGS | METH_KEYWORDS,
3032 bpy_bmelemseq_sort_doc},
3087 return self->bm->totvert;
3089 return self->bm->totedge;
3091 return self->bm->totface;
3133 switch (
self->itype) {
3156 PyErr_SetString(PyExc_IndexError,
3157 "BMElemSeq[index]: outdated internal index table, "
3158 "run ensure_lookup_table() first");
3171 PyErr_Format(PyExc_IndexError,
"BMElemSeq[index]: index %d out of range", keynum);
3188 list = PyList_New(0);
3199 for (ok =
true; ok; ok = (BM_iter_step(&iter) !=
NULL)) {
3200 if (
count == start) {
3207 while ((ele = BM_iter_step(&iter))) {
3211 if (
count == stop) {
3222 if (PyIndex_Check(key)) {
3223 const Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
3224 if (i == -1 && PyErr_Occurred()) {
3229 if (PySlice_Check(key)) {
3230 PySliceObject *key_slice = (PySliceObject *)key;
3231 Py_ssize_t step = 1;
3233 if (key_slice->step != Py_None && !_PyEval_SliceIndex(key, &step)) {
3237 PyErr_SetString(PyExc_TypeError,
"BMElemSeq[slice]: slice steps not supported");
3240 if (key_slice->start == Py_None && key_slice->stop == Py_None) {
3244 Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
3247 if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) {
3250 if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) {
3254 if (start < 0 || stop < 0) {
3267 if (stop - start <= 0) {
3268 return PyList_New(0);
3274 PyErr_SetString(PyExc_AttributeError,
"BMElemSeq[key]: invalid key, key must be an int");
3284 if (value_bm_ele->
bm ==
self->bm) {
3285 BMElem *ele, *ele_test = value_bm_ele->
ele;
3288 if (ele == ele_test) {
3322 (ssizeobjargproc)
NULL,
3332 (objobjargproc)
NULL,
3353 return (PyObject *)py_iter;
3360 PyErr_SetNone(PyExc_StopIteration);
3451 Py_XDECREF(
self->py_ele);
3459 return _Py_HashPointer(((
BPy_BMElem *)
self)->ele);
3475 "This is normally accessed from :class:`BMFace.loops` where each face loop "
3476 "represents a corner of the face.\n");
3478 "General sequence type used for accessing any sequence of\n"
3479 ":class:`BMVert`, :class:`BMEdge`, :class:`BMFace`, :class:`BMLoop`.\n"
3481 "When accessed via :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces`\n"
3482 "there are also functions to create/remove items.\n");
3484 "Internal BMesh type for looping over verts/faces/edges,\n"
3485 "used for iterating over :class:`BMElemSeq` types.\n");
3492 return PyUnicode_FromFormat(
"<BMesh(%p), totvert=%d, totedge=%d, totface=%d, totloop=%d>",
3500 return PyUnicode_FromFormat(
"<BMesh dead at %p>",
self);
3512 return PyUnicode_FromFormat(
"<BMVert dead at %p>",
self);
3521 return PyUnicode_FromFormat(
"<BMEdge(%p), index=%d, verts=(%p/%d, %p/%d)>",
3530 return PyUnicode_FromFormat(
"<BMEdge dead at %p>",
self);
3539 return PyUnicode_FromFormat(
3543 return PyUnicode_FromFormat(
"<BMFace dead at %p>",
self);
3552 return PyUnicode_FromFormat(
"<BMLoop(%p), index=%d, vert=%p/%d, edge=%p/%d, face=%p/%d>",
3563 return PyUnicode_FromFormat(
"<BMLoop dead at %p>",
self);
3738 PyModuleDef_HEAD_INIT,
3751 PyObject *submodule;
3811 return (PyObject *)
self;
3837 return (PyObject *)
self;
3863 return (PyObject *)
self;
3889 return (PyObject *)
self;
3915 return (PyObject *)
self;
3922 self->py_ele = py_ele;
3923 self->itype =
itype;
3925 return (PyObject *)
self;
3932 self->py_ele =
NULL;
3934 return (PyObject *)
self;
3941 self->py_ele =
NULL;
3943 return (PyObject *)
self;
3950 self->py_ele =
NULL;
3952 return (PyObject *)
self;
3959 self->py_ele =
NULL;
3961 return (PyObject *)
self;
3969 return (PyObject *)
self;
3974 switch (ele->
htype) {
3985 PyErr_SetString(PyExc_SystemError,
"internal error");
4002 PyExc_ReferenceError,
"BMesh used by %.200s has become invalid", Py_TYPE(
self)->tp_name);
4011 PyExc_ReferenceError,
"BMesh data of type %.200s has been removed", Py_TYPE(
self)->tp_name);
4016 const char *error_prefix,
4022 while (args_tot--) {
4035 PyErr_Format(PyExc_ValueError,
4036 "%.200s: BMesh data of type %.200s is from another mesh",
4038 Py_TYPE(py_bm_elem)->tp_name);
4059 const bool do_unique_check,
4060 const bool do_bm_check,
4061 const char *error_prefix)
4064 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
4065 const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast);
4066 Py_ssize_t i, i_last_dirty = PY_SSIZE_T_MAX;
4073 if (seq_len < min || seq_len >
max) {
4074 PyErr_Format(PyExc_TypeError,
4075 "%s: sequence incorrect size, expected [%d - %d], given %d",
4084 alloc = PyMem_MALLOC(seq_len *
sizeof(
BPy_BMElem **));
4086 for (i = 0; i < seq_len; i++) {
4090 PyErr_Format(PyExc_TypeError,
4091 "%s: expected %.200s, not '%.200s'",
4094 Py_TYPE(item)->tp_name);
4099 PyExc_TypeError,
"%s: %d %s has been removed", error_prefix, i, Py_TYPE(item)->tp_name);
4104 else if (do_bm_check && (
bm &&
bm != item->
bm)) {
4105 PyErr_Format(PyExc_ValueError,
4106 "%s: %d %s is from another mesh",
4117 alloc[i] = item->
ele;
4119 if (do_unique_check) {
4125 if (do_unique_check) {
4128 for (i = 0; i < seq_len; i++) {
4139 i_last_dirty = PY_SSIZE_T_MAX;
4140 PyErr_Format(PyExc_ValueError,
4141 "%s: found the same %.200s used multiple times",
4155 if (do_unique_check && (i_last_dirty != PY_SSIZE_T_MAX)) {
4156 for (i = 0; i <= i_last_dirty; i++) {
4170 const bool do_unique_check,
4171 const bool do_bm_check,
4172 const char *error_prefix)
4177 if (!(seq_fast = PySequence_Fast(seq, error_prefix))) {
4182 r_bm, seq_fast,
min,
max, r_size, htype, do_unique_check, do_bm_check, error_prefix);
4184 Py_DECREF(seq_fast);
4191 PyObject *
ret = PyTuple_New(elem_len);
4192 for (i = 0; i < elem_len; i++) {
4200 PyObject *
ret = PyTuple_New(elem_len);
4201 for (i = 0; i < elem_len; i++) {
4209 PyObject *
ret = PyTuple_New(elem_len);
4210 for (i = 0; i < elem_len; i++) {
4219 PyObject *
ret = PyTuple_New(elem_len);
4220 for (i = 0; i < elem_len; i++) {
4229 PyObject *
ret = PyTuple_New(elem_len);
4230 for (i = 0; i < elem_len; i++) {
4248 char *ret_ptr =
ret;
4269 static char ret[32];
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer(const struct CustomData *data, int type)
const CustomData_MeshMasks CD_MASK_BMESH
void * CustomData_bmesh_get(const struct CustomData *data, void *block, int type)
void BKE_id_free(struct Main *bmain, void *idv)
bool BKE_id_is_in_global_main(struct ID *id)
struct Mesh * BKE_mesh_new_from_object(struct Depsgraph *depsgraph, struct Object *object, bool preserve_all_data_layers, bool preserve_origindex)
struct Mesh * mesh_get_eval_deform(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
#define BLI_assert_unreachable()
MINLINE float clamp_f(float value, float min, float max)
MINLINE int poly_to_tri_count(int poly_count, int corner_count)
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void range_vn_i(int *array_tar, int size, int start)
void BLI_qsort_r(void *a, size_t n, size_t es, BLI_sort_cmp_t cmp, void *thunk)
#define POINTER_AS_INT(i)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ ID_RECALC_GEOMETRY_ALL_MODES
#define CD_MASK_BM_ELEM_PYPTR
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void BM_elem_attrs_copy_ex(BMesh *bm_src, BMesh *bm_dst, const void *ele_src_v, void *ele_dst_v, const char hflag_mask, const uint64_t cd_mask_exclude)
void BM_elem_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const void *ele_src, void *ele_dst)
BMesh * BM_mesh_copy(BMesh *bm_old)
BMVert * BM_vert_create(BMesh *bm, const float co[3], const BMVert *v_example, const eBMCreateFlag create_flag)
Main function for creating a new vertex.
BMFace * BM_face_create_verts(BMesh *bm, BMVert **vert_arr, const int len, const BMFace *f_example, const eBMCreateFlag create_flag, const bool create_edges)
void BM_vert_kill(BMesh *bm, BMVert *v)
void BM_face_kill(BMesh *bm, BMFace *f)
void BM_edge_kill(BMesh *bm, BMEdge *e)
BMFace * BM_face_copy(BMesh *bm_dst, BMesh *bm_src, BMFace *f, const bool copy_verts, const bool copy_edges)
BMEdge * BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *e_example, const eBMCreateFlag create_flag)
Main function for creating a new edge.
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_index_set(ele, index)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
void BM_data_layer_free(BMesh *bm, CustomData *data, int type)
void BM_vert_interp_from_face(BMesh *bm, BMVert *v_dst, const BMFace *f_src)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
void BM_face_interp_from_face(BMesh *bm, BMFace *f_dst, const BMFace *f_src, const bool do_vertex)
void BM_loop_interp_from_face(BMesh *bm, BMLoop *l_dst, const BMFace *f_src, const bool do_vertex, const bool do_multires)
void BM_data_interp_from_verts(BMesh *bm, const BMVert *v_src_1, const BMVert *v_src_2, BMVert *v_dst, const float fac)
Data, Interpolate From Verts.
const char bm_iter_itype_htype_map[BM_ITYPE_MAX]
void * BM_iter_at_index(BMesh *bm, const char itype, void *data, int index)
#define BM_ITER_MESH(ele, iter, bm, itype)
BMIterType
BMesh Iterators.
BLI_INLINE bool BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data)
Iterator Init.
ATTR_WARN_UNUSED_RESULT BMesh const char itype
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_select_mode_flush(BMesh *bm)
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
void BM_mesh_select_flush(BMesh *bm)
void BM_mesh_deselect_flush(BMesh *bm)
#define BM_elem_hide_set(bm, ele, hide)
void BM_mesh_remap(BMesh *bm, const uint *vert_idx, const uint *edge_idx, const uint *face_idx)
void BM_mesh_clear(BMesh *bm)
BMesh Clear Mesh.
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
int BM_mesh_elem_count(BMesh *bm, const char htype)
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *me, const struct BMeshFromMeshParams *params)
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMeshParams *params)
void BM_mesh_normals_update(BMesh *bm)
void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3])
bool BM_mesh_validate(BMesh *bm)
void BM_face_calc_tangent_edge_pair(const BMFace *f, float r_tangent[3])
void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3])
void BM_vert_normal_update(BMVert *v)
void BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_tangent[3])
void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_tangent[3])
void BM_face_normal_update(BMFace *f)
void BM_face_normal_flip(BMesh *bm, BMFace *f)
void BM_face_calc_tangent_edge(const BMFace *f, float r_tangent[3])
float BM_face_calc_area(const BMFace *f)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
void BM_face_calc_center_median_weighted(const BMFace *f, float r_cent[3])
float BM_face_calc_perimeter(const BMFace *f)
void BM_edge_normals_update(BMEdge *e)
static Py_hash_t bpy_bm_hash(PyObject *self)
static PyObject * bpy_bmesh_select_flush(BPy_BMesh *self, PyObject *value)
static void bpy_bmvert_dealloc(BPy_BMElem *self)
static PyObject * bpy_bmedge_is_contiguous_get(BPy_BMEdge *self)
static PyObject * bpy_bmedge_is_wire_get(BPy_BMEdge *self)
static Py_hash_t bpy_bm_elem_hash(PyObject *self)
PyC_FlagSet bpy_bm_htype_all_flags[]
static PyMappingMethods bpy_bmelemseq_as_mapping
static PyObject * bpy_bmesh_copy(BPy_BMesh *self)
static PyObject * bpy_bmesh_select_history_get(BPy_BMesh *self)
static PyObject * bpy_bmfaceseq_get__method(BPy_BMElemSeq *self, PyObject *args)
static PyObject * bpy_bmloop_calc_angle(BPy_BMLoop *self)
PyObject * BPy_BMIter_CreatePyObject(BMesh *bm)
static PyObject * bpy_bmface_repr(BPy_BMFace *self)
static PyObject * bpy_bmvert_normal_update(BPy_BMVert *self)
static PyObject * bpy_bmloopseq_get(BPy_BMesh *self, void *UNUSED(closure))
static PyGetSetDef bpy_bmvertseq_getseters[]
static PyObject * bpy_bmloop_link_loop_radial_next_get(BPy_BMLoop *self)
static PyObject * bpy_bmvertseq_get(BPy_BMesh *self, void *UNUSED(closure))
static PyObject * bpy_bmvert_copy_from_vert_interp(BPy_BMVert *self, PyObject *args)
static PyObject * bpy_bmvertseq_new(BPy_BMElemSeq *self, PyObject *args)
static PyGetSetDef bpy_bmloopseq_getseters[]
PyObject * BPy_BMEdge_Array_As_Tuple(BMesh *bm, BMEdge **elem, Py_ssize_t elem_len)
static PyObject * bpy_bm_elem_copy_from(BPy_BMElem *self, BPy_BMElem *value)
static PyObject * bpy_bmedge_repr(BPy_BMEdge *self)
PyTypeObject BPy_BMesh_Type
PyObject * BPy_BMEdge_CreatePyObject(BMesh *bm, BMEdge *e)
static PyObject * bpy_bmface_calc_perimeter(BPy_BMFace *self)
static PyObject * bpy_bmelemseq_layers_get(BPy_BMElemSeq *self, void *htype)
static PyObject * bpy_bmedge_calc_face_angle(BPy_BMEdge *self, PyObject *args)
PyC_FlagSet bpy_bm_htype_vert_edge_face_flags[]
PyObject * BPy_BMLoop_CreatePyObject(BMesh *bm, BMLoop *l)
PyObject * BPy_BMFace_Array_As_Tuple(BMesh *bm, BMFace **elem, Py_ssize_t elem_len)
PyObject * BPy_BMVert_Array_As_Tuple(BMesh *bm, BMVert **elem, Py_ssize_t elem_len)
static PyObject * bpy_bm_elem_hide_set(BPy_BMElem *self, PyObject *value)
static PyObject * bpy_bmface_calc_tangent_edge_pair(BPy_BMFace *self)
static PyMappingMethods bpy_bm_elem_as_mapping
static PyObject * bpy_bmiter_next(BPy_BMIter *self)
static PyObject * bpy_bmface_calc_center_mean(BPy_BMFace *self)
PyObject * BPyInit_bmesh_types(void)
PyObject * BPy_BMElem_CreatePyObject(BMesh *bm, BMHeader *ele)
static PyObject * bpy_bm_elem_index_get(BPy_BMElem *self, void *UNUSED(flag))
static PyObject * bpy_bm_elem_hflag_get(BPy_BMElem *self, void *flag)
void BPy_BM_init_types(void)
static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyObject *value)
static PyObject * bpy_bmelemseq_elem_get(BPy_BMElem *self, void *itype)
static struct PyMethodDef bpy_bmedge_methods[]
void * BPy_BMElem_PySeq_As_Array_FAST(BMesh **r_bm, PyObject *seq_fast, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_size, const char htype, const bool do_unique_check, const bool do_bm_check, const char *error_prefix)
static PyObject * bpy_bmface_copy(BPy_BMFace *self, PyObject *args, PyObject *kw)
static void bm_dealloc_editmode_warn(BPy_BMesh *self)
PyTypeObject BPy_BMVertSeq_Type
PyTypeObject BPy_BMLoopSeq_Type
static PyObject * bpy_bmface_calc_center_bounds(BPy_BMFace *self)
static void bpy_bmedge_dealloc(BPy_BMElem *self)
static PyObject * bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmvert_repr(BPy_BMVert *self)
static PyGetSetDef bpy_bmvert_getseters[]
static PyObject * bpy_bmedgeseq_get__method(BPy_BMElemSeq *self, PyObject *args)
static PyObject * bpy_bmfaceseq_remove(BPy_BMElemSeq *self, BPy_BMFace *value)
static PyObject * bpy_bmface_copy_from_face_interp(BPy_BMFace *self, PyObject *args)
static void bpy_bmloop_dealloc(BPy_BMElem *self)
static PyObject * bpy_bmesh_is_wrapped_get(BPy_BMesh *self)
static Py_ssize_t bpy_bmelemseq_length(BPy_BMElemSeq *self)
static PyObject * bpy_bmedge_normal_update(BPy_BMEdge *self)
PyObject * BPy_BMLoopSeq_CreatePyObject(BMesh *bm)
static struct PyMethodDef bpy_bmface_methods[]
static PyObject * bpy_bmedge_other_vert(BPy_BMEdge *self, BPy_BMVert *value)
static PyGetSetDef bpy_bmesh_getseters[]
PyObject * BPy_BMFace_CreatePyObject(BMesh *bm, BMFace *f)
static PyObject * bpy_bmelemseq_subscript_slice(BPy_BMElemSeq *self, Py_ssize_t start, Py_ssize_t stop)
void bpy_bm_generic_invalidate(BPy_BMGeneric *self)
static PyObject * bpy_bmloop_link_loop_next_get(BPy_BMLoop *self)
static PyObject * bpy_bmloop_face_get(BPy_BMLoop *self)
static PyObject * bpy_bmelemseq_ensure_lookup_table(BPy_BMElemSeq *self)
static int bpy_bmvert_co_set(BPy_BMVert *self, PyObject *value)
char * BPy_BMElem_StringFromHType_ex(const char htype, char ret[32])
static PyObject * bpy_bmelemseq_subscript(BPy_BMElemSeq *self, PyObject *key)
static PyObject * bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args)
static PyObject * bpy_bmesh_select_flush_mode(BPy_BMesh *self)
static PyTypeObject * bpy_bm_itype_as_pytype(const char itype)
PyTypeObject BPy_BMEdgeSeq_Type
static PyObject * bpy_bmedge_is_convex_get(BPy_BMEdge *self)
static PyObject * bpy_bmelem_subscript(BPy_BMElem *self, BPy_BMLayerItem *key)
PyTypeObject BPy_BMEdge_Type
static PyObject * bpy_bmface_calc_tangent_edge_diagonal(BPy_BMFace *self)
static PyObject * bpy_bmloop_repr(BPy_BMLoop *self)
static PyObject * bpy_bmedgeseq_get(BPy_BMesh *self, void *UNUSED(closure))
static int bpy_bmfaceseq_active_set(BPy_BMElem *self, PyObject *value, void *UNUSED(closure))
static PyObject * bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmesh_normal_update(BPy_BMesh *self)
static PyGetSetDef bpy_bmfaceseq_getseters[]
static PyObject * bpy_bmedge_calc_length(BPy_BMEdge *self)
static PyObject * bpy_bmloop_link_loop_prev_get(BPy_BMLoop *self)
static PyGetSetDef bpy_bmedge_getseters[]
static PyObject * bpy_bmedge_calc_face_angle_signed(BPy_BMEdge *self, PyObject *args)
static PyObject * bpy_bmface_calc_area(BPy_BMFace *self)
static PyObject * bpy_bmedgeseq_new(BPy_BMElemSeq *self, PyObject *args)
static PyObject * bpy_bmfaceseq_active_get(BPy_BMElemSeq *self, void *UNUSED(closure))
PyObject * BPy_BMFaceSeq_CreatePyObject(BMesh *bm)
static PyObject * bpy_bmesh_calc_volume(BPy_BMElem *self, PyObject *args, PyObject *kw)
static struct PyMethodDef bpy_bmvertseq_methods[]
static int bpy_bmesh_select_mode_set(BPy_BMesh *self, PyObject *value)
static struct PyMethodDef bpy_bmloopseq_methods[]
static int bpy_bmelemseq_sort_cmp_by_keys_descending(const void *index1_v, const void *index2_v, void *keys_v)
int bpy_bm_generic_valid_check_source(BMesh *bm_source, const char *error_prefix, void **args, uint args_tot)
static PyObject * bpy_bmloop_calc_normal(BPy_BMLoop *self)
static PyObject * bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmelemseq_index_update(BPy_BMElemSeq *self)
PyObject * BPy_BMLoop_Array_As_Tuple(BMesh *bm, BMLoop **elem, Py_ssize_t elem_len)
PyObject * BPy_BMesh_CreatePyObject(BMesh *bm, int flag)
static int bpy_bmvert_normal_set(BPy_BMVert *self, PyObject *value)
static PyObject * bpy_bmvert_is_manifold_get(BPy_BMVert *self)
static PyGetSetDef bpy_bmedgeseq_getseters[]
static PyObject * bpy_bmesh_repr(BPy_BMesh *self)
static PyObject * bpy_bmedge_is_manifold_get(BPy_BMEdge *self)
static PyObject * bpy_bmvert_co_get(BPy_BMVert *self)
static void bpy_bmelemseq_dealloc(BPy_BMElemSeq *self)
int bpy_bm_generic_valid_check(BPy_BMGeneric *self)
static PyObject * bpy_bmedge_calc_tangent(BPy_BMEdge *self, PyObject *args)
static PyObject * bpy_bmloop_edge_get(BPy_BMLoop *self)
static PyObject * bpy_bmelemseq_subscript_int(BPy_BMElemSeq *self, int keynum)
static void bpy_bmface_dealloc(BPy_BMElem *self)
static PyObject * bpy_bmedge_is_boundary_get(BPy_BMEdge *self)
static PyObject * bpy_bmface_calc_tangent_edge(BPy_BMFace *self)
PyTypeObject BPy_BMFaceSeq_Type
PyTypeObject BPy_BMVert_Type
static PyObject * bpy_bmesh_calc_loop_triangles(BPy_BMElem *self)
PyTypeObject BPy_BMIter_Type
static PyObject * bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *value)
static PyObject * bpy_bmface_material_index_get(BPy_BMFace *self)
char * BPy_BMElem_StringFromHType(const char htype)
static struct PyMethodDef bpy_bmvert_methods[]
static int bpy_bm_elem_index_set(BPy_BMElem *self, PyObject *value, void *UNUSED(flag))
static PyObject * bpy_bmface_normal_get(BPy_BMFace *self)
static PyObject * bpy_bmelemseq_iter(BPy_BMElemSeq *self)
static PyObject * bpy_bmloop_copy_from_face_interp(BPy_BMLoop *self, PyObject *args)
static PyObject * bpy_bmvert_is_boundary_get(BPy_BMVert *self)
#define BPY_BM_HFLAG_ALL_STR
PyObject * BPy_BMVertSeq_CreatePyObject(BMesh *bm)
static int bpy_bmesh_select_history_set(BPy_BMesh *self, PyObject *value)
static PyObject * bpy_bmface_calc_center_median_weighted(BPy_BMFace *self)
static PyObject * bpy_bmvert_copy_from_face_interp(BPy_BMVert *self, PyObject *args)
static PyObject * bpy_bmesh_clear(BPy_BMesh *self)
static PyObject * bpy_bm_elem_select_set(BPy_BMElem *self, PyObject *value)
static PyObject * bpy_bmvert_normal_get(BPy_BMVert *self)
PyTypeObject BPy_BMElemSeq_Type
PyObject * BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_len)
static int bpy_bmface_material_index_set(BPy_BMFace *self, PyObject *value)
static PyGetSetDef bpy_bmface_getseters[]
PyDoc_STRVAR(bpy_bm_elem_select_doc, "Selected state of this element.\n\n:type: boolean")
static int bpy_bmface_normal_set(BPy_BMFace *self, PyObject *value)
static struct PyMethodDef bpy_bmelemseq_methods[]
static PyObject * bpy_bmface_calc_tangent_vert_diagonal(BPy_BMFace *self)
PyTypeObject BPy_BMFace_Type
static PyObject * bpy_bmesh_select_mode_get(BPy_BMesh *self)
static int bpy_bmelemseq_sort_cmp_by_keys_ascending(const void *index1_v, const void *index2_v, void *keys_v)
PyObject * BPy_BMVert_CreatePyObject(BMesh *bm, BMVert *v)
static struct PyMethodDef bpy_bmloop_methods[]
static struct PyMethodDef bpy_bmfaceseq_methods[]
static void bpy_bmesh_dealloc(BPy_BMesh *self)
static PyGetSetDef bpy_bmloop_getseters[]
static PyObject * bpy_bmfaceseq_get(BPy_BMesh *self, void *UNUSED(closure))
PyTypeObject BPy_BMLoop_Type
static PyObject * bpy_bmloop_vert_get(BPy_BMLoop *self)
static PyObject * bpy_bmface_normal_update(BPy_BMFace *self)
static int bpy_bmelemseq_contains(BPy_BMElemSeq *self, PyObject *value)
static PyObject * bpy_bmface_normal_flip(BPy_BMFace *self)
PyObject * BPy_BMElemSeq_CreatePyObject(BMesh *bm, BPy_BMElem *py_ele, const char itype)
PyC_FlagSet bpy_bm_hflag_all_flags[]
static struct PyMethodDef bpy_bmedgeseq_methods[]
PyC_FlagSet bpy_bm_scene_vert_edge_face_flags[]
int BPy_BMElem_CheckHType(PyTypeObject *type, const char htype)
static PyObject * bpy_bmvert_calc_edge_angle(BPy_BMVert *self, PyObject *args)
static PyObject * bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bm_is_valid_get(BPy_BMGeneric *self)
void * BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_size, const char htype, const bool do_unique_check, const bool do_bm_check, const char *error_prefix)
static PySequenceMethods bpy_bmelemseq_as_sequence
static PyObject * bpy_bmvert_is_wire_get(BPy_BMVert *self)
static PyObject * bpy_bmloop_link_loop_radial_prev_get(BPy_BMLoop *self)
static PyObject * bpy_bmloop_is_convex_get(BPy_BMLoop *self)
static struct PyMethodDef bpy_bmesh_methods[]
static PyObject * bpy_bmloop_calc_tangent(BPy_BMLoop *self)
static PyObject * bpy_bmesh_free(BPy_BMesh *self)
static struct PyModuleDef BPy_BM_types_module_def
PyObject * BPy_BMEdgeSeq_CreatePyObject(BMesh *bm)
static int bpy_bm_elem_hflag_set(BPy_BMElem *self, PyObject *value, void *flag)
static PyObject * bpy_bmvertseq_remove(BPy_BMElemSeq *self, BPy_BMVert *value)
static PyObject * bpy_bmvert_calc_shell_factor(BPy_BMVert *self)
static PyObject * bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
struct BPy_BMLoop BPy_BMLoop
#define BPy_BMFace_Check(v)
#define BPY_BM_CHECK_OBJ(obj)
struct BPy_BMVert BPy_BMVert
struct BPy_BMIter BPy_BMIter
#define BPY_BM_CHECK_SOURCE_INT(bm, errmsg,...)
#define BPy_BMVert_Check(v)
#define BPy_BMElem_Check(v)
struct BPy_BMEdge BPy_BMEdge
#define BPy_BMesh_Check(v)
struct BPy_BMFace BPy_BMFace
#define BPy_BMEdge_Check(v)
#define BPY_BM_CHECK_SOURCE_OBJ(bm, errmsg,...)
#define BPY_BM_IS_VALID(obj)
struct BPy_BMElemSeq BPy_BMElemSeq
#define BM_ITER_BPY_BM_SEQ(ele, iter, bpy_bmelemseq)
struct BPy_BMesh BPy_BMesh
#define BPY_BM_CHECK_INT(obj)
PyTypeObject BPy_BMLayerCollection_Type
PyTypeObject BPy_BMLayerItem_Type
PyObject * BPy_BMLayerAccess_CreatePyObject(BMesh *bm, const char htype)
PyTypeObject BPy_BMLayerAccessLoop_Type
PyTypeObject BPy_BMLayerAccessVert_Type
int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObject *py_value)
PyTypeObject BPy_BMLayerAccessFace_Type
PyTypeObject BPy_BMLayerAccessEdge_Type
PyObject * BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer)
BMElem.__getitem__() / setitem()
PyTypeObject BPy_BMDeformVert_Type
PyTypeObject BPy_BMLoopUV_Type
int BPy_BMEditSel_Assign(BPy_BMesh *self, PyObject *value)
PyObject * BPy_BMEditSel_CreatePyObject(BMesh *bm)
PyTypeObject BPy_BMEditSelSeq_Type
PyTypeObject BPy_BMEditSelIter_Type
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
bool BM_vert_is_wire(const BMVert *v)
void BM_loop_calc_face_tangent(const BMLoop *l, float r_tangent[3])
BM_loop_calc_face_tangent.
bool BM_vert_is_manifold(const BMVert *v)
float BM_vert_calc_shell_factor(const BMVert *v)
float BM_vert_calc_edge_angle_ex(const BMVert *v, const float fallback)
BMESH VERT/EDGE ANGLE.
BMFace * BM_face_exists(BMVert **varr, int len)
float BM_edge_calc_face_angle_ex(const BMEdge *e, const float fallback)
BMESH EDGE/FACE ANGLE.
bool BM_loop_is_convex(const BMLoop *l)
double BM_mesh_calc_volume(BMesh *bm, bool is_signed)
float BM_loop_calc_face_angle(const BMLoop *l)
float BM_edge_calc_face_angle_signed_ex(const BMEdge *e, const float fallback)
BMESH EDGE/FACE ANGLE.
void BM_edge_calc_face_tangent(const BMEdge *e, const BMLoop *e_loop, float r_tangent[3])
BMESH EDGE/FACE TANGENT.
float BM_loop_calc_face_normal(const BMLoop *l, float r_normal[3])
BM_loop_calc_face_normal.
bool BM_vert_is_boundary(const BMVert *v)
bool BM_edge_is_convex(const BMEdge *e)
BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
#define BaseMath_ReadCallback(_self)
PyObject * Vector_CreatePyObject_wrap(float *vec, const int vec_num, PyTypeObject *base_type)
PyObject * Vector_CreatePyObject(const float *vec, const int vec_num, PyTypeObject *base_type)
PyObject * PyC_FlagSet_FromBitfield(PyC_FlagSet *items, int flag)
void * PyC_RNA_AsPointer(PyObject *value, const char *type_name)
int PyC_Long_AsBool(PyObject *value)
int PyC_FlagSet_ToBitfield(const PyC_FlagSet *items, PyObject *value, int *r_value, const char *error_prefix)
int PyC_ParseBool(PyObject *o, void *p)
PyObject_VAR_HEAD struct BMesh * bm
PyObject_VAR_HEAD struct BMesh * bm
PyObject_VAR_HEAD struct BMesh * bm
PyObject_VAR_HEAD struct BMesh * bm
struct BMEditMesh * edit_mesh