44 #include "../mathutils/mathutils.h"
46 #include "../generic/py_capi_utils.h"
47 #include "../generic/python_utildefines.h"
82 #define BPY_BM_HFLAG_ALL_STR "('SELECT', 'HIDE', 'SEAM', 'SMOOTH', 'TAG')"
102 PyDoc_STRVAR(bpy_bm_elem_select_doc,
"Selected state of this element.\n\n:type: boolean");
103 PyDoc_STRVAR(bpy_bm_elem_hide_doc,
"Hidden state of this element.\n\n:type: boolean");
105 "Generic attribute scripts can use for own logic\n\n:type: boolean");
106 PyDoc_STRVAR(bpy_bm_elem_smooth_doc,
"Smooth state of this element.\n\n:type: boolean");
107 PyDoc_STRVAR(bpy_bm_elem_seam_doc,
"Seam for UV unwrapping.\n\n:type: boolean");
139 bpy_bm_elem_index_doc,
140 "Index of this element.\n"
146 " This value is not necessarily valid, while editing the mesh it can become *dirty*.\n"
148 " It's also possible to assign any number to this attribute for a scripts internal logic.\n"
150 " To ensure the value is up to date - see :class:`BMElemSeq.index_update`.\n");
164 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
172 self->bm->elem_index_dirty |=
self->ele->head.htype;
186 "This meshes vert sequence (read-only).\n\n:type: :class:`BMVertSeq`");
194 "This meshes edge sequence (read-only).\n\n:type: :class:`BMEdgeSeq`");
202 "This meshes face sequence (read-only).\n\n:type: :class:`BMFaceSeq`");
210 "This meshes loops (read-only).\n\n:type: :class:`BMLoopSeq`\n"
214 " Loops must be accessed via faces, this is only exposed for layer access.\n");
223 bpy_bmvert_link_edges_doc,
224 "Edges connected to this vertex (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMEdge`");
226 bpy_bmvert_link_faces_doc,
227 "Faces connected to this vertex (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMFace`");
229 bpy_bmvert_link_loops_doc,
230 "Loops that use this vertex (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
233 "Verts this edge uses (always 2), (read-only).\n\n:type: :class:`BMElemSeq` of "
236 bpy_bmedge_link_faces_doc,
237 "Faces connected to this edge, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMFace`");
239 bpy_bmedge_link_loops_doc,
240 "Loops connected to this edge, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
243 "Verts of this face, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMVert`");
245 "Edges of this face, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMEdge`");
247 "Loops of this face, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
250 bpy_bmloops_link_loops_doc,
251 "Loops connected to this loop, (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMLoop`");
260 "True when this element is valid (hasn't been removed).\n\n:type: boolean");
267 bpy_bmesh_is_wrapped_doc,
268 "True when this mesh is owned by blender (typically the editmode BMesh).\n\n:type: boolean");
277 "The selection mode, values can be {'VERT', 'EDGE', 'FACE'}, can't be assigned an "
278 "empty set.\n\n:type: set");
296 PyErr_SetString(PyExc_TypeError,
"bm.select_mode: can't assign an empty value");
300 self->bm->selectmode = flag;
305 "Sequence of selected items (the last is displayed as active).\n\n:type: "
306 ":class:`BMEditSelSeq`");
325 "The coordinates for this vertex as a 3D, wrapped vector.\n\n:type: "
326 ":class:`mathutils.Vector`");
345 bpy_bmvert_normal_doc,
346 "The normal for this vertex as a 3D, wrapped vector.\n\n:type: :class:`mathutils.Vector`");
365 "True when this vertex is manifold (read-only).\n\n:type: boolean");
373 "True when this vertex is not connected to any faces (read-only).\n\n:type: boolean");
381 bpy_bmvert_is_boundary_doc,
382 "True when this vertex is connected to boundary edges (read-only).\n\n:type: boolean");
393 "True when this edge is manifold (read-only).\n\n:type: boolean");
401 "True when this edge is manifold, between two faces with the same winding "
402 "(read-only).\n\n:type: boolean");
410 "True when this edge joins two convex faces, depends on a valid face normal "
411 "(read-only).\n\n:type: boolean");
419 "True when this edge is not connected to any faces (read-only).\n\n:type: boolean");
427 "True when this edge is at the boundary of a face (read-only).\n\n:type: boolean");
438 bpy_bmface_normal_doc,
439 "The normal for this face as a 3D, wrapped vector.\n\n:type: :class:`mathutils.Vector`");
457 PyDoc_STRVAR(bpy_bmface_material_index_doc,
"The face's material index.\n\n:type: int");
461 return PyLong_FromLong(
self->f->mat_nr);
470 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
475 if ((param < 0) || (param >
MAXMAT)) {
477 PyErr_SetString(PyExc_ValueError,
"material index outside of usable range (0 - 32766)");
481 self->f->mat_nr = (short)param;
488 PyDoc_STRVAR(bpy_bmloop_vert_doc,
"The loop's vertex (read-only).\n\n:type: :class:`BMVert`");
497 "The loop's edge (between this loop and the next), (read-only).\n\n:type: :class:`BMEdge`");
505 "The face this loop makes (read-only).\n\n:type: :class:`BMFace`");
513 "The next face corner (read-only).\n\n:type: :class:`BMLoop`");
521 "The previous face corner (read-only).\n\n:type: :class:`BMLoop`");
529 "The next loop around the edge (read-only).\n\n:type: :class:`BMLoop`");
537 "The previous loop around the edge (read-only).\n\n:type: :class:`BMLoop`");
545 "True when this loop is at the convex corner of a face, depends on a valid face "
546 "normal (read-only).\n\n:type: boolean");
558 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessVert`");
560 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessEdge`");
562 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessFace`");
564 "custom-data layers (read-only).\n\n:type: :class:`BMLayerAccessLoop`");
575 PyDoc_STRVAR(bpy_bmfaceseq_active_doc,
"active face.\n\n:type: :class:`BMFace` or None");
591 if (value == Py_None) {
602 PyErr_Format(PyExc_TypeError,
603 "faces.active = f: expected BMFace or None, not %.200s",
604 Py_TYPE(value)->tp_name);
616 bpy_bmesh_select_mode_doc,
622 bpy_bmesh_select_history_doc,
629 bpy_bmesh_is_wrapped_doc,
641 bpy_bm_elem_select_doc,
646 bpy_bm_elem_hide_doc,
656 bpy_bm_elem_index_doc,
663 bpy_bmvert_normal_doc,
670 bpy_bmvert_link_edges_doc,
675 bpy_bmvert_link_faces_doc,
680 bpy_bmvert_link_loops_doc,
687 bpy_bmvert_is_manifold_doc,
693 bpy_bmvert_is_boundary_doc,
705 bpy_bm_elem_select_doc,
710 bpy_bm_elem_hide_doc,
720 bpy_bm_elem_index_doc,
726 bpy_bm_elem_smooth_doc,
731 bpy_bm_elem_seam_doc,
738 bpy_bmedge_verts_doc,
744 bpy_bmedge_link_faces_doc,
749 bpy_bmedge_link_loops_doc,
756 bpy_bmedge_is_manifold_doc,
761 bpy_bmedge_is_contiguous_doc,
768 bpy_bmedge_is_boundary_doc,
780 bpy_bm_elem_select_doc,
785 bpy_bm_elem_hide_doc,
795 bpy_bm_elem_index_doc,
801 bpy_bm_elem_smooth_doc,
807 bpy_bmface_normal_doc,
813 bpy_bmface_material_index_doc,
820 bpy_bmface_verts_doc,
825 bpy_bmface_edges_doc,
830 bpy_bmface_loops_doc,
846 bpy_bm_elem_select_doc,
851 bpy_bm_elem_hide_doc,
862 bpy_bm_elem_index_doc,
873 bpy_bmloops_link_loops_doc,
878 bpy_bmloop_link_loop_next_doc,
883 bpy_bmloop_link_loop_prev_doc,
885 {
"link_loop_radial_next",
888 bpy_bmloop_link_loop_radial_next_doc,
890 {
"link_loop_radial_prev",
893 bpy_bmloop_link_loop_radial_prev_doc,
907 bpy_bmelemseq_layers_vert_doc,
915 bpy_bmelemseq_layers_edge_doc,
923 bpy_bmelemseq_layers_face_doc,
929 bpy_bmfaceseq_active_doc,
937 bpy_bmelemseq_layers_loop_doc,
949 ".. method:: copy()\n"
951 " :return: A copy of this BMesh.\n"
952 " :rtype: :class:`BMesh`\n");
968 PyErr_SetString(PyExc_SystemError,
"Unable to copy BMesh, internal error");
973 ".. method:: clear()\n"
975 " Clear all mesh data.\n");
991 ".. method:: free()\n"
993 " Explicitly free the BMesh data from memory, causing exceptions on further access.\n"
997 " The BMesh is freed automatically, typically when the script finishes executing.\n"
998 " However in some cases its hard to predict when this will be and its useful to\n"
999 " explicitly free the data.\n");
1018 ".. method:: to_mesh(mesh)\n"
1020 " Writes this BMesh data into an existing Mesh datablock.\n"
1022 " :arg mesh: The mesh data to write into.\n"
1023 " :type mesh: :class:`Mesh`\n");
1032 if (!PyArg_ParseTuple(args,
"O:to_mesh", &py_mesh) ||
1039 PyErr_Format(PyExc_ValueError,
"to_mesh(): Mesh '%s' is in editmode", me->
id.
name + 2);
1047 .update_shapekey_indices =
true,
1056 params.calc_object_remap =
true;
1069 ".. method:: from_object(object, depsgraph, cage=False, face_normals=True)\n"
1071 " Initialize this bmesh from existing object data-block (only meshes are currently "
1074 " :arg object: The object data to load.\n"
1075 " :type object: :class:`Object`\n"
1076 " :arg cage: Get the mesh as a deformed cage.\n"
1077 " :type cage: boolean\n"
1078 " :arg face_normals: Calculate face normals.\n"
1079 " :type face_normals: boolean\n");
1082 static const char *kwlist[] = {
"object",
"depsgraph",
"deform",
"cage",
"face_normals",
NULL};
1083 PyObject *py_object;
1084 PyObject *py_depsgraph;
1087 struct Scene *scene_eval;
1090 bool use_deform =
true;
1091 bool use_cage =
false;
1092 bool use_fnorm =
true;
1097 if (!PyArg_ParseTupleAndKeywords(args,
1099 "OO|O&O&O&:from_object",
1115 PyErr_SetString(PyExc_ValueError,
1116 "from_object(...): currently only mesh objects are supported");
1120 if (use_deform ==
false) {
1121 PyErr_WarnEx(PyExc_FutureWarning,
1122 "from_object(...): the deform parameter is deprecated, assumed to be True, and "
1123 "will be removed in version 3.0",
1130 bool need_free =
false;
1135 PyErr_SetString(PyExc_ValueError,
1136 "from_object(...): cage arg is unsupported when dependency graph "
1137 "evaluation mode is RENDER");
1153 if (me_eval ==
NULL) {
1154 PyErr_Format(PyExc_ValueError,
1155 "from_object(...): Object '%s' has no usable mesh data",
1165 .calc_face_normal = use_fnorm,
1176 bpy_bmesh_from_mesh_doc,
1177 ".. method:: from_mesh(mesh, face_normals=True, use_shape_key=False, shape_key_index=0)\n"
1179 " Initialize this bmesh from existing mesh datablock.\n"
1181 " :arg mesh: The mesh data to load.\n"
1182 " :type mesh: :class:`Mesh`\n"
1183 " :arg use_shape_key: Use the locations from a shape key.\n"
1184 " :type use_shape_key: boolean\n"
1185 " :arg shape_key_index: The shape key index to use.\n"
1186 " :type shape_key_index: int\n"
1190 " Multiple calls can be used to join multiple meshes.\n"
1192 " Custom-data layers are only copied from ``mesh`` on initialization.\n"
1193 " Further calls will copy custom-data to matching layers, layers missing on the target "
1194 "mesh wont be added.\n");
1197 static const char *kwlist[] = {
"mesh",
"face_normals",
"use_shape_key",
"shape_key_index",
NULL};
1201 bool use_fnorm =
true;
1202 bool use_shape_key =
false;
1203 int shape_key_index = 0;
1207 if (!PyArg_ParseTupleAndKeywords(args,
1209 "O|O&O&i:from_mesh",
1216 &shape_key_index) ||
1226 .calc_face_normal = use_fnorm,
1227 .use_shapekey = use_shape_key,
1228 .active_shapekey = shape_key_index + 1,
1235 ".. method:: select_flush_mode()\n"
1237 " flush selection based on the current mode current :class:`BMesh.select_mode`.\n");
1248 ".. method:: select_flush(select)\n"
1250 " Flush selection, independent of the current selection mode.\n"
1252 " :arg select: flush selection or de-selected elements.\n"
1253 " :type select: boolean\n");
1275 ".. method:: normal_update()\n"
1277 " Update mesh normals.\n");
1288 ".. method:: transform(matrix, filter=None)\n"
1290 " Transform the mesh (optionally filtering flagged data only).\n"
1292 " :arg matrix: transform matrix.\n"
1293 " :type matrix: 4x4 :class:`mathutils.Matrix`\n"
1296 " :type filter: set\n");
1299 static const char *kwlist[] = {
"matrix",
"filter",
NULL};
1303 int filter_flags = 0;
1307 if (!PyArg_ParseTupleAndKeywords(args,
1326 PyErr_SetString(PyExc_ValueError,
"expected a 4x4 matrix");
1335 mat_ptr = mat->matrix;
1337 if (!filter_flags) {
1343 const char filter_flags_ch = (char)filter_flags;
1355 ".. method:: calc_volume(signed=False)\n"
1357 " Calculate mesh volume based on face normals.\n"
1359 " :arg signed: when signed is true, negative values may be returned.\n"
1360 " :type signed: bool\n"
1361 " :return: The volume of the mesh.\n"
1362 " :rtype: float\n");
1365 static const char *kwlist[] = {
"signed",
NULL};
1366 PyObject *is_signed = Py_False;
1370 if (!PyArg_ParseTupleAndKeywords(
1371 args, kw,
"|O!:calc_volume", (
char **)kwlist, &PyBool_Type, &is_signed)) {
1379 ".. method:: calc_loop_triangles()\n"
1381 " Calculate triangle tessellation from quads/ngons.\n"
1383 " :return: The triangulated faces.\n"
1384 " :rtype: list of :class:`BMLoop` tuples\n");
1401 looptris = PyMem_MALLOC(
sizeof(*looptris) * looptris_tot);
1405 ret = PyList_New(tottri);
1406 for (i = 0; i < tottri; i++) {
1410 PyMem_FREE(looptris);
1419 ".. method:: select_set(select)\n"
1421 " Set the selection.\n"
1422 " This is different from the *select* attribute because it updates the selection "
1423 "state of associated geometry.\n"
1425 " :arg select: Select or de-select.\n"
1426 " :type select: boolean\n"
1430 " Currently this only flushes down, so selecting a face will select all its "
1431 "vertices but de-selecting a vertex "
1432 " won't de-select all the faces that use it, before finishing with a mesh "
1433 "typically flushing is still needed.\n");
1450 ".. method:: hide_set(hide)\n"
1452 " Set the hide state.\n"
1453 " This is different from the *hide* attribute because it updates the selection and "
1454 "hide state of associated geometry.\n"
1456 " :arg hide: Hidden or visible.\n"
1457 " :type hide: boolean\n");
1474 ".. method:: copy_from(other)\n"
1476 " Copy values from another element of matching type.\n");
1481 if (Py_TYPE(
self) != Py_TYPE(value)) {
1482 PyErr_Format(PyExc_TypeError,
1483 "expected element of type '%.200s' not '%.200s'",
1484 Py_TYPE(
self)->tp_name,
1485 Py_TYPE(value)->tp_name);
1489 if (value->
ele !=
self->ele) {
1500 ".. method:: copy_from_vert_interp(vert_pair, fac)\n"
1502 " Interpolate the customdata from a vert between 2 other verts.\n"
1504 " :arg vert_pair: The vert to interpolate data from.\n"
1505 " :type vert_pair: :class:`BMVert`\n");
1513 if (!PyArg_ParseTuple(args,
"Of:BMVert.copy_from_vert_interp", &vert_seq, &fac)) {
1519 Py_ssize_t vert_seq_len;
1529 "BMVert.copy_from_vert_interp(...)");
1531 if (vert_array ==
NULL) {
1537 PyMem_FREE(vert_array);
1542 ".. method:: copy_from_face_interp(face)\n"
1544 " Interpolate the customdata from a face onto this loop (the loops vert should "
1545 "overlap the face).\n"
1547 " :arg face: The face to interpolate data from.\n"
1548 " :type face: :class:`BMFace`\n");
1555 if (!PyArg_ParseTuple(args,
"O!:BMVert.copy_from_face_interp", &
BPy_BMFace_Type, &py_face)) {
1569 ".. method:: calc_edge_angle(fallback=None)\n"
1571 " Return the angle between this vert's two connected edges.\n"
1573 " :arg fallback: return this when the vert doesn't have 2 edges\n"
1574 " (instead of raising a :exc:`ValueError`).\n"
1575 " :type fallback: any\n"
1576 " :return: Angle between edges in radians.\n"
1577 " :rtype: float\n");
1580 const float angle_invalid = -1.0f;
1582 PyObject *fallback =
NULL;
1586 if (!PyArg_ParseTuple(args,
"|O:calc_edge_angle", &fallback)) {
1592 if (
angle == angle_invalid) {
1595 Py_INCREF(fallback);
1599 PyErr_SetString(PyExc_ValueError,
1600 "BMVert.calc_edge_angle(): "
1601 "vert must connect to exactly 2 edges");
1605 return PyFloat_FromDouble(
angle);
1609 bpy_bmvert_calc_shell_factor_doc,
1610 ".. method:: calc_shell_factor()\n"
1612 " Return a multiplier calculated based on the sharpness of the vertex.\n"
1613 " Where a flat surface gives 1.0, and higher values sharper edges.\n"
1614 " This is used to maintain shell thickness when offsetting verts along their normals.\n"
1616 " :return: offset multiplier\n"
1617 " :rtype: float\n");
1625 ".. method:: normal_update()\n"
1627 " Update vertex normal.\n");
1641 ".. method:: calc_length()\n"
1643 " :return: The length between both verts.\n"
1644 " :rtype: float\n");
1652 ".. method:: calc_face_angle(fallback=None)\n"
1654 " :arg fallback: return this when the edge doesn't have 2 faces\n"
1655 " (instead of raising a :exc:`ValueError`).\n"
1656 " :type fallback: any\n"
1657 " :return: The angle between 2 connected faces in radians.\n"
1658 " :rtype: float\n");
1661 const float angle_invalid = -1.0f;
1663 PyObject *fallback =
NULL;
1667 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle", &fallback)) {
1673 if (
angle == angle_invalid) {
1676 Py_INCREF(fallback);
1680 PyErr_SetString(PyExc_ValueError,
1681 "BMEdge.calc_face_angle(): "
1682 "edge doesn't use 2 faces");
1686 return PyFloat_FromDouble(
angle);
1690 bpy_bmedge_calc_face_angle_signed_doc,
1691 ".. method:: calc_face_angle_signed(fallback=None)\n"
1693 " :arg fallback: return this when the edge doesn't have 2 faces\n"
1694 " (instead of raising a :exc:`ValueError`).\n"
1695 " :type fallback: any\n"
1696 " :return: The angle between 2 connected faces in radians (negative for concave join).\n"
1697 " :rtype: float\n");
1700 const float angle_invalid = -FLT_MAX;
1702 PyObject *fallback =
NULL;
1706 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle_signed", &fallback)) {
1712 if (
angle == angle_invalid) {
1715 Py_INCREF(fallback);
1719 PyErr_SetString(PyExc_ValueError,
1720 "BMEdge.calc_face_angle_signed(): "
1721 "edge doesn't use 2 faces");
1725 return PyFloat_FromDouble(
angle);
1729 bpy_bmedge_calc_tangent_doc,
1730 ".. method:: calc_tangent(loop)\n"
1732 " Return the tangent at this edge relative to a face (pointing inward into the face).\n"
1733 " This uses the face normal for calculation.\n"
1735 " :arg loop: The loop used for tangent calculation.\n"
1736 " :type loop: :class:`BMLoop`\n"
1737 " :return: a normalized vector.\n"
1738 " :rtype: :class:`mathutils.Vector`\n");
1744 if (!PyArg_ParseTuple(args,
"O!:BMEdge.calc_face_tangent", &
BPy_BMLoop_Type, &py_loop)) {
1756 bpy_bmedge_other_vert_doc,
1757 ".. method:: other_vert(vert)\n"
1759 " Return the other vertex on this edge or None if the vertex is not used by this edge.\n"
1761 " :arg vert: a vert in this edge.\n"
1762 " :type vert: :class:`BMVert`\n"
1763 " :return: The edges other vert.\n"
1764 " :rtype: :class:`BMVert` or None\n");
1771 PyErr_Format(PyExc_TypeError,
1772 "BMEdge.other_vert(vert): BMVert expected, not '%.200s'",
1773 Py_TYPE(value)->tp_name);
1790 ".. method:: normal_update()\n"
1792 " Update edges vertex normals.\n");
1806 bpy_bmface_copy_from_face_interp_doc,
1807 ".. method:: copy_from_face_interp(face, vert=True)\n"
1809 " Interpolate the customdata from another face onto this one (faces should overlap).\n"
1811 " :arg face: The face to interpolate data from.\n"
1812 " :type face: :class:`BMFace`\n"
1813 " :arg vert: When True, also copy vertex data.\n"
1814 " :type vert: boolean\n");
1818 bool do_vertex =
true;
1822 if (!PyArg_ParseTuple(args,
1823 "O!|O&:BMFace.copy_from_face_interp",
1841 ".. method:: copy(verts=True, edges=True)\n"
1843 " Make a copy of this face.\n"
1845 " :arg verts: When set, the faces verts will be duplicated too.\n"
1846 " :type verts: boolean\n"
1847 " :arg edges: When set, the faces edges will be duplicated too.\n"
1848 " :type edges: boolean\n"
1849 " :return: The newly created face.\n"
1850 " :rtype: :class:`BMFace`\n");
1853 static const char *kwlist[] = {
"verts",
"edges",
NULL};
1856 bool do_verts =
true;
1857 bool do_edges =
true;
1862 if (!PyArg_ParseTupleAndKeywords(args,
1864 "|O&O&:BMFace.copy",
1879 PyErr_SetString(PyExc_ValueError,
"BMFace.copy(): couldn't create the new face, internal error");
1884 ".. method:: calc_area()\n"
1886 " Return the area of the face.\n"
1888 " :return: Return the area of the face.\n"
1889 " :rtype: float\n");
1897 ".. method:: calc_perimeter()\n"
1899 " Return the perimeter of the face.\n"
1901 " :return: Return the perimeter of the face.\n"
1902 " :rtype: float\n");
1910 ".. method:: calc_tangent_edge()\n"
1912 " Return face tangent based on longest edge.\n"
1914 " :return: a normalized vector.\n"
1915 " :rtype: :class:`mathutils.Vector`\n");
1926 ".. method:: calc_tangent_edge_pair()\n"
1928 " Return face tangent based on the two longest disconnected edges.\n"
1930 " - Tris: Use the edge pair with the most similar lengths.\n"
1931 " - Quads: Use the longest edge pair.\n"
1932 " - NGons: Use the two longest disconnected edges.\n"
1934 " :return: a normalized vector.\n"
1935 " :rtype: :class:`mathutils.Vector`\n");
1946 ".. method:: calc_tangent_edge_diagonal()\n"
1948 " Return face tangent based on the edge farthest from any vertex.\n"
1950 " :return: a normalized vector.\n"
1951 " :rtype: :class:`mathutils.Vector`\n");
1962 ".. method:: calc_tangent_vert_diagonal()\n"
1964 " Return face tangent based on the two most distent vertices.\n"
1966 " :return: a normalized vector.\n"
1967 " :rtype: :class:`mathutils.Vector`\n");
1978 ".. method:: calc_center_median()\n"
1980 " Return median center of the face.\n"
1982 " :return: a 3D vector.\n"
1983 " :rtype: :class:`mathutils.Vector`\n");
1994 ".. method:: calc_center_median_weighted()\n"
1996 " Return median center of the face weighted by edge lengths.\n"
1998 " :return: a 3D vector.\n"
1999 " :rtype: :class:`mathutils.Vector`\n");
2010 ".. method:: calc_center_bounds()\n"
2012 " Return bounds center of the face.\n"
2014 " :return: a 3D vector.\n"
2015 " :rtype: :class:`mathutils.Vector`\n");
2026 ".. method:: normal_update()\n"
2028 " Update face's normal.\n");
2039 ".. method:: normal_flip()\n"
2041 " Reverses winding of a face, which flips its normal.\n");
2055 ".. method:: copy_from_face_interp(face, vert=True, multires=True)\n"
2057 " Interpolate the customdata from a face onto this loop (the loops vert should "
2058 "overlap the face).\n"
2060 " :arg face: The face to interpolate data from.\n"
2061 " :type face: :class:`BMFace`\n"
2062 " :arg vert: When enabled, interpolate the loops vertex data (optional).\n"
2063 " :type vert: boolean\n"
2064 " :arg multires: When enabled, interpolate the loops multires data (optional).\n"
2065 " :type multires: boolean\n");
2069 bool do_vertex =
true;
2070 bool do_multires =
true;
2074 if (!PyArg_ParseTuple(args,
2075 "O!|O&O&:BMLoop.copy_from_face_interp",
2095 ".. method:: calc_angle()\n"
2097 " Return the angle at this loops corner of the face.\n"
2098 " This is calculated so sharper corners give lower angles.\n"
2100 " :return: The angle in radians.\n"
2101 " :rtype: float\n");
2109 ".. method:: calc_normal()\n"
2111 " Return normal at this loops corner of the face.\n"
2112 " Falls back to the face normal for straight lines.\n"
2114 " :return: a normalized vector.\n"
2115 " :rtype: :class:`mathutils.Vector`\n");
2125 bpy_bmloop_calc_tangent_doc,
2126 ".. method:: calc_tangent()\n"
2128 " Return the tangent at this loops corner of the face (pointing inward into the face).\n"
2129 " Falls back to the face normal for straight lines.\n"
2131 " :return: a normalized vector.\n"
2132 " :rtype: :class:`mathutils.Vector`\n");
2144 ".. method:: new(co=(0.0, 0.0, 0.0), example=None)\n"
2146 " Create a new vertex.\n"
2148 " :arg co: The initial location of the vertex (optional argument).\n"
2149 " :type co: float triplet\n"
2150 " :arg example: Existing vert to initialize settings.\n"
2151 " :type example: :class:`BMVert`\n"
2152 " :return: The newly created edge.\n"
2153 " :rtype: :class:`BMVert`\n");
2156 PyObject *py_co =
NULL;
2161 if (!PyArg_ParseTuple(args,
"|OO!:verts.new", &py_co, &
BPy_BMVert_Type, &py_vert_example)) {
2167 float co[3] = {0.0f, 0.0f, 0.0f};
2169 if (py_vert_example) {
2180 PyErr_SetString(PyExc_ValueError,
2181 "faces.new(verts): couldn't create the new face, internal error");
2185 if (py_vert_example) {
2195 ".. method:: new(verts, example=None)\n"
2197 " Create a new edge from a given pair of verts.\n"
2199 " :arg verts: Vertex pair.\n"
2200 " :type verts: pair of :class:`BMVert`\n"
2201 " :arg example: Existing edge to initialize settings (optional argument).\n"
2202 " :type example: :class:`BMEdge`\n"
2203 " :return: The newly created edge.\n"
2204 " :rtype: :class:`BMEdge`\n");
2212 if (!PyArg_ParseTuple(args,
"O|O!:edges.new", &vert_seq, &
BPy_BMEdge_Type, &py_edge_example)) {
2219 Py_ssize_t vert_seq_len;
2222 if (py_edge_example) {
2227 &
bm, vert_seq, 2, 2, &vert_seq_len,
BM_VERT,
true,
true,
"edges.new(...)");
2229 if (vert_array ==
NULL) {
2234 PyErr_SetString(PyExc_ValueError,
"edges.new(): this edge exists");
2241 PyErr_SetString(PyExc_ValueError,
2242 "faces.new(verts): couldn't create the new face, internal error");
2246 if (py_edge_example) {
2254 PyMem_FREE(vert_array);
2262 ".. method:: new(verts, example=None)\n"
2264 " Create a new face from a given set of verts.\n"
2266 " :arg verts: Sequence of 3 or more verts.\n"
2267 " :type verts: :class:`BMVert`\n"
2268 " :arg example: Existing face to initialize settings (optional argument).\n"
2269 " :type example: :class:`BMFace`\n"
2270 " :return: The newly created face.\n"
2271 " :rtype: :class:`BMFace`\n");
2279 if (!PyArg_ParseTuple(args,
"O|O!:faces.new", &vert_seq, &
BPy_BMFace_Type, &py_face_example)) {
2284 Py_ssize_t vert_seq_len;
2292 if (py_face_example) {
2297 &
bm, vert_seq, 3, PY_SSIZE_T_MAX, &vert_seq_len,
BM_VERT,
true,
true,
"faces.new(...)");
2299 if (vert_array ==
NULL) {
2305 PyErr_SetString(PyExc_ValueError,
"faces.new(verts): face already exists");
2315 py_face_example ? py_face_example->
f :
NULL,
2320 PyErr_SetString(PyExc_ValueError,
2321 "faces.new(verts): couldn't create the new face, internal error");
2330 PyMem_FREE(vert_array);
2339 ".. method:: remove(vert)\n"
2341 " Remove a vert.\n");
2361 ".. method:: remove(edge)\n"
2363 " Remove an edge.\n");
2383 ".. method:: remove(face)\n"
2385 " Remove a face.\n");
2405 ".. method:: get(verts, fallback=None)\n"
2407 " Return an edge which uses the **verts** passed.\n"
2409 " :arg verts: Sequence of verts.\n"
2410 " :type verts: :class:`BMVert`\n"
2411 " :arg fallback: Return this value if nothing is found.\n"
2412 " :return: The edge found or None\n"
2413 " :rtype: :class:`BMEdge`\n");
2417 PyObject *fallback = Py_None;
2421 if (!PyArg_ParseTuple(args,
"O|O:edges.get", &vert_seq, &fallback)) {
2428 Py_ssize_t vert_seq_len;
2432 &
bm, vert_seq, 2, 2, &vert_seq_len,
BM_VERT,
true,
true,
"edges.get(...)");
2434 if (vert_array ==
NULL) {
2446 PyMem_FREE(vert_array);
2451 ".. method:: get(verts, fallback=None)\n"
2453 " Return a face which uses the **verts** passed.\n"
2455 " :arg verts: Sequence of verts.\n"
2456 " :type verts: :class:`BMVert`\n"
2457 " :arg fallback: Return this value if nothing is found.\n"
2458 " :return: The face found or None\n"
2459 " :rtype: :class:`BMFace`\n");
2463 PyObject *fallback = Py_None;
2467 if (!PyArg_ParseTuple(args,
"O|O:faces.get", &vert_seq, &fallback)) {
2474 Py_ssize_t vert_seq_len;
2478 &
bm, vert_seq, 1, PY_SSIZE_T_MAX, &vert_seq_len,
BM_VERT,
true,
true,
"faces.get(...)");
2480 if (vert_array ==
NULL) {
2493 PyMem_FREE(vert_array);
2498 bpy_bmelemseq_index_update_doc,
2499 ".. method:: index_update()\n"
2501 " Initialize the index values of this sequence.\n"
2503 " This is the equivalent of looping over all elements and assigning the index values.\n"
2505 " .. code-block:: python\n"
2507 " for index, ele in enumerate(sequence):\n"
2508 " ele.index = index\n"
2512 " Running this on sequences besides :class:`BMesh.verts`, :class:`BMesh.edges`, "
2513 ":class:`BMesh.faces`\n"
2514 " works but wont result in each element having a valid index, instead its order in the "
2515 "sequence will be set.\n");
2555 ".. method:: ensure_lookup_table()\n"
2557 " Ensure internal data needed for int subscription is initialized with "
2558 "verts/edges/faces, eg ``bm.verts[index]``.\n"
2560 " This needs to be called again after adding/removing data in this sequence.");
2571 bpy_bmelemseq_sort_doc,
2572 ".. method:: sort(key=None, reverse=False)\n"
2574 " Sort the elements of this sequence, using an optional custom sort key.\n"
2575 " Indices of elements are not changed, BMElemeSeq.index_update() can be used for that.\n"
2577 " :arg key: The key that sets the ordering of the elements.\n"
2578 " :type key: :function: returning a number\n"
2579 " :arg reverse: Reverse the order of the elements\n"
2580 " :type reverse: :boolean:\n"
2584 " When the 'key' argument is not provided, the elements are reordered following their "
2585 "current index value.\n"
2586 " In particular this can be used by setting indices manually before calling this "
2591 " Existing references to the N'th element, will continue to point the data at that "
2607 const void *index2_v,
2610 const double *keys = keys_v;
2611 const int *index1 = (
int *)index1_v;
2612 const int *index2 = (
int *)index2_v;
2614 if (keys[*index1] < keys[*index2]) {
2617 if (keys[*index1] > keys[*index2]) {
2625 const void *index2_v,
2633 static const char *kwlist[] = {
"key",
"reverse",
NULL};
2634 PyObject *keyfunc =
NULL;
2635 bool do_reverse =
false;
2646 int (*elem_idx_compare_by_keys)(
const void *,
const void *,
void *);
2658 if (!PyArg_ParseTupleAndKeywords(args,
2660 "|OO&:BMElemSeq.sort",
2669 if (keyfunc !=
NULL && !PyCallable_Check(keyfunc)) {
2670 PyErr_SetString(PyExc_TypeError,
"the 'key' argument is not a callable object");
2680 keys = PyMem_MALLOC(
sizeof(*keys) * n_elem);
2688 if (keyfunc !=
NULL) {
2693 index = PyObject_CallFunctionObjArgs(keyfunc, py_elem,
NULL);
2695 if (index ==
NULL) {
2702 if ((keys[i] = PyFloat_AsDouble(index)) == -1 && PyErr_Occurred()) {
2703 PyErr_SetString(PyExc_ValueError,
2704 "the value returned by the 'key' function is not a number");
2721 elem_idx = PyMem_MALLOC(
sizeof(*elem_idx) * n_elem);
2722 if (elem_idx ==
NULL) {
2739 BLI_qsort_r(elem_idx, n_elem,
sizeof(*elem_idx), elem_idx_compare_by_keys, keys);
2741 elem_map_idx = PyMem_MALLOC(
sizeof(*elem_map_idx) * n_elem);
2742 if (elem_map_idx ==
NULL) {
2744 PyMem_FREE(elem_idx);
2754 for (i = 0; i < n_elem; i++) {
2755 elem_map_idx[elem_idx[i]] = i;
2760 vert_idx = elem_map_idx;
2763 edge_idx = elem_map_idx;
2766 face_idx = elem_map_idx;
2769 PyErr_Format(PyExc_TypeError,
"element type %d not supported",
self->itype);
2770 PyMem_FREE(elem_map_idx);
2771 PyMem_FREE(elem_idx);
2778 PyMem_FREE(elem_map_idx);
2779 PyMem_FREE(elem_idx);
2787 {
"copy", (PyCFunction)
bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
2788 {
"clear", (PyCFunction)
bpy_bmesh_clear, METH_NOARGS, bpy_bmesh_clear_doc},
2789 {
"free", (PyCFunction)
bpy_bmesh_free, METH_NOARGS, bpy_bmesh_free_doc},
2794 METH_VARARGS | METH_KEYWORDS,
2795 bpy_bmesh_from_object_doc},
2798 METH_VARARGS | METH_KEYWORDS,
2799 bpy_bmesh_from_mesh_doc},
2800 {
"to_mesh", (PyCFunction)
bpy_bmesh_to_mesh, METH_VARARGS, bpy_bmesh_to_mesh_doc},
2803 {
"select_flush_mode",
2806 bpy_bmesh_select_flush_mode_doc},
2811 bpy_bmesh_normal_update_doc},
2814 METH_VARARGS | METH_KEYWORDS,
2815 bpy_bmesh_transform_doc},
2820 METH_VARARGS | METH_KEYWORDS,
2821 bpy_bmesh_calc_volume_doc},
2822 {
"calc_loop_triangles",
2825 bpy_bmesh_calc_loop_triangles_doc},
2833 {
"copy_from_face_interp",
2836 bpy_bmvert_copy_from_face_interp_doc},
2837 {
"copy_from_vert_interp",
2840 bpy_bmvert_copy_from_vert_interp_doc},
2845 bpy_bmvert_calc_edge_angle_doc},
2846 {
"calc_shell_factor",
2849 bpy_bmvert_calc_shell_factor_doc},
2854 bpy_bmvert_normal_update_doc},
2870 bpy_bmedge_calc_face_angle_doc},
2871 {
"calc_face_angle_signed",
2874 bpy_bmedge_calc_face_angle_signed_doc},
2878 bpy_bmedge_calc_tangent_doc},
2883 bpy_bmedge_normal_update_doc},
2893 {
"copy_from_face_interp",
2896 bpy_bmface_copy_from_face_interp_doc},
2898 {
"copy", (PyCFunction)
bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc},
2904 bpy_bmface_calc_perimeter_doc},
2905 {
"calc_tangent_edge",
2908 bpy_bmface_calc_tangent_edge_doc},
2909 {
"calc_tangent_edge_pair",
2912 bpy_bmface_calc_tangent_edge_pair_doc},
2913 {
"calc_tangent_edge_diagonal",
2916 bpy_bmface_calc_tangent_edge_diagonal_doc},
2917 {
"calc_tangent_vert_diagonal",
2920 bpy_bmface_calc_tangent_vert_diagonal_doc},
2921 {
"calc_center_median",
2924 bpy_bmface_calc_center_median_doc},
2925 {
"calc_center_median_weighted",
2928 bpy_bmface_calc_center_median_weighted_doc},
2929 {
"calc_center_bounds",
2932 bpy_bmface_calc_center_bounds_doc},
2937 bpy_bmface_normal_update_doc},
2945 {
"copy_from_face_interp",
2948 bpy_bmloop_copy_from_face_interp_doc},
2955 bpy_bmloop_calc_tangent_doc},
2964 bpy_bmelemseq_index_update_doc},
2976 bpy_bmelemseq_index_update_doc},
2977 {
"ensure_lookup_table",
2980 bpy_bmelemseq_ensure_lookup_table_doc},
2983 METH_VARARGS | METH_KEYWORDS,
2984 bpy_bmelemseq_sort_doc},
2998 bpy_bmelemseq_index_update_doc},
2999 {
"ensure_lookup_table",
3002 bpy_bmelemseq_ensure_lookup_table_doc},
3005 METH_VARARGS | METH_KEYWORDS,
3006 bpy_bmelemseq_sort_doc},
3020 bpy_bmelemseq_index_update_doc},
3021 {
"ensure_lookup_table",
3024 bpy_bmelemseq_ensure_lookup_table_doc},
3027 METH_VARARGS | METH_KEYWORDS,
3028 bpy_bmelemseq_sort_doc},
3083 return self->bm->totvert;
3085 return self->bm->totedge;
3087 return self->bm->totface;
3129 switch (
self->itype) {
3152 PyErr_SetString(PyExc_IndexError,
3153 "BMElemSeq[index]: outdated internal index table, "
3154 "run ensure_lookup_table() first");
3167 PyErr_Format(PyExc_IndexError,
"BMElemSeq[index]: index %d out of range", keynum);
3184 list = PyList_New(0);
3195 for (ok =
true; ok; ok = (BM_iter_step(&iter) !=
NULL)) {
3196 if (
count == start) {
3203 while ((ele = BM_iter_step(&iter))) {
3207 if (
count == stop) {
3218 if (PyIndex_Check(key)) {
3219 const Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
3220 if (i == -1 && PyErr_Occurred()) {
3225 if (PySlice_Check(key)) {
3226 PySliceObject *key_slice = (PySliceObject *)key;
3227 Py_ssize_t step = 1;
3229 if (key_slice->step != Py_None && !_PyEval_SliceIndex(key, &step)) {
3233 PyErr_SetString(PyExc_TypeError,
"BMElemSeq[slice]: slice steps not supported");
3236 if (key_slice->start == Py_None && key_slice->stop == Py_None) {
3240 Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
3243 if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) {
3246 if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) {
3250 if (start < 0 || stop < 0) {
3263 if (stop - start <= 0) {
3264 return PyList_New(0);
3270 PyErr_SetString(PyExc_AttributeError,
"BMElemSeq[key]: invalid key, key must be an int");
3280 if (value_bm_ele->
bm ==
self->bm) {
3281 BMElem *ele, *ele_test = value_bm_ele->
ele;
3284 if (ele == ele_test) {
3318 (ssizeobjargproc)
NULL,
3328 (objobjargproc)
NULL,
3349 return (PyObject *)py_iter;
3356 PyErr_SetNone(PyExc_StopIteration);
3447 Py_XDECREF(
self->py_ele);
3455 return _Py_HashPointer(((
BPy_BMElem *)
self)->ele);
3471 "This is normally accessed from :class:`BMFace.loops` where each face loop "
3472 "represents a corner of the face.\n");
3474 "General sequence type used for accessing any sequence of\n"
3475 ":class:`BMVert`, :class:`BMEdge`, :class:`BMFace`, :class:`BMLoop`.\n"
3477 "When accessed via :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces`\n"
3478 "there are also functions to create/remomove items.\n");
3480 "Internal BMesh type for looping over verts/faces/edges,\n"
3481 "used for iterating over :class:`BMElemSeq` types.\n");
3488 return PyUnicode_FromFormat(
"<BMesh(%p), totvert=%d, totedge=%d, totface=%d, totloop=%d>",
3496 return PyUnicode_FromFormat(
"<BMesh dead at %p>",
self);
3508 return PyUnicode_FromFormat(
"<BMVert dead at %p>",
self);
3517 return PyUnicode_FromFormat(
"<BMEdge(%p), index=%d, verts=(%p/%d, %p/%d)>",
3526 return PyUnicode_FromFormat(
"<BMEdge dead at %p>",
self);
3535 return PyUnicode_FromFormat(
3539 return PyUnicode_FromFormat(
"<BMFace dead at %p>",
self);
3548 return PyUnicode_FromFormat(
"<BMLoop(%p), index=%d, vert=%p/%d, edge=%p/%d, face=%p/%d>",
3559 return PyUnicode_FromFormat(
"<BMLoop dead at %p>",
self);
3734 PyModuleDef_HEAD_INIT,
3747 PyObject *submodule;
3807 return (PyObject *)
self;
3833 return (PyObject *)
self;
3859 return (PyObject *)
self;
3885 return (PyObject *)
self;
3911 return (PyObject *)
self;
3918 self->py_ele = py_ele;
3919 self->itype =
itype;
3921 return (PyObject *)
self;
3928 self->py_ele =
NULL;
3930 return (PyObject *)
self;
3937 self->py_ele =
NULL;
3939 return (PyObject *)
self;
3946 self->py_ele =
NULL;
3948 return (PyObject *)
self;
3955 self->py_ele =
NULL;
3957 return (PyObject *)
self;
3965 return (PyObject *)
self;
3971 switch (ele->
htype) {
3982 PyErr_SetString(PyExc_SystemError,
"internal error");
3999 PyExc_ReferenceError,
"BMesh used by %.200s has become invalid", Py_TYPE(
self)->tp_name);
4008 PyExc_ReferenceError,
"BMesh data of type %.200s has been removed", Py_TYPE(
self)->tp_name);
4013 const char *error_prefix,
4019 while (args_tot--) {
4032 PyErr_Format(PyExc_ValueError,
4033 "%.200s: BMesh data of type %.200s is from another mesh",
4035 Py_TYPE(py_bm_elem)->tp_name);
4061 const bool do_unique_check,
4062 const bool do_bm_check,
4063 const char *error_prefix)
4066 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
4067 const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast);
4068 Py_ssize_t i, i_last_dirty = PY_SSIZE_T_MAX;
4075 if (seq_len < min || seq_len >
max) {
4076 PyErr_Format(PyExc_TypeError,
4077 "%s: sequence incorrect size, expected [%d - %d], given %d",
4086 alloc = PyMem_MALLOC(seq_len *
sizeof(
BPy_BMElem **));
4088 for (i = 0; i < seq_len; i++) {
4092 PyErr_Format(PyExc_TypeError,
4093 "%s: expected %.200s, not '%.200s'",
4096 Py_TYPE(item)->tp_name);
4101 PyExc_TypeError,
"%s: %d %s has been removed", error_prefix, i, Py_TYPE(item)->tp_name);
4106 else if (do_bm_check && (
bm &&
bm != item->
bm)) {
4107 PyErr_Format(PyExc_ValueError,
4108 "%s: %d %s is from another mesh",
4119 alloc[i] = item->
ele;
4121 if (do_unique_check) {
4127 if (do_unique_check) {
4130 for (i = 0; i < seq_len; i++) {
4141 i_last_dirty = PY_SSIZE_T_MAX;
4142 PyErr_Format(PyExc_ValueError,
4143 "%s: found the same %.200s used multiple times",
4157 if (do_unique_check && (i_last_dirty != PY_SSIZE_T_MAX)) {
4158 for (i = 0; i <= i_last_dirty; i++) {
4172 const bool do_unique_check,
4173 const bool do_bm_check,
4174 const char *error_prefix)
4179 if (!(seq_fast = PySequence_Fast(seq, error_prefix))) {
4184 r_bm, seq_fast,
min,
max, r_size, htype, do_unique_check, do_bm_check, error_prefix);
4186 Py_DECREF(seq_fast);
4193 PyObject *
ret = PyTuple_New(elem_len);
4194 for (i = 0; i < elem_len; i++) {
4202 PyObject *
ret = PyTuple_New(elem_len);
4203 for (i = 0; i < elem_len; i++) {
4211 PyObject *
ret = PyTuple_New(elem_len);
4212 for (i = 0; i < elem_len; i++) {
4221 PyObject *
ret = PyTuple_New(elem_len);
4222 for (i = 0; i < elem_len; i++) {
4231 PyObject *
ret = PyTuple_New(elem_len);
4232 for (i = 0; i < elem_len; i++) {
4255 char *ret_ptr =
ret;
4276 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, const bool preserve_all_data_layers, const bool preserve_origindex)
struct Mesh * mesh_get_eval_deform(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, 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(const int poly_count, const 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, const int size, const 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)
#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, Interp 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.
void BM_mesh_normals_update(BMesh *bm)
BMesh Compute Normals.
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)
Mesh -> BMesh.
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMeshParams *params)
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_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptris_tot)
BM_mesh_calc_tessellation get the looptris and its number from a certain bmesh.
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__()
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_min, int array_max, PyObject *value, const char *error_prefix)
#define BaseMath_ReadCallback(_self)
PyObject * Vector_CreatePyObject(const float *vec, const int size, PyTypeObject *base_type)
PyObject * Vector_CreatePyObject_wrap(float *vec, const int size, PyTypeObject *base_type)
PyObject * PyC_FlagSet_FromBitfield(PyC_FlagSet *items, int flag)
int PyC_FlagSet_ToBitfield(PyC_FlagSet *items, PyObject *value, int *r_value, const char *error_prefix)
void * PyC_RNA_AsPointer(PyObject *value, const char *type_name)
int PyC_Long_AsBool(PyObject *value)
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