76#define BPY_BM_HTYPE_NOLOOP "'VERT', 'EDGE', 'FACE'"
79#define BPY_BM_HFLAG_ALL_STR "'SELECT', 'HIDE', 'SEAM', 'SMOOTH', 'TAG'"
110 bpy_bm_elem_select_doc,
111 "Selected state of this element.\n"
116 bpy_bm_elem_hide_doc,
117 "Hidden state of this element.\n"
123 "Generic attribute scripts can use for own logic\n"
128 bpy_bm_elem_smooth_doc,
129 "Smooth state of this element.\n"
134 bpy_bm_elem_seam_doc,
135 "Seam for UV unwrapping.\n"
140 bpy_bm_elem_uv_select_doc,
141 "UV selected state of this element.\n"
176 bpy_bm_elem_index_doc,
177 "Index of this element.\n"
183 " This value is not necessarily valid, while editing the mesh it can become *dirty*.\n"
185 " It's also possible to assign any number to this attribute for a scripts internal logic.\n"
187 " To ensure the value is up to date - see :class:`bmesh.types.BMElemSeq.index_update`.\n");
201 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
209 self->bm->elem_index_dirty |=
self->ele->head.htype;
225 "This meshes vert sequence (read-only).\n"
227 ":type: :class:`bmesh.types.BMVertSeq`\n");
237 "This meshes edge sequence (read-only).\n"
239 ":type: :class:`bmesh.types.BMEdgeSeq`\n");
249 "This meshes face sequence (read-only).\n"
251 ":type: :class:`bmesh.types.BMFaceSeq`\n");
261 "This meshes loops (read-only).\n"
263 ":type: :class:`bmesh.types.BMLoopSeq`\n"
267 " Loops must be accessed via faces, this is only exposed for layer access.\n");
277 bpy_bmvert_link_edges_doc,
278 "Edges connected to this vertex (read-only).\n"
280 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMEdge`\n");
283 bpy_bmvert_link_faces_doc,
284 "Faces connected to this vertex (read-only).\n"
286 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMFace`\n");
289 bpy_bmvert_link_loops_doc,
290 "Loops that use this vertex (read-only).\n"
292 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMLoop`\n");
296 bpy_bmedge_verts_doc,
297 "Verts this edge uses (always 2), (read-only).\n"
299 ":type: :class:`bmesh.types.BMElemSeq` of "
300 ":class:`bmesh.types.BMVert`\n");
303 bpy_bmedge_link_faces_doc,
304 "Faces connected to this edge, (read-only).\n"
306 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMFace`\n");
309 bpy_bmedge_link_loops_doc,
310 "Loops connected to this edge, (read-only).\n"
312 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMLoop`\n");
316 bpy_bmface_verts_doc,
317 "Verts of this face, (read-only).\n"
319 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMVert`\n");
322 bpy_bmface_edges_doc,
323 "Edges of this face, (read-only).\n"
325 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMEdge`\n");
328 bpy_bmface_loops_doc,
329 "Loops of this face, (read-only).\n"
331 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMLoop`\n");
335 bpy_bmloops_link_loops_doc,
336 "Loops connected to this loop, (read-only).\n"
338 ":type: :class:`bmesh.types.BMElemSeq` of :class:`bmesh.types.BMLoop`\n");
349 "True when this element is valid (hasn't been removed).\n"
359 bpy_bmesh_is_wrapped_doc,
360 "True when this mesh is owned by blender (typically the editmode BMesh).\n"
372 bpy_bmesh_select_mode_doc,
373 "The selection mode, cannot be assigned an empty set.\n"
394 PyErr_SetString(PyExc_TypeError,
"bm.select_mode: cannot assign an empty value");
404 bpy_bmesh_select_history_doc,
405 "Sequence of selected items (the last is displayed as active).\n"
408 ":class:`bmesh.types.BMEditSelSeq`\n");
425 bpy_bmesh_uv_select_sync_valid_doc,
426 "When true, the UV selection has been synchronized. "
427 "Setting to False means the UV selection will be ignored. "
428 "While setting to true is supported it is up to the script author to "
429 "ensure a correct selection state before doing so.\n"
436 return PyBool_FromLong(
self->bm->uv_select_sync_valid);
447 self->bm->uv_select_sync_valid = param;
457 "The coordinates for this vertex as a 3D, wrapped vector.\n"
460 ":class:`mathutils.Vector`\n");
480 bpy_bmvert_normal_doc,
481 "The normal for this vertex as a 3D, wrapped vector.\n"
483 ":type: :class:`mathutils.Vector`\n");
503 bpy_bmvert_is_manifold_doc,
504 "True when this vertex is manifold (read-only).\n"
515 bpy_bmvert_is_wire_doc,
516 "True when this vertex is not connected to any faces (read-only).\n"
527 bpy_bmvert_is_boundary_doc,
528 "True when this vertex is connected to boundary edges (read-only).\n"
542 bpy_bmedge_is_manifold_doc,
543 "True when this edge is manifold (read-only).\n"
554 bpy_bmedge_is_contiguous_doc,
555 "True when this edge is manifold, between two faces with the same winding "
567 bpy_bmedge_is_convex_doc,
568 "True when this edge joins two convex faces, depends on a valid face normal (read-only).\n"
579 bpy_bmedge_is_wire_doc,
580 "True when this edge is not connected to any faces (read-only).\n"
591 bpy_bmedge_is_boundary_doc,
592 "True when this edge is at the boundary of a face (read-only).\n"
606 bpy_bmface_normal_doc,
607 "The normal for this face as a 3D, wrapped vector.\n"
609 ":type: :class:`mathutils.Vector`\n");
629 bpy_bmface_material_index_doc,
630 "The face's material index.\n"
636 return PyLong_FromLong(
self->f->mat_nr);
645 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
650 if ((param < 0) || (param >
MAXMAT)) {
652 PyErr_SetString(PyExc_ValueError,
"material index outside of usable range (0 - 32766)");
656 self->f->mat_nr = short(param);
666 "The loop's vertex (read-only).\n"
668 ":type: :class:`bmesh.types.BMVert`\n");
678 "The loop's edge (between this loop and the next), (read-only).\n"
680 ":type: :class:`bmesh.types.BMEdge`\n");
690 "The face this loop makes (read-only).\n"
692 ":type: :class:`bmesh.types.BMFace`\n");
701 bpy_bmloop_link_loop_next_doc,
702 "The next face corner (read-only).\n"
704 ":type: :class:`bmesh.types.BMLoop`\n");
713 bpy_bmloop_link_loop_prev_doc,
714 "The previous face corner (read-only).\n"
716 ":type: :class:`bmesh.types.BMLoop`\n");
725 bpy_bmloop_link_loop_radial_next_doc,
726 "The next loop around the edge (read-only).\n"
728 ":type: :class:`bmesh.types.BMLoop`\n");
737 bpy_bmloop_link_loop_radial_prev_doc,
738 "The previous loop around the edge (read-only).\n"
740 ":type: :class:`bmesh.types.BMLoop`\n");
749 bpy_bmloop_is_convex_doc,
750 "True when this loop is at the convex corner of a face, depends on a valid face "
751 "normal (read-only).\n"
766 bpy_bmelemseq_layers_vert_doc,
767 "custom-data layers (read-only).\n"
769 ":type: :class:`bmesh.types.BMLayerAccessVert`\n");
772 bpy_bmelemseq_layers_edge_doc,
773 "custom-data layers (read-only).\n"
775 ":type: :class:`bmesh.types.BMLayerAccessEdge`\n");
778 bpy_bmelemseq_layers_face_doc,
779 "custom-data layers (read-only).\n"
781 ":type: :class:`bmesh.types.BMLayerAccessFace`\n");
784 bpy_bmelemseq_layers_loop_doc,
785 "custom-data layers (read-only).\n"
787 ":type: :class:`bmesh.types.BMLayerAccessLoop`\n");
800 bpy_bmfaceseq_active_doc,
803 ":type: :class:`bmesh.types.BMFace` | None\n");
818 const char *error_prefix =
"faces.active = f";
820 if (value == Py_None) {
821 bm->act_face =
nullptr;
831 PyErr_Format(PyExc_TypeError,
832 "%s: expected BMFace or None, not %.200s",
834 Py_TYPE(value)->tp_name);
839 {
"verts", (getter)
bpy_bmvertseq_get, (setter)
nullptr, bpy_bmvertseq_doc,
nullptr},
840 {
"edges", (getter)
bpy_bmedgeseq_get, (setter)
nullptr, bpy_bmedgeseq_doc,
nullptr},
841 {
"faces", (getter)
bpy_bmfaceseq_get, (setter)
nullptr, bpy_bmfaceseq_doc,
nullptr},
842 {
"loops", (getter)
bpy_bmloopseq_get, (setter)
nullptr, bpy_bmloopseq_doc,
nullptr},
846 bpy_bmesh_select_mode_doc,
852 bpy_bmesh_select_history_doc,
855 {
"uv_select_sync_valid",
858 bpy_bmesh_uv_select_sync_valid_doc,
865 bpy_bmesh_is_wrapped_doc,
869 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
877 bpy_bm_elem_select_doc,
882 bpy_bm_elem_hide_doc,
892 bpy_bm_elem_index_doc,
899 bpy_bmvert_normal_doc,
906 bpy_bmvert_link_edges_doc,
911 bpy_bmvert_link_faces_doc,
916 bpy_bmvert_link_loops_doc,
923 bpy_bmvert_is_manifold_doc,
929 bpy_bmvert_is_boundary_doc,
933 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
941 bpy_bm_elem_select_doc,
946 bpy_bm_elem_hide_doc,
956 bpy_bm_elem_index_doc,
962 bpy_bm_elem_smooth_doc,
967 bpy_bm_elem_seam_doc,
974 bpy_bmedge_verts_doc,
980 bpy_bmedge_link_faces_doc,
985 bpy_bmedge_link_loops_doc,
992 bpy_bmedge_is_manifold_doc,
997 bpy_bmedge_is_contiguous_doc,
1002 bpy_bmedge_is_convex_doc,
1008 bpy_bmedge_is_boundary_doc,
1010 {
"is_valid", (getter)
bpy_bm_is_valid_get, (setter)
nullptr, bpy_bm_is_valid_doc,
nullptr},
1012 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1020 bpy_bm_elem_select_doc,
1025 bpy_bm_elem_hide_doc,
1030 bpy_bm_elem_tag_doc,
1035 bpy_bm_elem_uv_select_doc,
1040 bpy_bm_elem_index_doc,
1046 bpy_bm_elem_smooth_doc,
1052 bpy_bmface_normal_doc,
1058 bpy_bmface_material_index_doc,
1065 bpy_bmface_verts_doc,
1070 bpy_bmface_edges_doc,
1075 bpy_bmface_loops_doc,
1079 {
"is_valid", (getter)
bpy_bm_is_valid_get, (setter)
nullptr, bpy_bm_is_valid_doc,
nullptr},
1081 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1091 bpy_bm_elem_select_doc,
1096 bpy_bm_elem_hide_doc,
1102 bpy_bm_elem_tag_doc,
1107 bpy_bm_elem_uv_select_doc,
1112 bpy_bm_elem_uv_select_doc,
1117 bpy_bm_elem_index_doc,
1128 bpy_bmloops_link_loops_doc,
1133 bpy_bmloop_link_loop_next_doc,
1138 bpy_bmloop_link_loop_prev_doc,
1140 {
"link_loop_radial_next",
1143 bpy_bmloop_link_loop_radial_next_doc,
1145 {
"link_loop_radial_prev",
1148 bpy_bmloop_link_loop_radial_prev_doc,
1155 bpy_bmloop_is_convex_doc,
1157 {
"is_valid", (getter)
bpy_bm_is_valid_get, (setter)
nullptr, bpy_bm_is_valid_doc,
nullptr},
1159 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1166 bpy_bmelemseq_layers_vert_doc,
1168 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1174 bpy_bmelemseq_layers_edge_doc,
1176 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1182 bpy_bmelemseq_layers_face_doc,
1188 bpy_bmfaceseq_active_doc,
1190 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1196 bpy_bmelemseq_layers_loop_doc,
1198 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1210 ".. method:: copy()\n"
1212 " :return: A copy of this BMesh.\n"
1213 " :rtype: :class:`bmesh.types.BMesh`\n");
1225 PyErr_SetString(PyExc_SystemError,
"Unable to copy BMesh, internal error");
1231 bpy_bmesh_clear_doc,
1232 ".. method:: clear()\n"
1234 " Clear all mesh data.\n");
1249 ".. method:: free()\n"
1251 " Explicitly free the BMesh data from memory, causing exceptions on further access.\n"
1255 " The BMesh is freed automatically, typically when the script finishes executing.\n"
1256 " However in some cases its hard to predict when this will be and its useful to\n"
1257 " explicitly free the data.\n");
1267 bm->py_handle =
nullptr;
1281 bpy_bmesh_to_mesh_doc,
1282 ".. method:: to_mesh(mesh)\n"
1284 " Writes this BMesh data into an existing Mesh data-block.\n"
1286 " :arg mesh: The mesh data to write into.\n"
1287 " :type mesh: :class:`bpy.types.Mesh`\n");
1295 if (!PyArg_ParseTuple(args,
"O:to_mesh", &py_mesh) ||
1302 if (mesh->
runtime->edit_mesh) {
1303 PyErr_Format(PyExc_ValueError,
"to_mesh(): Mesh '%s' is in editmode", mesh->
id.
name + 2);
1309 Main *bmain =
nullptr;
1311 params.update_shapekey_indices =
true;
1319 params.calc_object_remap =
true;
1333 bpy_bmesh_from_object_doc,
1334 ".. method:: from_object(object, depsgraph, *, "
1335 "cage=False, face_normals=True, vertex_normals=True)\n"
1337 " Initialize this bmesh from existing object data-block (only meshes are currently "
1340 " :arg object: The object data to load.\n"
1341 " :type object: :class:`bpy.types.Object`\n"
1342 " :type depsgraph: :class:`bpy.types.Depsgraph`\n"
1343 " :arg cage: Get the mesh as a deformed cage.\n"
1344 " :type cage: bool\n"
1345 " :arg face_normals: Calculate face normals.\n"
1346 " :type face_normals: bool\n"
1347 " :arg vertex_normals: Calculate vertex normals.\n"
1348 " :type vertex_normals: bool\n");
1351 static const char *kwlist[] = {
1352 "object",
"depsgraph",
"cage",
"face_normals",
"vertex_normals",
nullptr};
1353 PyObject *py_object;
1354 PyObject *py_depsgraph;
1358 const Mesh *mesh_eval;
1359 bool use_cage =
false;
1360 bool use_fnorm =
true;
1361 bool use_vert_normal =
true;
1366 if (!PyArg_ParseTupleAndKeywords(args,
1368 "OO|$O&O&O&:from_object",
1377 &use_vert_normal) ||
1385 PyErr_SetString(PyExc_ValueError,
1386 "from_object(...): currently only mesh objects are supported");
1393 bool need_free =
false;
1398 PyErr_SetString(PyExc_ValueError,
1399 "from_object(...): cage arg is unsupported when dependency graph "
1400 "evaluation mode is RENDER");
1416 if (mesh_eval ==
nullptr) {
1417 PyErr_Format(PyExc_ValueError,
1418 "from_object(...): Object '%s' has no usable mesh data",
1426 params.calc_face_normal = use_fnorm;
1427 params.calc_vert_normal = use_vert_normal;
1439 bpy_bmesh_from_mesh_doc,
1440 ".. method:: from_mesh(mesh, *, "
1441 "face_normals=True, vertex_normals=True, use_shape_key=False, shape_key_index=0)\n"
1443 " Initialize this bmesh from existing mesh data-block.\n"
1445 " :arg mesh: The mesh data to load.\n"
1446 " :type mesh: :class:`bpy.types.Mesh`\n"
1447 " :type face_normals: bool\n"
1448 " :type vertex_normals: bool\n"
1449 " :arg use_shape_key: Use the locations from a shape key.\n"
1450 " :type use_shape_key: bool\n"
1451 " :arg shape_key_index: The shape key index to use.\n"
1452 " :type shape_key_index: int\n"
1456 " Multiple calls can be used to join multiple meshes.\n"
1458 " Custom-data layers are only copied from ``mesh`` on initialization.\n"
1459 " Further calls will copy custom-data to matching layers, layers missing on the target "
1460 "mesh won't be added.\n");
1463 static const char *kwlist[] = {
1464 "mesh",
"face_normals",
"vertex_normals",
"use_shape_key",
"shape_key_index",
nullptr};
1467 bool use_fnorm =
true;
1468 bool use_vert_normal =
true;
1469 bool use_shape_key =
false;
1470 int shape_key_index = 0;
1474 if (!PyArg_ParseTupleAndKeywords(args,
1476 "O|$O&O&O&i:from_mesh",
1485 &shape_key_index) ||
1494 params.calc_face_normal = use_fnorm;
1495 params.calc_vert_normal = use_vert_normal;
1496 params.use_shapekey = use_shape_key;
1497 params.active_shapekey = shape_key_index + 1;
1505 bpy_bmesh_select_flush_mode_doc,
1506 ".. method:: select_flush_mode(*, flush_down=False)\n"
1508 " Flush selection based on the current mode current "
1509 ":class:`bmesh.types.BMesh.select_mode`.\n"
1511 " :arg flush_down: Flush selection down from faces to edges & verts or from edges to verts. "
1512 "This option is ignored when vertex selection mode is enabled.\n"
1513 " :type flush_down: bool\n");
1518 bool flush_down =
false;
1521 static const char *kwlist[] = {
1525 if (!PyArg_ParseTupleAndKeywords(args,
1529 ":select_flush_mode",
1548 bpy_bmesh_select_flush_doc,
1549 ".. method:: select_flush(select)\n"
1551 " Flush selection from vertices, independent of the current selection mode.\n"
1553 " :arg select: flush selection or de-selected elements.\n"
1554 " :type select: bool\n");
1574 bpy_bmesh_uv_select_flush_mode_doc,
1575 ".. method:: uv_select_flush_mode(*, flush_down=False)\n"
1577 " Flush selection based on the current mode current :class:`BMesh.select_mode`.\n"
1579 " :arg flush_down: Flush selection down from faces to edges & verts or from edges to verts. "
1580 "This option is ignored when vertex selection mode is enabled.\n"
1581 " :type flush_down: bool\n");
1587 bool flush_down =
false;
1588 static const char *kwlist[] = {
1592 if (!PyArg_ParseTupleAndKeywords(args,
1596 ":uv_select_flush_mode",
1610 bpy_bmesh_uv_select_flush_doc,
1611 ".. method:: uv_select_flush(select)\n"
1613 " Flush selection from UV vertices to edges & faces independent of the selection mode.\n"
1615 " :arg select: Flush selection or de-selected elements.\n"
1616 " :type select: bool\n"
1620 " - |UV_SELECT_SYNC_TO_MESH_NEEDED|\n");
1623 const char *error_prefix =
"uv_select_flush(...)";
1643 bpy_bmesh_uv_select_flush_shared_doc,
1644 ".. method:: uv_select_flush_shared(select)\n"
1646 " Flush selection from UV vertices to contiguous UV's independent of the selection mode.\n"
1648 " :arg select: Flush selection or de-selected elements.\n"
1649 " :type select: bool\n"
1653 " - |UV_SELECT_SYNC_TO_MESH_NEEDED|\n");
1656 const char *error_prefix =
"uv_select_flush_shared(...)";
1681 bpy_bmesh_uv_select_sync_from_mesh_doc,
1682 ".. method:: uv_select_sync_from_mesh(*, "
1683 "sticky_select_mode='SHARED_LOCATION')\n"
1685 " Sync selection from mesh to UVs.\n"
1687 " :arg sticky_select_mode: Behavior when flushing from the mesh to UV selection "
1688 "|UV_STICKY_SELECT_MODE_REF|. "
1689 "This should only be used when preparing to create a UV selection.\n"
1690 " :type sticky_select_mode: |UV_STICKY_SELECT_MODE_TYPE|\n"
1694 " - |UV_SELECT_SYNC_TO_MESH_NEEDED|\n");
1697 static const char *kwlist[] = {
1698 "sticky_select_mode",
1706 if (!PyArg_ParseTupleAndKeywords(args,
1710 ":uv_select_sync_from_mesh",
1713 &uv_sticky_select_mode))
1722 if (cd_loop_uv_offset == -1) {
1723 PyErr_SetString(PyExc_ValueError,
"sticky_select_mode='SHARED_LOCATION' requires UV's");
1744 bpy_bmesh_uv_select_sync_to_mesh_doc,
1745 ".. method:: uv_select_sync_to_mesh()\n"
1747 " Sync selection from UVs to the mesh.\n");
1750 const char *error_prefix =
"uv_select_sync_to_mesh(...)";
1764 bpy_bmesh_uv_select_foreach_set_doc,
1765 ".. method:: uv_select_foreach_set(select, /, *, "
1766 "loop_verts=(), loop_edges=(), faces=(), sticky_select_mode='SHARED_LOCATION')\n"
1768 " Set the UV selection state for loop-vertices, loop-edges & faces.\n"
1770 " This is a close equivalent to selecting in the UV editor.\n"
1772 " :arg select: The selection state to set.\n"
1773 " :type select: bool\n"
1774 " :arg loop_verts: Loop verts to operate on.\n"
1775 " :type loop_verts: Iterable[:class:`bmesh.types.BMLoop`]\n"
1776 " :arg loop_edges: Loop edges to operate on.\n"
1777 " :type loop_edges: Iterable[:class:`bmesh.types.BMLoop`]\n"
1778 " :arg faces: Faces to operate on.\n"
1779 " :type faces: Iterable[:class:`bmesh.types.BMFace`]\n"
1780 " :arg sticky_select_mode: See |UV_STICKY_SELECT_MODE_REF|.\n"
1781 " :type sticky_select_mode: |UV_STICKY_SELECT_MODE_TYPE|\n"
1785 " - |UV_SELECT_FLUSH_MODE_NEEDED|\n"
1786 " - |UV_SELECT_SYNC_TO_MESH_NEEDED|\n");
1789 const char *error_prefix =
"uv_select_foreach_set(...)";
1790 static const char *kwlist[] = {
1795 "sticky_select_mode",
1799 bool use_select =
false;
1800 PyObject *py_loop_verts =
nullptr;
1801 PyObject *py_loop_edges =
nullptr;
1802 PyObject *py_faces =
nullptr;
1807 if (!PyArg_ParseTupleAndKeywords(args,
1815 ":uv_select_foreach_set",
1823 &uv_sticky_select_mode))
1834 if (
shared && (cd_loop_uv_offset == -1)) {
1838 Py_ssize_t loop_vert_array_num = 0;
1839 Py_ssize_t loop_edge_array_num = 0;
1840 Py_ssize_t face_array_num = 0;
1841 BMLoop **loop_vert_array =
nullptr;
1842 BMLoop **loop_edge_array =
nullptr;
1843 BMFace **face_array =
nullptr;
1846 if (ok && py_loop_verts) {
1847 BMesh *bm_test =
nullptr;
1852 &loop_vert_array_num,
1863 if (ok && py_loop_edges) {
1864 BMesh *bm_test =
nullptr;
1869 &loop_edge_array_num,
1880 if (ok && py_faces) {
1881 BMesh *bm_test =
nullptr;
1883 &bm_test, py_faces, 0, PY_SSIZE_T_MAX, &face_array_num,
true,
true, error_prefix)))
1902 PyMem_FREE(loop_vert_array);
1903 PyMem_FREE(loop_edge_array);
1904 PyMem_FREE(face_array);
1915 bpy_bmesh_uv_select_foreach_set_from_mesh_doc,
1916 ".. method:: uv_select_foreach_set_from_mesh(select, /, *, "
1917 "verts=(), edges=(), faces=(), sticky_select_mode='SHARED_LOCATION')\n"
1919 " Select or de-select mesh elements, updating the UV selection.\n"
1921 " An equivalent to selecting from the 3D viewport "
1922 "for selection operations that support maintaining a synchronized UV selection.\n"
1924 " :arg select: The selection state to set.\n"
1925 " :type select: bool\n"
1926 " :arg verts: Verts to operate on.\n"
1927 " :type verts: Iterable[:class:`bmesh.types.BMVert`]\n"
1928 " :arg edges: Edges to operate on.\n"
1929 " :type edges: Iterable[:class:`bmesh.types.BMEdge`]\n"
1930 " :arg faces: Faces to operate on.\n"
1931 " :type faces: Iterable[:class:`bmesh.types.BMFace`]\n"
1932 " :arg sticky_select_mode: See |UV_STICKY_SELECT_MODE_REF|.\n"
1933 " :type sticky_select_mode: |UV_STICKY_SELECT_MODE_TYPE|\n");
1938 const char *error_prefix =
"uv_select_foreach_set_from_mesh(...)";
1939 static const char *kwlist[] = {
1944 "sticky_select_mode",
1947 bool use_select =
false;
1948 PyObject *py_verts =
nullptr;
1949 PyObject *py_edges =
nullptr;
1950 PyObject *py_faces =
nullptr;
1955 if (!PyArg_ParseTupleAndKeywords(args,
1963 ":uv_select_foreach_set_from_mesh",
1971 &uv_sticky_select_mode))
1982 if (
shared && (cd_loop_uv_offset == -1)) {
1986 Py_ssize_t vert_array_num = 0;
1987 Py_ssize_t edge_array_num = 0;
1988 Py_ssize_t face_array_num = 0;
1989 BMVert **vert_array =
nullptr;
1990 BMEdge **edge_array =
nullptr;
1991 BMFace **face_array =
nullptr;
1994 if (ok && py_verts) {
1995 BMesh *bm_test =
nullptr;
1997 &bm_test, py_verts, 0, PY_SSIZE_T_MAX, &vert_array_num,
true,
true, error_prefix)))
2005 if (ok && py_edges) {
2006 BMesh *bm_test =
nullptr;
2008 &bm_test, py_edges, 0, PY_SSIZE_T_MAX, &edge_array_num,
true,
true, error_prefix)))
2016 if (ok && py_faces) {
2017 BMesh *bm_test =
nullptr;
2019 &bm_test, py_faces, 0, PY_SSIZE_T_MAX, &face_array_num,
true,
true, error_prefix)))
2041 PyMem_FREE(vert_array);
2042 PyMem_FREE(edge_array);
2043 PyMem_FREE(face_array);
2056 bpy_bmesh_normal_update_doc,
2057 ".. method:: normal_update()\n"
2059 " Update normals of mesh faces and verts.\n"
2063 " The normal of any vertex where :attr:`is_wire` is True will be a zero vector.\n");
2075 bpy_bmesh_transform_doc,
2076 ".. method:: transform(matrix, *, filter=None)\n"
2078 " Transform the mesh (optionally filtering flagged data only).\n"
2080 " :arg matrix: 4x4x transform matrix.\n"
2081 " :type matrix: :class:`mathutils.Matrix`\n"
2082 " :arg filter: Flag to filter vertices."
2087 static const char *kwlist[] = {
"matrix",
"filter",
nullptr};
2090 PyObject *
filter =
nullptr;
2091 int filter_flags = 0;
2095 if (!PyArg_ParseTupleAndKeywords(
2096 args, kw,
"O!|$O!:transform", (
char **)kwlist, &
matrix_Type, &mat, &PySet_Type, &
filter))
2109 PyErr_SetString(PyExc_ValueError,
"expected a 4x4 matrix");
2119 mat_ptr = mat->matrix;
2121 if (!filter_flags) {
2127 const char filter_flags_ch = char(filter_flags);
2140 bpy_bmesh_calc_volume_doc,
2141 ".. method:: calc_volume(*, signed=False)\n"
2143 " Calculate mesh volume based on face normals.\n"
2145 " :arg signed: when signed is true, negative values may be returned.\n"
2146 " :type signed: bool\n"
2147 " :return: The volume of the mesh.\n"
2148 " :rtype: float\n");
2151 static const char *kwlist[] = {
"signed",
nullptr};
2152 PyObject *is_signed = Py_False;
2156 if (!PyArg_ParseTupleAndKeywords(
2157 args, kw,
"|$O!:calc_volume", (
char **)kwlist, &PyBool_Type, &is_signed))
2167 bpy_bmesh_calc_loop_triangles_doc,
2168 ".. method:: calc_loop_triangles()\n"
2170 " Calculate triangle tessellation from quads/ngons.\n"
2172 " :return: The triangulated faces.\n"
2173 " :rtype: list[tuple[:class:`bmesh.types.BMLoop`, "
2174 ":class:`bmesh.types.BMLoop`, "
2175 ":class:`bmesh.types.BMLoop`]]\n");
2178 int corner_tris_tot;
2190 ret = PyList_New(corner_tris_tot);
2191 for (
int i = 0;
i < corner_tris_tot;
i++) {
2203 bpy_bm_elem_select_set_doc,
2204 ".. method:: select_set(select)\n"
2206 " Set the selection.\n"
2207 " This is different from the *select* attribute because it updates the selection "
2208 "state of associated geometry.\n"
2210 " :arg select: Select or de-select.\n"
2211 " :type select: bool\n"
2215 " This only flushes down, so selecting a face will select all its "
2216 "vertices but de-selecting a vertex "
2217 " won't de-select all the faces that use it, before finishing with a mesh "
2218 "typically flushing is still needed.\n");
2236 bpy_bm_elem_hide_set_doc,
2237 ".. method:: hide_set(hide)\n"
2239 " Set the hide state.\n"
2240 " This is different from the *hide* attribute because it updates the selection and "
2241 "hide state of associated geometry.\n"
2243 " :arg hide: Hidden or visible.\n"
2244 " :type hide: bool\n");
2262 bpy_bm_elem_copy_from_doc,
2263 ".. method:: copy_from(other)\n"
2265 " Copy values from another element of matching type.\n");
2270 if (Py_TYPE(
self) != Py_TYPE(value)) {
2271 PyErr_Format(PyExc_TypeError,
2272 "expected element of type '%.200s' not '%.200s'",
2273 Py_TYPE(
self)->tp_name,
2274 Py_TYPE(value)->tp_name);
2278 if (value->
ele !=
self->ele) {
2279 switch (
self->ele->head.htype) {
2285 reinterpret_cast<const BMVert *
>(value->
ele),
2294 reinterpret_cast<const BMEdge *
>(value->
ele),
2303 reinterpret_cast<const BMFace *
>(value->
ele),
2312 reinterpret_cast<const BMLoop *
>(value->
ele),
2327 bpy_bmvert_copy_from_vert_interp_doc,
2328 ".. method:: copy_from_vert_interp(vert_pair, fac)\n"
2330 " Interpolate the customdata from a vert between 2 other verts.\n"
2332 " :arg vert_pair: The verts between which to interpolate data from.\n"
2333 " :type vert_pair: Sequence[:class:`bmesh.types.BMVert`]\n"
2334 " :type fac: float\n");
2337 const char *error_prefix =
"BMVert.copy_from_vert_interp(...)";
2343 if (!PyArg_ParseTuple(args,
"Of:BMVert.copy_from_vert_interp", &vert_seq, &fac)) {
2349 Py_ssize_t vert_seq_num;
2351 &
bm, vert_seq, 2, 2, &vert_seq_num,
true,
true, error_prefix);
2353 if (vert_array ==
nullptr) {
2359 PyMem_FREE(vert_array);
2365 bpy_bmvert_copy_from_face_interp_doc,
2366 ".. method:: copy_from_face_interp(face)\n"
2368 " Interpolate the customdata from a face onto this loop (the loops vert should "
2369 "overlap the face).\n"
2371 " :arg face: The face to interpolate data from.\n"
2372 " :type face: :class:`bmesh.types.BMFace`\n");
2375 const char *error_prefix =
"copy_from_face_interp(...)";
2380 if (!PyArg_ParseTuple(args,
"O!:BMVert.copy_from_face_interp", &
BPy_BMFace_Type, &py_face)) {
2395 bpy_bmvert_calc_edge_angle_doc,
2396 ".. method:: calc_edge_angle(fallback=None)\n"
2398 " Return the angle between this vert's two connected edges.\n"
2400 " :arg fallback: return this when the vert doesn't have 2 edges\n"
2401 " (instead of raising a :exc:`ValueError`).\n"
2402 " :type fallback: Any\n"
2403 " :return: Angle between edges in radians.\n"
2404 " :rtype: float\n");
2407 const float angle_invalid = -1.0f;
2409 PyObject *fallback =
nullptr;
2413 if (!PyArg_ParseTuple(args,
"|O:calc_edge_angle", &fallback)) {
2419 if (
angle == angle_invalid) {
2422 Py_INCREF(fallback);
2426 PyErr_SetString(PyExc_ValueError,
2427 "BMVert.calc_edge_angle(): "
2428 "vert must connect to exactly 2 edges");
2432 return PyFloat_FromDouble(
angle);
2437 bpy_bmvert_calc_shell_factor_doc,
2438 ".. method:: calc_shell_factor()\n"
2440 " Return a multiplier calculated based on the sharpness of the vertex.\n"
2441 " Where a flat surface gives 1.0, and higher values sharper edges.\n"
2442 " This is used to maintain shell thickness when offsetting verts along their normals.\n"
2444 " :return: offset multiplier\n"
2445 " :rtype: float\n");
2454 bpy_bmvert_normal_update_doc,
2455 ".. method:: normal_update()\n"
2457 " Update vertex normal.\n"
2458 " This does not update the normals of adjoining faces.\n"
2462 " The vertex normal will be a zero vector if vertex :attr:`is_wire` is True.\n");
2477 bpy_bmedge_calc_length_doc,
2478 ".. method:: calc_length()\n"
2480 " :return: The length between both verts.\n"
2481 " :rtype: float\n");
2490 bpy_bmedge_calc_face_angle_doc,
2491 ".. method:: calc_face_angle(fallback=None)\n"
2493 " :arg fallback: return this when the edge doesn't have 2 faces\n"
2494 " (instead of raising a :exc:`ValueError`).\n"
2495 " :type fallback: Any\n"
2496 " :return: The angle between 2 connected faces in radians.\n"
2497 " :rtype: float\n");
2500 const float angle_invalid = -1.0f;
2502 PyObject *fallback =
nullptr;
2506 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle", &fallback)) {
2512 if (
angle == angle_invalid) {
2515 Py_INCREF(fallback);
2519 PyErr_SetString(PyExc_ValueError,
2520 "BMEdge.calc_face_angle(): "
2521 "edge doesn't use 2 faces");
2525 return PyFloat_FromDouble(
angle);
2530 bpy_bmedge_calc_face_angle_signed_doc,
2531 ".. method:: calc_face_angle_signed(fallback=None)\n"
2533 " :arg fallback: return this when the edge doesn't have 2 faces\n"
2534 " (instead of raising a :exc:`ValueError`).\n"
2535 " :type fallback: Any\n"
2536 " :return: The angle between 2 connected faces in radians (negative for concave join).\n"
2537 " :rtype: float\n");
2540 const float angle_invalid = -
FLT_MAX;
2542 PyObject *fallback =
nullptr;
2546 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle_signed", &fallback)) {
2552 if (
angle == angle_invalid) {
2555 Py_INCREF(fallback);
2559 PyErr_SetString(PyExc_ValueError,
2560 "BMEdge.calc_face_angle_signed(): "
2561 "edge doesn't use 2 faces");
2565 return PyFloat_FromDouble(
angle);
2570 bpy_bmedge_calc_tangent_doc,
2571 ".. method:: calc_tangent(loop)\n"
2573 " Return the tangent at this edge relative to a face (pointing inward into the face).\n"
2574 " This uses the face normal for calculation.\n"
2576 " :arg loop: The loop used for tangent calculation.\n"
2577 " :type loop: :class:`bmesh.types.BMLoop`\n"
2578 " :return: a normalized vector.\n"
2579 " :rtype: :class:`mathutils.Vector`\n");
2585 if (!PyArg_ParseTuple(args,
"O!:BMEdge.calc_face_tangent", &
BPy_BMLoop_Type, &py_loop)) {
2598 bpy_bmedge_other_vert_doc,
2599 ".. method:: other_vert(vert)\n"
2601 " Return the other vertex on this edge or None if the vertex is not used by this edge.\n"
2603 " :arg vert: a vert in this edge.\n"
2604 " :type vert: :class:`bmesh.types.BMVert`\n"
2605 " :return: The edges other vert.\n"
2606 " :rtype: :class:`bmesh.types.BMVert` | None\n");
2609 const char *error_prefix =
"BMEdge.other_vert(...)";
2614 PyErr_Format(PyExc_TypeError,
2615 "%s: BMVert expected, not '%.200s'",
2617 Py_TYPE(value)->tp_name);
2635 bpy_bmedge_normal_update_doc,
2636 ".. method:: normal_update()\n"
2638 " Update normals of all connected faces and the edge verts.\n"
2642 " The normal of edge vertex will be a zero vector if vertex :attr:`is_wire` is True.\n");
2657 bpy_bmface_copy_from_face_interp_doc,
2658 ".. method:: copy_from_face_interp(face, vert=True)\n"
2660 " Interpolate the customdata from another face onto this one (faces should overlap).\n"
2662 " :arg face: The face to interpolate data from.\n"
2663 " :type face: :class:`bmesh.types.BMFace`\n"
2664 " :arg vert: When True, also copy vertex data.\n"
2665 " :type vert: bool\n");
2668 const char *error_prefix =
"BMFace.copy_from_face_interp(...)";
2670 bool do_vertex =
true;
2674 if (!PyArg_ParseTuple(args,
2675 "O!|O&:BMFace.copy_from_face_interp",
2695 bpy_bmface_copy_doc,
2696 ".. method:: copy(*, verts=True, edges=True)\n"
2698 " Make a copy of this face.\n"
2700 " :arg verts: When set, the faces verts will be duplicated too.\n"
2701 " :type verts: bool\n"
2702 " :arg edges: When set, the faces edges will be duplicated too.\n"
2703 " :type edges: bool\n"
2704 " :return: The newly created face.\n"
2705 " :rtype: :class:`bmesh.types.BMFace`\n");
2708 static const char *kwlist[] = {
"verts",
"edges",
nullptr};
2711 bool do_verts =
true;
2712 bool do_edges =
true;
2717 if (!PyArg_ParseTupleAndKeywords(args,
2719 "|$O&O&:BMFace.copy",
2735 PyErr_SetString(PyExc_ValueError,
"BMFace.copy(): couldn't create the new face, internal error");
2741 bpy_bmface_uv_select_set_doc,
2742 ".. method:: uv_select_set(select)\n"
2744 " Select the face.\n"
2746 " :arg select: Select or de-select.\n"
2747 " :type select: bool\n"
2751 " Currently this only flushes down, so selecting a face will select all its "
2752 "vertices but de-selecting a vertex "
2753 " won't de-select all the faces that use it, before finishing with a mesh "
2754 "typically flushing is still needed.\n");
2769 bpy_bmface_calc_area_doc,
2770 ".. method:: calc_area()\n"
2772 " Return the area of the face.\n"
2774 " :return: Return the area of the face.\n"
2775 " :rtype: float\n");
2784 bpy_bmface_calc_perimeter_doc,
2785 ".. method:: calc_perimeter()\n"
2787 " Return the perimeter of the face.\n"
2789 " :return: Return the perimeter of the face.\n"
2790 " :rtype: float\n");
2799 bpy_bmface_calc_tangent_edge_doc,
2800 ".. method:: calc_tangent_edge()\n"
2802 " Return face tangent based on longest edge.\n"
2804 " :return: a normalized vector.\n"
2805 " :rtype: :class:`mathutils.Vector`\n");
2817 bpy_bmface_calc_tangent_edge_pair_doc,
2818 ".. method:: calc_tangent_edge_pair()\n"
2820 " Return face tangent based on the two longest disconnected edges.\n"
2822 " - Tris: Use the edge pair with the most similar lengths.\n"
2823 " - Quads: Use the longest edge pair.\n"
2824 " - NGons: Use the two longest disconnected edges.\n"
2826 " :return: a normalized vector.\n"
2827 " :rtype: :class:`mathutils.Vector`\n");
2839 bpy_bmface_calc_tangent_edge_diagonal_doc,
2840 ".. method:: calc_tangent_edge_diagonal()\n"
2842 " Return face tangent based on the edge farthest from any vertex.\n"
2844 " :return: a normalized vector.\n"
2845 " :rtype: :class:`mathutils.Vector`\n");
2857 bpy_bmface_calc_tangent_vert_diagonal_doc,
2858 ".. method:: calc_tangent_vert_diagonal()\n"
2860 " Return face tangent based on the two most distant vertices.\n"
2862 " :return: a normalized vector.\n"
2863 " :rtype: :class:`mathutils.Vector`\n");
2875 bpy_bmface_calc_center_median_doc,
2876 ".. method:: calc_center_median()\n"
2878 " Return median center of the face.\n"
2880 " :return: a 3D vector.\n"
2881 " :rtype: :class:`mathutils.Vector`\n");
2893 bpy_bmface_calc_center_median_weighted_doc,
2894 ".. method:: calc_center_median_weighted()\n"
2896 " Return median center of the face weighted by edge lengths.\n"
2898 " :return: a 3D vector.\n"
2899 " :rtype: :class:`mathutils.Vector`\n");
2911 bpy_bmface_calc_center_bounds_doc,
2912 ".. method:: calc_center_bounds()\n"
2914 " Return bounds center of the face.\n"
2916 " :return: a 3D vector.\n"
2917 " :rtype: :class:`mathutils.Vector`\n");
2929 bpy_bmface_normal_update_doc,
2930 ".. method:: normal_update()\n"
2932 " Update face normal based on the positions of the face verts.\n"
2933 " This does not update the normals of face verts.\n");
2945 bpy_bmface_normal_flip_doc,
2946 ".. method:: normal_flip()\n"
2948 " Reverses winding of a face, which flips its normal.\n");
2963 bpy_bmloop_copy_from_face_interp_doc,
2964 ".. method:: copy_from_face_interp(face, vert=True, multires=True)\n"
2966 " Interpolate the customdata from a face onto this loop (the loops vert should "
2967 "overlap the face).\n"
2969 " :arg face: The face to interpolate data from.\n"
2970 " :type face: :class:`bmesh.types.BMFace`\n"
2971 " :arg vert: When enabled, interpolate the loops vertex data (optional).\n"
2972 " :type vert: bool\n"
2973 " :arg multires: When enabled, interpolate the loops multires data (optional).\n"
2974 " :type multires: bool\n");
2977 const char *error_prefix =
"BMLoop.copy_from_face_interp(face)";
2979 bool do_vertex =
true;
2980 bool do_multires =
true;
2984 if (!PyArg_ParseTuple(args,
2985 "O!|O&O&:BMLoop.copy_from_face_interp",
3007 bpy_bmloop_uv_select_vert_set_doc,
3008 ".. method:: uv_select_vert_set(select)\n"
3010 " Select the UV vertex.\n"
3012 " :arg select: Select or de-select.\n"
3013 " :type select: bool\n"
3017 " Currently this only flushes down, so selecting an edge will select all its "
3018 "vertices but de-selecting a vertex "
3019 " won't de-select the edges & faces that use it, before finishing with a mesh "
3020 "typically flushing with :class:`bmesh.types.BMesh.uv_select_flush_mode` is still needed.\n");
3038 bpy_bmloop_uv_select_edge_set_doc,
3039 ".. method:: uv_select_edge_set(select)\n"
3041 " Set the UV edge selection state.\n"
3043 " :arg select: Select or de-select.\n"
3044 " :type select: bool\n"
3048 " This only flushes down, so selecting an edge will select all its "
3049 "vertices but de-selecting a vertex "
3050 "won't de-select the faces that use it, before finishing with a mesh "
3051 "typically flushing with :class:`bmesh.types.BMesh.uv_select_flush_mode` is still needed.\n");
3066 bpy_bmloop_calc_angle_doc,
3067 ".. method:: calc_angle()\n"
3069 " Return the angle at this loops corner of the face.\n"
3070 " This is calculated so sharper corners give lower angles.\n"
3072 " :return: The angle in radians.\n"
3073 " :rtype: float\n");
3082 bpy_bmloop_calc_normal_doc,
3083 ".. method:: calc_normal()\n"
3085 " Return normal at this loops corner of the face.\n"
3086 " Falls back to the face normal for straight lines.\n"
3088 " :return: a normalized vector.\n"
3089 " :rtype: :class:`mathutils.Vector`\n");
3100 bpy_bmloop_calc_tangent_doc,
3101 ".. method:: calc_tangent()\n"
3103 " Return the tangent at this loops corner of the face (pointing inward into the face).\n"
3104 " Falls back to the face normal for straight lines.\n"
3106 " :return: a normalized vector.\n"
3107 " :rtype: :class:`mathutils.Vector`\n");
3120 bpy_bmvertseq_new_doc,
3121 ".. method:: new(co=(0.0, 0.0, 0.0), example=None)\n"
3123 " Create a new vertex.\n"
3125 " :arg co: The initial location of the vertex (optional argument).\n"
3126 " :type co: float triplet\n"
3127 " :arg example: Existing vert to initialize settings.\n"
3128 " :type example: :class:`bmesh.types.BMVert`\n"
3129 " :return: The newly created vertex.\n"
3130 " :rtype: :class:`bmesh.types.BMVert`\n");
3133 PyObject *py_co =
nullptr;
3138 if (!PyArg_ParseTuple(args,
"|OO!:verts.new", &py_co, &
BPy_BMVert_Type, &py_vert_example)) {
3144 float co[3] = {0.0f, 0.0f, 0.0f};
3146 if (py_vert_example) {
3157 PyErr_SetString(PyExc_ValueError,
3158 "faces.new(verts): couldn't create the new face, internal error");
3162 if (py_vert_example) {
3163 if (py_vert_example->
bm ==
bm) {
3180 bpy_bmedgeseq_new_doc,
3181 ".. method:: new(verts, example=None)\n"
3183 " Create a new edge from a given pair of verts.\n"
3185 " :arg verts: Vertex pair.\n"
3186 " :type verts: Sequence[:class:`bmesh.types.BMVert`]\n"
3187 " :arg example: Existing edge to initialize settings (optional argument).\n"
3188 " :type example: :class:`bmesh.types.BMEdge`\n"
3189 " :return: The newly created edge.\n"
3190 " :rtype: :class:`bmesh.types.BMEdge`\n");
3193 const char *error_prefix =
"edges.new(...)";
3199 if (!PyArg_ParseTuple(args,
"O|O!:edges.new", &vert_seq, &
BPy_BMEdge_Type, &py_edge_example)) {
3205 PyObject *
ret =
nullptr;
3207 if (py_edge_example) {
3211 Py_ssize_t vert_seq_num;
3213 &
bm, vert_seq, 2, 2, &vert_seq_num,
true,
true, error_prefix);
3214 if (vert_array ==
nullptr) {
3219 PyErr_SetString(PyExc_ValueError,
"edges.new(): this edge exists");
3226 PyErr_SetString(PyExc_ValueError,
3227 "faces.new(verts): couldn't create the new face, internal error");
3231 if (py_edge_example) {
3232 if (py_edge_example->
bm ==
bm) {
3246 PyMem_FREE(vert_array);
3255 bpy_bmfaceseq_new_doc,
3256 ".. method:: new(verts, example=None)\n"
3258 " Create a new face from a given set of verts.\n"
3260 " :arg verts: Sequence of 3 or more verts.\n"
3261 " :type verts: Sequence[:class:`bmesh.types.BMVert`]\n"
3262 " :arg example: Existing face to initialize settings (optional argument).\n"
3263 " :type example: :class:`bmesh.types.BMFace`\n"
3264 " :return: The newly created face.\n"
3265 " :rtype: :class:`bmesh.types.BMFace`\n");
3268 const char *error_prefix =
"faces.new(...)";
3274 if (!PyArg_ParseTuple(args,
"O|O!:faces.new", &vert_seq, &
BPy_BMFace_Type, &py_face_example)) {
3280 PyObject *
ret =
nullptr;
3284 if (py_face_example) {
3288 Py_ssize_t vert_seq_num;
3290 &
bm, vert_seq, 3, PY_SSIZE_T_MAX, &vert_seq_num,
true,
true, error_prefix);
3291 if (vert_array ==
nullptr) {
3297 PyErr_Format(PyExc_ValueError,
"%s: face already exists", error_prefix);
3307 py_face_example ? py_face_example->
f :
nullptr,
3313 PyExc_ValueError,
"%s: couldn't create the new face, internal error", error_prefix);
3322 PyMem_FREE(vert_array);
3332 bpy_bmvertseq_remove_doc,
3333 ".. method:: remove(vert)\n"
3337 " :type vert: :class:`bmesh.types.BMVert`\n");
3340 const char *error_prefix =
"verts.remove(vert)";
3359 bpy_bmedgeseq_remove_doc,
3360 ".. method:: remove(edge)\n"
3362 " Remove an edge.\n"
3364 " :type edge: :class:`bmesh.types.BMEdge`\n");
3367 const char *error_prefix =
"edges.remove(...)";
3386 bpy_bmfaceseq_remove_doc,
3387 ".. method:: remove(face)\n"
3391 " :type face: :class:`bmesh.types.BMFace`\n");
3394 const char *error_prefix =
"faces.remove(...)";
3413 bpy_bmedgeseq_get__method_doc,
3414 ".. method:: get(verts, fallback=None)\n"
3416 " Return an edge which uses the **verts** passed.\n"
3418 " :arg verts: Sequence of verts.\n"
3419 " :type verts: Sequence[:class:`bmesh.types.BMVert`]\n"
3420 " :arg fallback: Return this value if nothing is found.\n"
3421 " :return: The edge found or None\n"
3422 " :rtype: :class:`bmesh.types.BMEdge`\n");
3425 const char *error_prefix =
"edges.get(...)";
3427 PyObject *fallback = Py_None;
3431 if (!PyArg_ParseTuple(args,
"O|O:edges.get", &vert_seq, &fallback)) {
3437 PyObject *
ret =
nullptr;
3439 Py_ssize_t vert_seq_num;
3441 &
bm, vert_seq, 2, 2, &vert_seq_num,
true,
true, error_prefix);
3443 if (vert_array ==
nullptr) {
3455 PyMem_FREE(vert_array);
3461 bpy_bmfaceseq_get__method_doc,
3462 ".. method:: get(verts, fallback=None)\n"
3464 " Return a face which uses the **verts** passed.\n"
3466 " :arg verts: Sequence of verts.\n"
3467 " :type verts: Sequence[:class:`bmesh.types.BMVert`]\n"
3468 " :arg fallback: Return this value if nothing is found.\n"
3469 " :return: The face found or None\n"
3470 " :rtype: :class:`bmesh.types.BMFace`\n");
3473 const char *error_prefix =
"faces.get(...)";
3475 PyObject *fallback = Py_None;
3479 if (!PyArg_ParseTuple(args,
"O|O:faces.get", &vert_seq, &fallback)) {
3485 PyObject *
ret =
nullptr;
3487 Py_ssize_t vert_seq_num;
3489 &
bm, vert_seq, 1, PY_SSIZE_T_MAX, &vert_seq_num,
true,
true, error_prefix);
3491 if (vert_array ==
nullptr) {
3504 PyMem_FREE(vert_array);
3510 bpy_bmelemseq_index_update_doc,
3511 ".. method:: index_update()\n"
3513 " Initialize the index values of this sequence.\n"
3515 " This is the equivalent of looping over all elements and assigning the index values.\n"
3517 " .. code-block:: python\n"
3519 " for index, ele in enumerate(sequence):\n"
3520 " ele.index = index\n"
3524 " Running this on sequences besides "
3525 ":class:`bmesh.types.BMesh.verts`, "
3526 ":class:`bmesh.types.BMesh.edges`, "
3527 ":class:`bmesh.types.BMesh.faces`\n"
3528 " works but won't result in each element having a valid index, instead its order in the "
3529 "sequence will be set.\n");
3559 bm->elem_index_dirty |= htype;
3570 bpy_bmelemseq_ensure_lookup_table_doc,
3571 ".. method:: ensure_lookup_table()\n"
3573 " Ensure internal data needed for int subscription is initialized with "
3574 "verts/edges/faces, eg ``bm.verts[index]``.\n"
3576 " This needs to be called again after adding/removing data in this sequence.\n");
3588 bpy_bmelemseq_sort_doc,
3589 ".. method:: sort(*, key=None, reverse=False)\n"
3591 " Sort the elements of this sequence, using an optional custom sort key.\n"
3592 " Indices of elements are not changed, :class:`bmesh.types.BMElemSeq.index_update` "
3593 "can be used for that.\n"
3595 " :arg key: The key that sets the ordering of the elements.\n"
3596 " :type key: Callable[["
3597 ":class:`bmesh.types.BMVert` | "
3598 ":class:`bmesh.types.BMEdge` | "
3599 ":class:`bmesh.types.BMFace`], int] | None\n"
3600 " :arg reverse: Reverse the order of the elements\n"
3601 " :type reverse: bool\n"
3605 " When the 'key' argument is not provided, the elements are reordered following their "
3606 "current index value.\n"
3607 " In particular this can be used by setting indices manually before calling this "
3612 " Existing references to the N'th element, will continue to point the data at that "
3628 const void *index2_v,
3631 const double *keys =
static_cast<const double *
>(keys_v);
3632 const int *index1 = (
int *)index1_v;
3633 const int *index2 = (
int *)index2_v;
3635 if (keys[*index1] < keys[*index2]) {
3638 if (keys[*index1] > keys[*index2]) {
3646 const void *index2_v,
3654 static const char *kwlist[] = {
"key",
"reverse",
nullptr};
3655 PyObject *keyfunc =
nullptr;
3656 bool do_reverse =
false;
3667 int (*elem_idx_compare_by_keys)(
const void *,
const void *,
void *);
3669 uint *vert_idx =
nullptr;
3670 uint *edge_idx =
nullptr;
3671 uint *face_idx =
nullptr;
3678 if (args !=
nullptr) {
3679 if (!PyArg_ParseTupleAndKeywords(args,
3681 "|$OO&:BMElemSeq.sort",
3689 if (keyfunc == Py_None) {
3694 if (keyfunc !=
nullptr && !PyCallable_Check(keyfunc)) {
3695 PyErr_SetString(PyExc_TypeError,
"the 'key' argument is not a callable object");
3705 keys =
static_cast<double *
>(PyMem_MALLOC(
sizeof(*keys) * n_elem));
3706 if (keys ==
nullptr) {
3713 if (keyfunc !=
nullptr) {
3718 index = PyObject_CallFunctionObjArgs(keyfunc, py_elem,
nullptr);
3720 if (index ==
nullptr) {
3727 if ((keys[
i] = PyFloat_AsDouble(index)) == -1 && PyErr_Occurred()) {
3728 PyErr_SetString(PyExc_ValueError,
3729 "the value returned by the 'key' function is not a number");
3746 elem_idx =
static_cast<int *
>(PyMem_MALLOC(
sizeof(*elem_idx) * n_elem));
3747 if (elem_idx ==
nullptr) {
3764 BLI_qsort_r(elem_idx, n_elem,
sizeof(*elem_idx), elem_idx_compare_by_keys, keys);
3766 elem_map_idx =
static_cast<uint *
>(PyMem_MALLOC(
sizeof(*elem_map_idx) * n_elem));
3767 if (elem_map_idx ==
nullptr) {
3769 PyMem_FREE(elem_idx);
3779 for (
i = 0;
i < n_elem;
i++) {
3780 elem_map_idx[elem_idx[
i]] =
i;
3785 vert_idx = elem_map_idx;
3788 edge_idx = elem_map_idx;
3791 face_idx = elem_map_idx;
3794 PyErr_Format(PyExc_TypeError,
"element type %d not supported",
self->itype);
3795 PyMem_FREE(elem_map_idx);
3796 PyMem_FREE(elem_idx);
3803 PyMem_FREE(elem_map_idx);
3804 PyMem_FREE(elem_idx);
3812# pragma clang diagnostic push
3813# pragma clang diagnostic ignored "-Wcast-function-type"
3815# pragma GCC diagnostic push
3816# pragma GCC diagnostic ignored "-Wcast-function-type"
3822 {
"copy", (PyCFunction)
bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
3823 {
"clear", (PyCFunction)
bpy_bmesh_clear, METH_NOARGS, bpy_bmesh_clear_doc},
3824 {
"free", (PyCFunction)
bpy_bmesh_free, METH_NOARGS, bpy_bmesh_free_doc},
3829 METH_VARARGS | METH_KEYWORDS,
3830 bpy_bmesh_from_object_doc},
3833 METH_VARARGS | METH_KEYWORDS,
3834 bpy_bmesh_from_mesh_doc},
3835 {
"to_mesh", (PyCFunction)
bpy_bmesh_to_mesh, METH_VARARGS, bpy_bmesh_to_mesh_doc},
3838 {
"select_flush_mode",
3840 METH_VARARGS | METH_KEYWORDS,
3841 bpy_bmesh_select_flush_mode_doc},
3845 {
"uv_select_flush_mode",
3847 METH_VARARGS | METH_KEYWORDS,
3848 bpy_bmesh_uv_select_flush_mode_doc},
3852 bpy_bmesh_uv_select_flush_doc},
3853 {
"uv_select_flush_shared",
3856 bpy_bmesh_uv_select_flush_shared_doc},
3858 {
"uv_select_sync_from_mesh",
3860 METH_VARARGS | METH_KEYWORDS,
3861 bpy_bmesh_uv_select_sync_from_mesh_doc},
3862 {
"uv_select_sync_to_mesh",
3865 bpy_bmesh_uv_select_sync_to_mesh_doc},
3866 {
"uv_select_foreach_set",
3868 METH_VARARGS | METH_KEYWORDS,
3869 bpy_bmesh_uv_select_foreach_set_doc},
3870 {
"uv_select_foreach_set_from_mesh",
3872 METH_VARARGS | METH_KEYWORDS,
3873 bpy_bmesh_uv_select_foreach_set_from_mesh_doc},
3879 bpy_bmesh_normal_update_doc},
3882 METH_VARARGS | METH_KEYWORDS,
3883 bpy_bmesh_transform_doc},
3888 METH_VARARGS | METH_KEYWORDS,
3889 bpy_bmesh_calc_volume_doc},
3890 {
"calc_loop_triangles",
3893 bpy_bmesh_calc_loop_triangles_doc},
3894 {
nullptr,
nullptr, 0,
nullptr},
3901 {
"copy_from_face_interp",
3904 bpy_bmvert_copy_from_face_interp_doc},
3905 {
"copy_from_vert_interp",
3908 bpy_bmvert_copy_from_vert_interp_doc},
3913 bpy_bmvert_calc_edge_angle_doc},
3914 {
"calc_shell_factor",
3917 bpy_bmvert_calc_shell_factor_doc},
3922 bpy_bmvert_normal_update_doc},
3924 {
nullptr,
nullptr, 0,
nullptr},
3938 bpy_bmedge_calc_face_angle_doc},
3939 {
"calc_face_angle_signed",
3942 bpy_bmedge_calc_face_angle_signed_doc},
3946 bpy_bmedge_calc_tangent_doc},
3951 bpy_bmedge_normal_update_doc},
3953 {
nullptr,
nullptr, 0,
nullptr},
3961 {
"copy_from_face_interp",
3964 bpy_bmface_copy_from_face_interp_doc},
3966 {
"copy", (PyCFunction)
bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc},
3974 bpy_bmface_calc_perimeter_doc},
3975 {
"calc_tangent_edge",
3978 bpy_bmface_calc_tangent_edge_doc},
3979 {
"calc_tangent_edge_pair",
3982 bpy_bmface_calc_tangent_edge_pair_doc},
3983 {
"calc_tangent_edge_diagonal",
3986 bpy_bmface_calc_tangent_edge_diagonal_doc},
3987 {
"calc_tangent_vert_diagonal",
3990 bpy_bmface_calc_tangent_vert_diagonal_doc},
3991 {
"calc_center_median",
3994 bpy_bmface_calc_center_median_doc},
3995 {
"calc_center_median_weighted",
3998 bpy_bmface_calc_center_median_weighted_doc},
3999 {
"calc_center_bounds",
4002 bpy_bmface_calc_center_bounds_doc},
4007 bpy_bmface_normal_update_doc},
4010 {
nullptr,
nullptr, 0,
nullptr},
4015 {
"copy_from_face_interp",
4018 bpy_bmloop_copy_from_face_interp_doc},
4020 {
"uv_select_vert_set",
4023 bpy_bmloop_uv_select_vert_set_doc},
4024 {
"uv_select_edge_set",
4027 bpy_bmloop_uv_select_edge_set_doc},
4034 bpy_bmloop_calc_tangent_doc},
4035 {
nullptr,
nullptr, 0,
nullptr},
4043 bpy_bmelemseq_index_update_doc},
4044 {
nullptr,
nullptr, 0,
nullptr},
4055 bpy_bmelemseq_index_update_doc},
4056 {
"ensure_lookup_table",
4059 bpy_bmelemseq_ensure_lookup_table_doc},
4062 METH_VARARGS | METH_KEYWORDS,
4063 bpy_bmelemseq_sort_doc},
4064 {
nullptr,
nullptr, 0,
nullptr},
4077 bpy_bmelemseq_index_update_doc},
4078 {
"ensure_lookup_table",
4081 bpy_bmelemseq_ensure_lookup_table_doc},
4084 METH_VARARGS | METH_KEYWORDS,
4085 bpy_bmelemseq_sort_doc},
4086 {
nullptr,
nullptr, 0,
nullptr},
4099 bpy_bmelemseq_index_update_doc},
4100 {
"ensure_lookup_table",
4103 bpy_bmelemseq_ensure_lookup_table_doc},
4106 METH_VARARGS | METH_KEYWORDS,
4107 bpy_bmelemseq_sort_doc},
4108 {
nullptr,
nullptr, 0,
nullptr},
4115 {
nullptr,
nullptr, 0,
nullptr},
4120# pragma clang diagnostic pop
4122# pragma GCC diagnostic pop
4170 return self->bm->totvert;
4172 return self->bm->totedge;
4174 return self->bm->totface;
4216 switch (
self->itype) {
4218 if (keynum < self->
bm->totvert) {
4223 if (keynum < self->
bm->totedge) {
4228 if (keynum < self->
bm->totface) {
4239 PyErr_SetString(PyExc_IndexError,
4240 "BMElemSeq[index]: outdated internal index table, "
4241 "run ensure_lookup_table() first");
4247 self->bm,
self->itype,
self->py_ele ?
self->py_ele->ele :
nullptr, keynum));
4254 PyErr_Format(PyExc_IndexError,
"BMElemSeq[index]: index %d out of range", keynum);
4271 list = PyList_New(0);
4282 for (ok =
true; ok; ok = (BM_iter_step(&iter) !=
nullptr)) {
4283 if (
count == start) {
4290 while ((ele =
static_cast<BMHeader *
>(BM_iter_step(&iter)))) {
4294 if (
count == stop) {
4305 if (PyIndex_Check(key)) {
4306 const Py_ssize_t
i = PyNumber_AsSsize_t(key, PyExc_IndexError);
4307 if (
i == -1 && PyErr_Occurred()) {
4312 if (PySlice_Check(key)) {
4313 PySliceObject *key_slice = (PySliceObject *)key;
4314 Py_ssize_t
step = 1;
4316 if (key_slice->step != Py_None && !_PyEval_SliceIndex(key, &
step)) {
4320 PyErr_SetString(PyExc_TypeError,
"BMElemSeq[slice]: slice steps not supported");
4323 if (key_slice->start == Py_None && key_slice->stop == Py_None) {
4327 Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
4330 if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) {
4333 if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) {
4337 if (start < 0 || stop < 0) {
4350 if (stop - start <= 0) {
4351 return PyList_New(0);
4357 PyErr_SetString(PyExc_AttributeError,
"BMElemSeq[key]: invalid key, key must be an int");
4367 if (value_bm_ele->
bm ==
self->bm) {
4368 BMElem *ele, *ele_test = value_bm_ele->
ele;
4371 if (ele == ele_test) {
4415 (objobjargproc)
nullptr,
4436 return (PyObject *)py_iter;
4442 if (ele ==
nullptr) {
4443 PyErr_SetNone(PyExc_StopIteration);
4474 bm->py_handle =
nullptr;
4488 void **
ptr =
static_cast<void **
>(
4501 void **
ptr =
static_cast<void **
>(
4514 void **
ptr =
static_cast<void **
>(
4527 void **
ptr =
static_cast<void **
>(
4538 Py_XDECREF(
self->py_ele);
4560 "The BMesh data structure\n");
4564 "The BMesh vertex type\n");
4568 "The BMesh edge connecting 2 verts\n");
4572 "The BMesh face with 3 or more sides\n");
4576 "This is normally accessed from :class:`bmesh.types.BMFace.loops` where each face loop "
4577 "represents a corner of the face.\n");
4581 "General sequence type used for accessing any sequence of\n"
4582 ":class:`bmesh.types.BMVert`, "
4583 ":class:`bmesh.types.BMEdge`, "
4584 ":class:`bmesh.types.BMFace`, "
4585 ":class:`bmesh.types.BMLoop`.\n"
4587 "When accessed via "
4588 ":class:`bmesh.types.BMesh.verts`, "
4589 ":class:`bmesh.types.BMesh.edges`, "
4590 ":class:`bmesh.types.BMesh.faces`\n"
4591 "there are also functions to create/remove items.\n");
4595 "Internal BMesh type for looping over verts/faces/edges,\n"
4596 "used for iterating over :class:`bmesh.types.BMElemSeq` types.\n");
4603 return PyUnicode_FromFormat(
"<BMesh(%p), totvert=%d, totedge=%d, totface=%d, totloop=%d>",
4611 return PyUnicode_FromFormat(
"<BMesh dead at %p>",
self);
4623 return PyUnicode_FromFormat(
"<BMVert dead at %p>",
self);
4632 return PyUnicode_FromFormat(
"<BMEdge(%p), index=%d, verts=(%p/%d, %p/%d)>",
4641 return PyUnicode_FromFormat(
"<BMEdge dead at %p>",
self);
4650 return PyUnicode_FromFormat(
4654 return PyUnicode_FromFormat(
"<BMFace dead at %p>",
self);
4663 return PyUnicode_FromFormat(
"<BMLoop(%p), index=%d, vert=%p/%d, edge=%p/%d, face=%p/%d>",
4674 return PyUnicode_FromFormat(
"<BMLoop dead at %p>",
self);
4852 BPy_BM_types_module_doc,
4854 ".. |UV_STICKY_SELECT_MODE_REF| replace:: "
4855 "(:class:`bpy.types.ToolSettings.uv_sticky_select_mode` which may be passed in directly).\n"
4857 ".. |UV_STICKY_SELECT_MODE_TYPE| replace:: "
4858 "Literal['SHARED_LOCATION', 'DISABLED', 'SHARED_VERTEX']\n"
4860 ".. |UV_SELECT_FLUSH_MODE_NEEDED| replace:: "
4861 "This function selection-mode independent, "
4862 "typically :class:`bmesh.types.BMesh.uv_select_flush_mode` should be called afterwards.\n"
4864 ".. |UV_SELECT_SYNC_TO_MESH_NEEDED| replace:: "
4865 "This function doesn't flush the selection to the mesh, "
4866 "typically :class:`bmesh.types.BMesh.uv_select_sync_to_mesh` should be called afterwards.\n");
4870 BPy_BM_types_module_doc,
4881 PyObject *submodule;
4921 if (
bm->py_handle) {
4941 return (PyObject *)
self;
4948 void **
ptr =
static_cast<void **
>(
4957 if (*
ptr !=
nullptr) {
4968 return (PyObject *)
self;
4975 void **
ptr =
static_cast<void **
>(
4984 if (*
ptr !=
nullptr) {
4995 return (PyObject *)
self;
5002 void **
ptr =
static_cast<void **
>(
5011 if (*
ptr !=
nullptr) {
5022 return (PyObject *)
self;
5029 void **
ptr =
static_cast<void **
>(
5038 if (*
ptr !=
nullptr) {
5049 return (PyObject *)
self;
5056 self->py_ele = py_ele;
5059 return (PyObject *)
self;
5066 self->py_ele =
nullptr;
5068 return (PyObject *)
self;
5075 self->py_ele =
nullptr;
5077 return (PyObject *)
self;
5084 self->py_ele =
nullptr;
5086 return (PyObject *)
self;
5093 self->py_ele =
nullptr;
5095 return (PyObject *)
self;
5103 return (PyObject *)
self;
5108 switch (ele->
htype) {
5119 PyErr_SetString(PyExc_SystemError,
"internal error");
5136 PyExc_ReferenceError,
"BMesh used by %.200s has become invalid", Py_TYPE(
self)->tp_name);
5145 PyExc_ReferenceError,
"BMesh data of type %.200s has been removed", Py_TYPE(
self)->tp_name);
5150 const char *error_prefix,
5156 while (args_tot--) {
5169 PyErr_Format(PyExc_ValueError,
5170 "%.200s: BMesh data of type %.200s is from another mesh",
5172 Py_TYPE(py_bm_elem)->tp_name);
5185 if (
bm->uv_select_sync_valid ==
false) {
5186 PyErr_Format(PyExc_ValueError,
"%s: bm.uv_select_sync_valid: must be true", error_prefix);
5195 if (cd_loop_uv_offset == -1) {
5196 PyErr_Format(PyExc_ValueError,
"%s: failed, no UV layer found", error_prefix);
5198 return cd_loop_uv_offset;
5204 PyErr_Format(PyExc_ValueError,
"%s: elements must be from a singe BMesh", error_prefix);
5219 Py_ssize_t *r_seq_num,
5221 const bool do_unique_check,
5222 const bool do_bm_check,
5223 const char *error_prefix)
5225 BMesh *
bm = (r_bm && *r_bm) ? *r_bm :
nullptr;
5226 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
5227 const Py_ssize_t seq_num = PySequence_Fast_GET_SIZE(seq_fast);
5228 Py_ssize_t
i, i_last_dirty = PY_SSIZE_T_MAX;
5235 if (seq_num < min || seq_num >
max) {
5236 PyErr_Format(PyExc_TypeError,
5237 "%s: sequence incorrect size, expected [%d - %d], given %d",
5246 alloc =
static_cast<BMElem **
>(PyMem_MALLOC(seq_num *
sizeof(
BPy_BMElem **)));
5248 for (
i = 0;
i < seq_num;
i++) {
5252 PyErr_Format(PyExc_TypeError,
5253 "%s: expected %.200s, not '%.200s'",
5256 Py_TYPE(item)->tp_name);
5261 PyExc_TypeError,
"%s: %d %s has been removed", error_prefix,
i, Py_TYPE(item)->tp_name);
5266 else if (do_bm_check && (
bm &&
bm != item->
bm)) {
5267 PyErr_Format(PyExc_ValueError,
5268 "%s: %d %s is from another mesh",
5275 if (
bm ==
nullptr) {
5279 alloc[
i] = item->
ele;
5281 if (do_unique_check) {
5287 if (do_unique_check) {
5290 for (
i = 0;
i < seq_num;
i++) {
5301 i_last_dirty = PY_SSIZE_T_MAX;
5302 PyErr_Format(PyExc_ValueError,
5303 "%s: found the same %.200s used multiple times",
5310 *r_seq_num = seq_num;
5317 if (do_unique_check && (i_last_dirty != PY_SSIZE_T_MAX)) {
5318 for (
i = 0;
i <= i_last_dirty;
i++) {
5330 Py_ssize_t *r_seq_num,
5332 const bool do_unique_check,
5333 const bool do_bm_check,
5334 const char *error_prefix)
5339 if (!(seq_fast = PySequence_Fast(seq, error_prefix))) {
5344 r_bm, seq_fast,
min,
max, r_seq_num, htype, do_unique_check, do_bm_check, error_prefix));
5354 Py_ssize_t *r_seq_num,
5355 bool do_unique_check,
5357 const char *error_prefix)
5360 r_bm, seq,
min,
max, r_seq_num,
BM_VERT, do_unique_check, do_bm_check, error_prefix));
5366 Py_ssize_t *r_seq_num,
5367 bool do_unique_check,
5369 const char *error_prefix)
5372 r_bm, seq,
min,
max, r_seq_num,
BM_EDGE, do_unique_check, do_bm_check, error_prefix));
5378 Py_ssize_t *r_seq_num,
5379 bool do_unique_check,
5381 const char *error_prefix)
5384 r_bm, seq,
min,
max, r_seq_num,
BM_FACE, do_unique_check, do_bm_check, error_prefix));
5390 Py_ssize_t *r_seq_num,
5391 bool do_unique_check,
5393 const char *error_prefix)
5396 r_bm, seq,
min,
max, r_seq_num,
BM_LOOP, do_unique_check, do_bm_check, error_prefix));
5402 PyObject *
ret = PyTuple_New(elem_num);
5403 for (
i = 0;
i < elem_num;
i++) {
5411 PyObject *
ret = PyTuple_New(elem_num);
5412 for (
i = 0;
i < elem_num;
i++) {
5420 PyObject *
ret = PyTuple_New(elem_num);
5421 for (
i = 0;
i < elem_num;
i++) {
5430 PyObject *
ret = PyTuple_New(elem_num);
5431 for (
i = 0;
i < elem_num;
i++) {
5440 PyObject *
ret = PyTuple_New(elem_num);
5441 for (
i = 0;
i < elem_num;
i++) {
5459 const char *ret_array[4];
5476 ret[ret_ofs + 1] =
'\0';
5482 static char ret[32];
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
BMCustomDataCopyMap CustomData_bmesh_copy_map_calc(const CustomData &src, const CustomData &dst, eCustomDataMask mask_exclude=0)
void * CustomData_bmesh_get(const CustomData *data, void *block, eCustomDataType type)
const CustomData_MeshMasks CD_MASK_BMESH
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
void BKE_id_free(Main *bmain, void *idv)
bool BKE_id_is_in_global_main(ID *id)
Mesh * BKE_mesh_new_from_object(Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers, bool preserve_origindex, bool ensure_subdivision)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_evaluated_mesh(const Object *object_eval)
#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)
size_t BLI_string_join_array_by_sep_char(char *result, size_t result_maxncpy, char sep, const char *strings[], uint strings_num) ATTR_NONNULL()
#define POINTER_AS_INT(i)
void DEG_id_tag_update(ID *id, unsigned int flags)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ ID_RECALC_GEOMETRY_ALL_MODES
#define CD_MASK_BM_ELEM_PYPTR
Object is a sort of wrapper for general info.
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
#define BM_ELEM_SELECT_UV_EDGE
void BM_elem_attrs_copy(BMesh *bm, const BMCustomDataCopyMap &map, const BMVert *src, BMVert *dst)
BMesh * BM_mesh_copy(BMesh *bm_old)
void BM_vert_kill(BMesh *bm, BMVert *v)
void BM_face_kill(BMesh *bm, BMFace *f)
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)
BMFace * BM_face_copy(BMesh *bm_dst, const BMCustomDataCopyMap &cd_face_map, const BMCustomDataCopyMap &cd_loop_map, BMFace *f, const bool copy_verts, const bool copy_edges)
void BM_edge_kill(BMesh *bm, BMEdge *e)
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.
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.
void * BM_iter_at_index(BMesh *bm, const char itype, void *data, int index)
const char bm_iter_itype_htype_map[BM_ITYPE_MAX]
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_iter_init(iter, bm, itype, data)
BMIterType
BMesh Iterators.
BMesh const char void * data
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode, BMSelectFlushFlag flag)
Select Mode Flush.
void BM_mesh_select_flush_from_verts(BMesh *bm, const bool select)
#define BM_elem_hide_set(bm, ele, hide)
#define BMSelectFlushFlag_Default
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 *mesh, const BMeshFromMeshParams *params)
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *mesh, const BMeshToMeshParams *params)
void BM_mesh_normals_update(BMesh *bm)
void BM_mesh_calc_tessellation(BMesh *bm, MutableSpan< std::array< BMLoop *, 3 > > looptris)
bool BM_mesh_is_valid(BMesh *bm)
void BM_face_calc_tangent_from_vert_diagonal(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_from_edge_pair(const BMFace *f, float r_tangent[3])
void BM_face_normal_update(BMFace *f)
void BM_face_normal_flip(BMesh *bm, BMFace *f)
float BM_face_calc_area(const BMFace *f)
void BM_face_calc_tangent_from_edge(const BMFace *f, float r_tangent[3])
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
void BM_face_calc_tangent_from_edge_diagonal(const BMFace *f, float r_tangent[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)
PyObject * BPy_BMEdgeSeq_CreatePyObject(BMesh *bm)
static PyObject * bpy_bmedge_calc_face_angle_signed(BPy_BMEdge *self, PyObject *args)
PyDoc_STRVAR(bpy_bm_elem_select_doc, "Selected state of this element.\n" "\n" ":type: bool\n")
static void bpy_bmvert_dealloc(BPy_BMElem *self)
PyObject * BPy_BMFace_CreatePyObject(BMesh *bm, BMFace *f)
static PyObject * bpy_bmvert_normal_update(BPy_BMVert *self)
static PyObject * bpy_bmloop_vert_get(BPy_BMLoop *self, void *)
static Py_hash_t bpy_bm_elem_hash(PyObject *self)
static PyObject * bpy_bmloop_link_loop_prev_get(BPy_BMLoop *self, void *)
PyC_FlagSet bpy_bm_htype_all_flags[]
static PyMappingMethods bpy_bmelemseq_as_mapping
static PyObject * bpy_bmesh_normal_update(BPy_BMesh *self)
static PyObject * bpy_bmface_calc_center_bounds(BPy_BMFace *self)
static int bpy_bmvert_co_set(BPy_BMVert *self, PyObject *value, void *)
static PyObject * bpy_bmface_normal_update(BPy_BMFace *self)
static PyObject * bpy_bmvertseq_get(BPy_BMesh *self, void *)
static PyObject * bpy_bmesh_clear(BPy_BMesh *self)
PyObject * BPy_BMLoop_Array_As_Tuple(BMesh *bm, BMLoop *const *elem, Py_ssize_t elem_num)
static PyObject * bpy_bmesh_select_history_get(BPy_BMesh *self, void *)
static PyObject * bpy_bmesh_calc_loop_triangles(BPy_BMElem *self)
PyObject * BPy_BMLoopSeq_CreatePyObject(BMesh *bm)
static PyObject * bpy_bmvert_calc_edge_angle(BPy_BMVert *self, PyObject *args)
PyObject * BPy_BMFaceSeq_CreatePyObject(BMesh *bm)
static PyObject * bpy_bmloop_link_loop_radial_next_get(BPy_BMLoop *self, void *)
static PyObject * bpy_bmloop_calc_tangent(BPy_BMLoop *self)
static PyObject * bpy_bmelemseq_iter(BPy_BMElemSeq *self)
static PyGetSetDef bpy_bmvertseq_getseters[]
PyObject * BPy_BMElem_CreatePyObject(BMesh *bm, BMHeader *ele)
static PyObject * bpy_bmface_calc_tangent_vert_diagonal(BPy_BMFace *self)
static PyGetSetDef bpy_bmloopseq_getseters[]
static PyObject * bpy_bmloop_calc_normal(BPy_BMLoop *self)
PyObject * BPy_BMVert_Array_As_Tuple(BMesh *bm, BMVert **elem, Py_ssize_t elem_num)
PyObject * BPy_BMesh_CreatePyObject(BMesh *bm, int flag)
static PyObject * bpy_bmedge_is_contiguous_get(BPy_BMEdge *self, void *)
static PyObject * bpy_bmvert_is_boundary_get(BPy_BMVert *self, void *)
PyTypeObject BPy_BMesh_Type
PyObject * BPy_BMElemSeq_CreatePyObject(BMesh *bm, BPy_BMElem *py_ele, const char itype)
static PyObject * bpy_bmelemseq_subscript(BPy_BMElemSeq *self, PyObject *key)
static int bpy_bm_elem_index_set(BPy_BMElem *self, PyObject *value, void *)
static PyModuleDef BPy_BM_types_module_def
static PyObject * bpy_bmloop_is_convex_get(BPy_BMLoop *self, void *)
PyC_FlagSet bpy_bm_htype_vert_edge_face_flags[]
PyObject * BPy_BMVert_CreatePyObject(BMesh *bm, BMVert *v)
PyObject * BPy_BMLoop_CreatePyObject(BMesh *bm, BMLoop *l)
static PyMethodDef bpy_bmedgeseq_methods[]
static PyObject * bpy_bmvert_calc_shell_factor(BPy_BMVert *self)
static PyObject * bpy_bmesh_calc_volume(BPy_BMElem *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmesh_uv_select_flush_mode(BPy_BMesh *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmface_normal_get(BPy_BMFace *self, void *)
static PyObject * bpy_bmloop_edge_get(BPy_BMLoop *self, void *)
static PyMappingMethods bpy_bm_elem_as_mapping
static PyObject * bpy_bmesh_uv_select_flush(BPy_BMesh *self, PyObject *value)
static PyObject * bpy_bmloop_calc_angle(BPy_BMLoop *self)
static PyObject * bpy_bm_elem_hide_set(BPy_BMElem *self, PyObject *value)
void * BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_seq_num, const char htype, const bool do_unique_check, const bool do_bm_check, const char *error_prefix)
char * BPy_BMElem_StringFromHType(const char htype)
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_seq_num, const char htype, const bool do_unique_check, const bool do_bm_check, const char *error_prefix)
static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyObject *value)
static PyObject * bpy_bmvertseq_remove(BPy_BMElemSeq *self, BPy_BMVert *value)
static PyObject * bpy_bmloop_link_loop_next_get(BPy_BMLoop *self, void *)
static PyObject * bpy_bmloop_link_loop_radial_prev_get(BPy_BMLoop *self, void *)
static PyObject * bpy_bmedge_calc_face_angle(BPy_BMEdge *self, PyObject *args)
static PyObject * bpy_bmelemseq_elem_get(BPy_BMElem *self, void *itype)
static void bm_dealloc_editmode_warn(BPy_BMesh *self)
static PyObject * bpy_bmedge_is_wire_get(BPy_BMEdge *self, void *)
PyTypeObject BPy_BMVertSeq_Type
PyTypeObject BPy_BMLoopSeq_Type
static PyObject * bpy_bmface_repr(BPy_BMFace *self)
static void bpy_bmedge_dealloc(BPy_BMElem *self)
static int bpy_bmvert_normal_set(BPy_BMVert *self, PyObject *value, void *)
static PyObject * bpy_bmesh_repr(BPy_BMesh *self)
static PyGetSetDef bpy_bmvert_getseters[]
PyObject * BPy_BMVertSeq_CreatePyObject(BMesh *bm)
static PyObject * bpy_bmedge_normal_update(BPy_BMEdge *self)
static PyObject * bpy_bmedge_repr(BPy_BMEdge *self)
static PyMethodDef bpy_bmedge_methods[]
static void bpy_bmloop_dealloc(BPy_BMElem *self)
static Py_ssize_t bpy_bmelemseq_length(BPy_BMElemSeq *self)
char * BPy_BMElem_StringFromHType_ex(const char htype, char ret[32])
static PyObject * bpy_bmvert_is_wire_get(BPy_BMVert *self, void *)
static PyGetSetDef bpy_bmesh_getseters[]
void bpy_bm_generic_invalidate(BPy_BMGeneric *self)
static PyObject * bpy_bmface_uv_select_set(BPy_BMFace *self, PyObject *value)
PyObject * BPy_BMFace_Array_As_Tuple(BMesh *bm, BMFace **elem, Py_ssize_t elem_num)
static PyMethodDef bpy_bmvert_methods[]
static PyObject * bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *value)
static PyObject * bpy_bmesh_uv_select_flush_shared(BPy_BMesh *self, PyObject *value)
static int bpy_bmface_normal_set(BPy_BMFace *self, PyObject *value, void *)
static PyObject * bpy_bmloop_face_get(BPy_BMLoop *self, void *)
static PyObject * bpy_bmesh_copy(BPy_BMesh *self)
static PyObject * bpy_bmedge_calc_tangent(BPy_BMEdge *self, PyObject *args)
static PyObject * bpy_bm_elem_hflag_get(BPy_BMElem *self, void *flag)
PyTypeObject BPy_BMEdgeSeq_Type
static PyObject * bpy_bmvert_is_manifold_get(BPy_BMVert *self, void *)
static PyObject * bpy_bmesh_uv_select_foreach_set(BPy_BMesh *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmedge_is_convex_get(BPy_BMEdge *self, void *)
static PyObject * bpy_bmedgeseq_get__method(BPy_BMElemSeq *self, PyObject *args)
static PyObject * bpy_bmface_calc_tangent_edge_diagonal(BPy_BMFace *self)
static PyObject * bpy_bmesh_select_flush(BPy_BMesh *self, PyObject *value)
PyTypeObject BPy_BMEdge_Type
static PyObject * bpy_bmedge_calc_length(BPy_BMEdge *self)
static PyMethodDef bpy_bmelemseq_methods[]
static PyObject * bpy_bmedgeseq_get(BPy_BMesh *self, void *)
static PyObject * bpy_bmvertseq_new(BPy_BMElemSeq *self, PyObject *args)
int bpy_bm_uv_layer_offset_or_error(BMesh *bm, const char *error_prefix)
static PyObject * bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args)
static PyObject * bpy_bmface_calc_tangent_edge_pair(BPy_BMFace *self)
static PyTypeObject * bpy_bm_itype_as_pytype(const char itype)
static PyObject * bpy_bmface_normal_flip(BPy_BMFace *self)
BMVert ** BPy_BMVert_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_seq_num, bool do_unique_check, bool do_bm_check, const char *error_prefix)
BMEdge ** BPy_BMEdge_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_seq_num, bool do_unique_check, bool do_bm_check, const char *error_prefix)
static PyObject * bpy_bmedge_is_manifold_get(BPy_BMEdge *self, void *)
int bpy_bm_check_bm_match_or_error(BMesh *bm_a, BMesh *bm_b, const char *error_prefix)
static PyGetSetDef bpy_bmfaceseq_getseters[]
static PyObject * bpy_bmfaceseq_remove(BPy_BMElemSeq *self, BPy_BMFace *value)
static PyObject * bpy_bmloop_repr(BPy_BMLoop *self)
static PyGetSetDef bpy_bmedge_getseters[]
PyObject * BPy_BMEdge_Array_As_Tuple(BMesh *bm, BMEdge **elem, Py_ssize_t elem_num)
static int bpy_bmfaceseq_active_set(BPy_BMElem *self, PyObject *value, void *)
static PyObject * bpy_bmelemseq_index_update(BPy_BMElemSeq *self)
static PyObject * bpy_bmesh_uv_select_sync_valid_get(BPy_BMesh *self, void *)
static PyObject * bpy_bm_is_valid_get(BPy_BMGeneric *self, void *)
static int bpy_bmelemseq_sort_cmp_by_keys_descending(const void *index1_v, const void *index2_v, void *keys_v)
static PyObject * bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject *kw)
int bpy_bm_generic_valid_check_source(BMesh *bm_source, const char *error_prefix, void **args, uint args_tot)
static PyObject * bpy_bmvert_co_get(BPy_BMVert *self, void *)
static PyObject * bpy_bmesh_select_mode_get(BPy_BMesh *self, void *)
static PyObject * bpy_bmedgeseq_new(BPy_BMElemSeq *self, PyObject *args)
static PyMethodDef bpy_bmfaceseq_methods[]
static PyObject * bpy_bmfaceseq_get__method(BPy_BMElemSeq *self, PyObject *args)
static PyObject * bpy_bmloop_uv_select_vert_set(BPy_BMLoop *self, PyObject *value)
static PyMethodDef bpy_bmloopseq_methods[]
static PyObject * bpy_bmedge_is_boundary_get(BPy_BMEdge *self, void *)
static PyObject * bpy_bmface_copy(BPy_BMFace *self, PyObject *args, PyObject *kw)
static PyGetSetDef bpy_bmedgeseq_getseters[]
static PyObject * bpy_bmelemseq_subscript_slice(BPy_BMElemSeq *self, Py_ssize_t start, Py_ssize_t stop)
static void bpy_bmelemseq_dealloc(BPy_BMElemSeq *self)
BMLoop ** BPy_BMLoop_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_seq_num, bool do_unique_check, bool do_bm_check, const char *error_prefix)
static PyObject * bpy_bmloop_uv_select_edge_set(BPy_BMLoop *self, PyObject *value)
static int bpy_bmesh_uv_select_sync_valid_set(BPy_BMesh *self, PyObject *value, void *)
int bpy_bm_generic_valid_check(BPy_BMGeneric *self)
static PyObject * bpy_bmelemseq_subscript_int(BPy_BMElemSeq *self, Py_ssize_t keynum)
static PyObject * bpy_bmface_calc_perimeter(BPy_BMFace *self)
static void bpy_bmface_dealloc(BPy_BMElem *self)
PyTypeObject BPy_BMFaceSeq_Type
PyTypeObject BPy_BMVert_Type
PyTypeObject BPy_BMIter_Type
static PyC_StringEnumItems bpy_bm_uv_select_sticky_items[]
static PyObject * bpy_bmesh_uv_select_sync_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *kw)
static int bpy_bmface_material_index_set(BPy_BMFace *self, PyObject *value, void *)
static PyObject * bpy_bmvert_copy_from_vert_interp(BPy_BMVert *self, PyObject *args)
static int bpy_bmesh_select_history_set(BPy_BMesh *self, PyObject *value, void *)
static PyMethodDef bpy_bmface_methods[]
static PyMethodDef bpy_bmloop_methods[]
static PyObject * bpy_bmface_calc_center_mean(BPy_BMFace *self)
static PyObject * bpy_bmesh_select_flush_mode(BPy_BMesh *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bm_elem_index_get(BPy_BMElem *self, void *)
int bpy_bm_check_uv_select_sync_valid(BMesh *bm, const char *error_prefix)
static PyObject * bpy_bmface_calc_tangent_edge(BPy_BMFace *self)
#define BPY_BM_HFLAG_ALL_STR
static PyObject * bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObject *kw)
PyTypeObject BPy_BMElemSeq_Type
static PyMethodDef bpy_bmesh_methods[]
static PyObject * bpy_bmfaceseq_active_get(BPy_BMElemSeq *self, void *)
static PyObject * bpy_bmloopseq_get(BPy_BMesh *self, void *)
static PyObject * bpy_bmvert_normal_get(BPy_BMVert *self, void *)
static PyObject * bpy_bmelemseq_ensure_lookup_table(BPy_BMElemSeq *self)
static PyGetSetDef bpy_bmface_getseters[]
static PyObject * bpy_bmfaceseq_get(BPy_BMesh *self, void *)
static PyObject * bpy_bmiter_next(BPy_BMIter *self)
static PyObject * bpy_bmesh_free(BPy_BMesh *self)
PyObject * BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_num)
PyTypeObject BPy_BMFace_Type
static PyObject * bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject *kw)
static int bpy_bmesh_select_mode_set(BPy_BMesh *self, PyObject *value, void *)
static int bpy_bmelemseq_sort_cmp_by_keys_ascending(const void *index1_v, const void *index2_v, void *keys_v)
static PyObject * bpy_bmface_calc_center_median_weighted(BPy_BMFace *self)
static void bpy_bmesh_dealloc(BPy_BMesh *self)
static PyGetSetDef bpy_bmloop_getseters[]
static PyObject * bpy_bmface_calc_area(BPy_BMFace *self)
PyTypeObject BPy_BMLoop_Type
static PyObject * bpy_bmesh_uv_select_sync_to_mesh(BPy_BMesh *self)
PyObject * BPy_BMIter_CreatePyObject(BMesh *bm)
static int bpy_bmelemseq_contains(BPy_BMElemSeq *self, PyObject *value)
static PyObject * bpy_bmloop_copy_from_face_interp(BPy_BMLoop *self, PyObject *args)
#define BPY_BM_HTYPE_NOLOOP
PyC_FlagSet bpy_bm_hflag_all_flags[]
static PyMethodDef bpy_bmvertseq_methods[]
static PyObject * bpy_bmvert_copy_from_face_interp(BPy_BMVert *self, PyObject *args)
PyC_FlagSet bpy_bm_scene_vert_edge_face_flags[]
int BPy_BMElem_CheckHType(PyTypeObject *type, const char htype)
static PyObject * bpy_bm_elem_select_set(BPy_BMElem *self, PyObject *value)
static PySequenceMethods bpy_bmelemseq_as_sequence
static PyObject * bpy_bmelem_subscript(BPy_BMElem *self, BPy_BMLayerItem *key)
static PyObject * bpy_bmelemseq_layers_get(BPy_BMElemSeq *self, void *htype)
static PyObject * bpy_bmface_material_index_get(BPy_BMFace *self, void *)
static PyObject * bpy_bmedge_other_vert(BPy_BMEdge *self, BPy_BMVert *value)
PyObject * BPyInit_bmesh_types()
PyObject * BPy_BMEdge_CreatePyObject(BMesh *bm, BMEdge *e)
BMFace ** BPy_BMFace_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_seq_num, bool do_unique_check, bool do_bm_check, const char *error_prefix)
static PyObject * bpy_bmesh_uv_select_foreach_set_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *kw)
static PyObject * bpy_bmface_copy_from_face_interp(BPy_BMFace *self, PyObject *args)
static PyObject * bpy_bmesh_is_wrapped_get(BPy_BMesh *self, void *)
static int bpy_bm_elem_hflag_set(BPy_BMElem *self, PyObject *value, void *flag)
static PyObject * bpy_bm_elem_copy_from(BPy_BMElem *self, BPy_BMElem *value)
static PyObject * bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
static PyObject * bpy_bmvert_repr(BPy_BMVert *self)
#define BPy_BMFace_Check(v)
#define BPY_BM_CHECK_OBJ(obj)
#define BPY_BM_CHECK_SOURCE_INT(bm, errmsg,...)
#define BPy_BMVert_Check(v)
#define BPy_BMElem_Check(v)
#define BPy_BMesh_Check(v)
#define BPy_BMEdge_Check(v)
#define BPY_BM_CHECK_SOURCE_OBJ(bm, errmsg,...)
#define BPY_BM_IS_VALID(obj)
#define BM_ITER_BPY_BM_SEQ(ele, iter, bpy_bmelemseq)
#define BPY_BM_CHECK_INT(obj)
PyTypeObject BPy_BMLayerCollection_Type
PyObject * BPy_BMLayerAccess_CreatePyObject(BMesh *bm, const char htype)
PyTypeObject BPy_BMLayerItem_Type
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)
PyTypeObject BPy_BMEditSelSeq_Type
PyTypeObject BPy_BMEditSelIter_Type
PyObject * BPy_BMEditSel_CreatePyObject(BMesh *bm)
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.
BMFace * BM_face_exists(BMVert *const *varr, int len)
bool BM_vert_is_manifold(const BMVert *v)
float BM_vert_calc_shell_factor(const BMVert *v)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
float BM_vert_calc_edge_angle_ex(const BMVert *v, const float fallback)
BMESH VERT/EDGE ANGLE.
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
void BM_mesh_uvselect_sync_from_mesh_sticky_vert(BMesh *bm)
void BM_face_uvselect_set(BMesh *bm, BMFace *f, bool select)
void BM_mesh_uvselect_sync_from_mesh_sticky_disabled(BMesh *bm)
void BM_mesh_uvselect_sync_to_mesh(BMesh *bm)
void BM_mesh_uvselect_flush_shared_only_deselect(BMesh *bm, const int cd_loop_uv_offset)
void BM_mesh_uvselect_flush_shared_only_select(BMesh *bm, const int cd_loop_uv_offset)
void BM_mesh_uvselect_mode_flush_ex(BMesh *bm, const short selectmode, const bool flush_down)
void BM_mesh_uvselect_flush_from_verts(BMesh *bm, const bool select)
void BM_mesh_uvselect_set_elem_shared(BMesh *bm, bool select, const int cd_loop_uv_offset, const blender::Span< BMLoop * > loop_verts, const blender::Span< BMLoop * > loop_edges, const blender::Span< BMFace * > faces)
void BM_loop_edge_uvselect_set(BMesh *bm, BMLoop *l, bool select)
void BM_mesh_uvselect_sync_from_mesh_sticky_location(BMesh *bm, const int cd_loop_uv_offset)
void BM_mesh_uvselect_set_elem_from_mesh(BMesh *bm, const bool select, const BMUVSelectPickParams ¶ms, const blender::VectorList< BMVert * > &verts, const blender::VectorList< BMEdge * > &edges, const blender::VectorList< BMFace * > &faces)
void BM_loop_vert_uvselect_set_noflush(BMesh *bm, BMLoop *l, bool select)
BPy_StructRNA * depsgraph
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
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(const float *vec, const int vec_num, PyTypeObject *base_type)
PyObject * Vector_CreatePyObject_wrap(float *vec, const int vec_num, PyTypeObject *base_type)
Mesh * mesh_get_eval_deform(Depsgraph *depsgraph, const Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask)
void * PyC_RNA_AsPointer(PyObject *value, const char *type_name)
int PyC_ParseStringEnum(PyObject *o, void *p)
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 * PyC_FlagSet_FromBitfield(PyC_FlagSet *items, int flag)
header-only compatibility defines.
PyObject_VAR_HEAD BMesh * bm
PyObject_VAR_HEAD BMesh * bm
PyObject_VAR_HEAD BMesh * bm
PyObject_VAR_HEAD BMesh * bm
MeshRuntimeHandle * runtime