72#define BPY_BM_HFLAG_ALL_STR "('SELECT', 'HIDE', 'SEAM', 'SMOOTH', 'TAG')"
94 bpy_bm_elem_select_doc,
95 "Selected state of this element.\n"
100 bpy_bm_elem_hide_doc,
101 "Hidden state of this element.\n"
107 "Generic attribute scripts can use for own logic\n"
112 bpy_bm_elem_smooth_doc,
113 "Smooth state of this element.\n"
118 bpy_bm_elem_seam_doc,
119 "Seam for UV unwrapping.\n"
154 bpy_bm_elem_index_doc,
155 "Index of this element.\n"
161 " This value is not necessarily valid, while editing the mesh it can become *dirty*.\n"
163 " It's also possible to assign any number to this attribute for a scripts internal logic.\n"
165 " To ensure the value is up to date - see :class:`BMElemSeq.index_update`.\n");
179 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
187 self->bm->elem_index_dirty |=
self->ele->head.htype;
203 "This meshes vert sequence (read-only).\n"
205 ":type: :class:`BMVertSeq`");
215 "This meshes edge sequence (read-only).\n"
217 ":type: :class:`BMEdgeSeq`");
227 "This meshes face sequence (read-only).\n"
229 ":type: :class:`BMFaceSeq`");
239 "This meshes loops (read-only).\n"
241 ":type: :class:`BMLoopSeq`\n"
245 " Loops must be accessed via faces, this is only exposed for layer access.\n");
254 "Edges connected to this vertex (read-only).\n"
256 ":type: :class:`BMElemSeq` of :class:`BMEdge`");
258 "Faces connected to this vertex (read-only).\n"
260 ":type: :class:`BMElemSeq` of :class:`BMFace`");
262 "Loops that use this vertex (read-only).\n"
264 ":type: :class:`BMElemSeq` of :class:`BMLoop`");
268 bpy_bmedge_verts_doc,
269 "Verts this edge uses (always 2), (read-only).\n"
271 ":type: :class:`BMElemSeq` of "
274 "Faces connected to this edge, (read-only).\n"
276 ":type: :class:`BMElemSeq` of :class:`BMFace`");
278 "Loops connected to this edge, (read-only).\n"
280 ":type: :class:`BMElemSeq` of :class:`BMLoop`");
284 bpy_bmface_verts_doc,
285 "Verts of this face, (read-only).\n"
287 ":type: :class:`BMElemSeq` of :class:`BMVert`");
290 bpy_bmface_edges_doc,
291 "Edges of this face, (read-only).\n"
293 ":type: :class:`BMElemSeq` of :class:`BMEdge`");
296 bpy_bmface_loops_doc,
297 "Loops of this face, (read-only).\n"
299 ":type: :class:`BMElemSeq` of :class:`BMLoop`");
302 "Loops connected to this loop, (read-only).\n"
304 ":type: :class:`BMElemSeq` of :class:`BMLoop`");
315 "True when this element is valid (hasn't been removed).\n"
324 "True when this mesh is owned by blender (typically the editmode BMesh).\n"
336 bpy_bmesh_select_mode_doc,
337 "The selection mode, values can be {'VERT', 'EDGE', 'FACE'}, can't be assigned an empty set.\n"
358 PyErr_SetString(PyExc_TypeError,
"bm.select_mode: can't assign an empty value");
368 bpy_bmesh_select_history_doc,
369 "Sequence of selected items (the last is displayed as active).\n"
372 ":class:`BMEditSelSeq`");
393 "The coordinates for this vertex as a 3D, wrapped vector.\n"
396 ":class:`mathutils.Vector`");
415 "The normal for this vertex as a 3D, wrapped vector.\n"
417 ":type: :class:`mathutils.Vector`");
437 bpy_bmvert_is_manifold_doc,
438 "True when this vertex is manifold (read-only).\n"
449 bpy_bmvert_is_wire_doc,
450 "True when this vertex is not connected to any faces (read-only).\n"
460 "True when this vertex is connected to boundary edges (read-only).\n"
474 bpy_bmedge_is_manifold_doc,
475 "True when this edge is manifold (read-only).\n"
486 bpy_bmedge_is_contiguous_doc,
487 "True when this edge is manifold, between two faces with the same winding "
499 bpy_bmedge_is_convex_doc,
500 "True when this edge joins two convex faces, depends on a valid face normal (read-only).\n"
511 bpy_bmedge_is_wire_doc,
512 "True when this edge is not connected to any faces (read-only).\n"
523 bpy_bmedge_is_boundary_doc,
524 "True when this edge is at the boundary of a face (read-only).\n"
537 "The normal for this face as a 3D, wrapped vector.\n"
539 ":type: :class:`mathutils.Vector`");
559 bpy_bmface_material_index_doc,
560 "The face's material index.\n"
566 return PyLong_FromLong(
self->f->mat_nr);
575 if (((param = PyC_Long_AsI32(value)) == -1) && PyErr_Occurred()) {
580 if ((param < 0) || (param >
MAXMAT)) {
582 PyErr_SetString(PyExc_ValueError,
"material index outside of usable range (0 - 32766)");
586 self->f->mat_nr = short(param);
596 "The loop's vertex (read-only).\n"
598 ":type: :class:`BMVert`");
606 "The loop's edge (between this loop and the next), (read-only).\n"
608 ":type: :class:`BMEdge`");
618 "The face this loop makes (read-only).\n"
620 ":type: :class:`BMFace`");
629 bpy_bmloop_link_loop_next_doc,
630 "The next face corner (read-only).\n"
632 ":type: :class:`BMLoop`");
641 bpy_bmloop_link_loop_prev_doc,
642 "The previous face corner (read-only).\n"
644 ":type: :class:`BMLoop`");
653 bpy_bmloop_link_loop_radial_next_doc,
654 "The next loop around the edge (read-only).\n"
656 ":type: :class:`BMLoop`");
665 bpy_bmloop_link_loop_radial_prev_doc,
666 "The previous loop around the edge (read-only).\n"
668 ":type: :class:`BMLoop`");
677 bpy_bmloop_is_convex_doc,
678 "True when this loop is at the convex corner of a face, depends on a valid face "
679 "normal (read-only).\n"
694 bpy_bmelemseq_layers_vert_doc,
695 "custom-data layers (read-only).\n"
697 ":type: :class:`BMLayerAccessVert`");
700 bpy_bmelemseq_layers_edge_doc,
701 "custom-data layers (read-only).\n"
703 ":type: :class:`BMLayerAccessEdge`");
706 bpy_bmelemseq_layers_face_doc,
707 "custom-data layers (read-only).\n"
709 ":type: :class:`BMLayerAccessFace`");
712 bpy_bmelemseq_layers_loop_doc,
713 "custom-data layers (read-only).\n"
715 ":type: :class:`BMLayerAccessLoop`");
728 bpy_bmfaceseq_active_doc,
731 ":type: :class:`BMFace` or None");
747 if (value == Py_None) {
758 PyErr_Format(PyExc_TypeError,
759 "faces.active = f: expected BMFace or None, not %.200s",
760 Py_TYPE(value)->tp_name);
765 {
"verts", (getter)
bpy_bmvertseq_get, (setter)
nullptr, bpy_bmvertseq_doc,
nullptr},
766 {
"edges", (getter)
bpy_bmedgeseq_get, (setter)
nullptr, bpy_bmedgeseq_doc,
nullptr},
767 {
"faces", (getter)
bpy_bmfaceseq_get, (setter)
nullptr, bpy_bmfaceseq_doc,
nullptr},
768 {
"loops", (getter)
bpy_bmloopseq_get, (setter)
nullptr, bpy_bmloopseq_doc,
nullptr},
772 bpy_bmesh_select_mode_doc,
778 bpy_bmesh_select_history_doc,
785 bpy_bmesh_is_wrapped_doc,
789 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
797 bpy_bm_elem_select_doc,
802 bpy_bm_elem_hide_doc,
812 bpy_bm_elem_index_doc,
819 bpy_bmvert_normal_doc,
826 bpy_bmvert_link_edges_doc,
831 bpy_bmvert_link_faces_doc,
836 bpy_bmvert_link_loops_doc,
843 bpy_bmvert_is_manifold_doc,
849 bpy_bmvert_is_boundary_doc,
853 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
861 bpy_bm_elem_select_doc,
866 bpy_bm_elem_hide_doc,
876 bpy_bm_elem_index_doc,
882 bpy_bm_elem_smooth_doc,
887 bpy_bm_elem_seam_doc,
894 bpy_bmedge_verts_doc,
900 bpy_bmedge_link_faces_doc,
905 bpy_bmedge_link_loops_doc,
912 bpy_bmedge_is_manifold_doc,
917 bpy_bmedge_is_contiguous_doc,
922 bpy_bmedge_is_convex_doc,
928 bpy_bmedge_is_boundary_doc,
932 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
940 bpy_bm_elem_select_doc,
945 bpy_bm_elem_hide_doc,
955 bpy_bm_elem_index_doc,
961 bpy_bm_elem_smooth_doc,
967 bpy_bmface_normal_doc,
973 bpy_bmface_material_index_doc,
980 bpy_bmface_verts_doc,
985 bpy_bmface_edges_doc,
990 bpy_bmface_loops_doc,
996 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1006 bpy_bm_elem_select_doc,
1011 bpy_bm_elem_hide_doc,
1017 bpy_bm_elem_tag_doc,
1022 bpy_bm_elem_index_doc,
1033 bpy_bmloops_link_loops_doc,
1038 bpy_bmloop_link_loop_next_doc,
1043 bpy_bmloop_link_loop_prev_doc,
1045 {
"link_loop_radial_next",
1048 bpy_bmloop_link_loop_radial_next_doc,
1050 {
"link_loop_radial_prev",
1053 bpy_bmloop_link_loop_radial_prev_doc,
1060 bpy_bmloop_is_convex_doc,
1062 {
"is_valid", (getter)
bpy_bm_is_valid_get, (setter)
nullptr, bpy_bm_is_valid_doc,
nullptr},
1064 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1071 bpy_bmelemseq_layers_vert_doc,
1073 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1079 bpy_bmelemseq_layers_edge_doc,
1081 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1087 bpy_bmelemseq_layers_face_doc,
1093 bpy_bmfaceseq_active_doc,
1095 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1101 bpy_bmelemseq_layers_loop_doc,
1103 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
1115 ".. method:: copy()\n"
1117 " :return: A copy of this BMesh.\n"
1118 " :rtype: :class:`BMesh`\n");
1134 PyErr_SetString(PyExc_SystemError,
"Unable to copy BMesh, internal error");
1140 bpy_bmesh_clear_doc,
1141 ".. method:: clear()\n"
1143 " Clear all mesh data.\n");
1160 ".. method:: free()\n"
1162 " Explicitly free the BMesh data from memory, causing exceptions on further access.\n"
1166 " The BMesh is freed automatically, typically when the script finishes executing.\n"
1167 " However in some cases its hard to predict when this will be and its useful to\n"
1168 " explicitly free the data.\n");
1192 bpy_bmesh_to_mesh_doc,
1193 ".. method:: to_mesh(mesh)\n"
1195 " Writes this BMesh data into an existing Mesh datablock.\n"
1197 " :arg mesh: The mesh data to write into.\n"
1198 " :type mesh: :class:`Mesh`\n");
1207 if (!PyArg_ParseTuple(args,
"O:to_mesh", &py_mesh) ||
1214 if (mesh->runtime->edit_mesh) {
1215 PyErr_Format(PyExc_ValueError,
"to_mesh(): Mesh '%s' is in editmode", mesh->id.name + 2);
1221 Main *bmain =
nullptr;
1223 params.update_shapekey_indices =
true;
1231 params.calc_object_remap =
true;
1245 bpy_bmesh_from_object_doc,
1246 ".. method:: from_object(object, depsgraph, cage=False, face_normals=True, "
1247 "vertex_normals=True)\n"
1249 " Initialize this bmesh from existing object data-block (only meshes are currently "
1252 " :arg object: The object data to load.\n"
1253 " :type object: :class:`Object`\n"
1254 " :type depsgraph: :class:`Depsgraph`\n"
1255 " :arg cage: Get the mesh as a deformed cage.\n"
1256 " :type cage: bool\n"
1257 " :arg face_normals: Calculate face normals.\n"
1258 " :type face_normals: bool\n"
1259 " :arg vertex_normals: Calculate vertex normals.\n"
1260 " :type vertex_normals: bool\n");
1263 static const char *kwlist[] = {
1264 "object",
"depsgraph",
"cage",
"face_normals",
"vertex_normals",
nullptr};
1265 PyObject *py_object;
1266 PyObject *py_depsgraph;
1270 const Mesh *mesh_eval;
1272 bool use_cage =
false;
1273 bool use_fnorm =
true;
1274 bool use_vert_normal =
true;
1279 if (!PyArg_ParseTupleAndKeywords(args,
1281 "OO|$O&O&O&:from_object",
1290 &use_vert_normal) ||
1298 PyErr_SetString(PyExc_ValueError,
1299 "from_object(...): currently only mesh objects are supported");
1306 bool need_free =
false;
1311 PyErr_SetString(PyExc_ValueError,
1312 "from_object(...): cage arg is unsupported when dependency graph "
1313 "evaluation mode is RENDER");
1329 if (mesh_eval ==
nullptr) {
1330 PyErr_Format(PyExc_ValueError,
1331 "from_object(...): Object '%s' has no usable mesh data",
1339 params.calc_face_normal = use_fnorm;
1340 params.calc_vert_normal = use_vert_normal;
1352 bpy_bmesh_from_mesh_doc,
1353 ".. method:: from_mesh(mesh, face_normals=True, vertex_normals=True, use_shape_key=False, "
1354 "shape_key_index=0)\n"
1356 " Initialize this bmesh from existing mesh datablock.\n"
1358 " :arg mesh: The mesh data to load.\n"
1359 " :type mesh: :class:`Mesh`\n"
1360 " :type face_normals: bool\n"
1361 " :type vertex_normals: bool\n"
1362 " :arg use_shape_key: Use the locations from a shape key.\n"
1363 " :type use_shape_key: bool\n"
1364 " :arg shape_key_index: The shape key index to use.\n"
1365 " :type shape_key_index: int\n"
1369 " Multiple calls can be used to join multiple meshes.\n"
1371 " Custom-data layers are only copied from ``mesh`` on initialization.\n"
1372 " Further calls will copy custom-data to matching layers, layers missing on the target "
1373 "mesh won't be added.\n");
1376 static const char *kwlist[] = {
1377 "mesh",
"face_normals",
"vertex_normals",
"use_shape_key",
"shape_key_index",
nullptr};
1381 bool use_fnorm =
true;
1382 bool use_vert_normal =
true;
1383 bool use_shape_key =
false;
1384 int shape_key_index = 0;
1388 if (!PyArg_ParseTupleAndKeywords(args,
1390 "O|$O&O&O&i:from_mesh",
1399 &shape_key_index) ||
1408 params.calc_face_normal = use_fnorm;
1409 params.calc_vert_normal = use_vert_normal;
1410 params.use_shapekey = use_shape_key;
1411 params.active_shapekey = shape_key_index + 1;
1419 bpy_bmesh_select_flush_mode_doc,
1420 ".. method:: select_flush_mode()\n"
1422 " flush selection based on the current mode current :class:`BMesh.select_mode`.\n");
1434 bpy_bmesh_select_flush_doc,
1435 ".. method:: select_flush(select)\n"
1437 " Flush selection, independent of the current selection mode.\n"
1439 " :arg select: flush selection or de-selected elements.\n"
1440 " :type select: bool\n");
1463 bpy_bmesh_normal_update_doc,
1464 ".. method:: normal_update()\n"
1466 " Update normals of mesh faces and verts.\n"
1470 " The normal of any vertex where :attr:`is_wire` is True will be a zero vector.\n");
1483 bpy_bmesh_transform_doc,
1484 ".. method:: transform(matrix, filter=None)\n"
1486 " Transform the mesh (optionally filtering flagged data only).\n"
1488 " :arg matrix: 4x4x transform matrix.\n"
1489 " :type matrix: :class:`mathutils.Matrix`\n"
1492 " :type filter: set[str]\n");
1495 static const char *kwlist[] = {
"matrix",
"filter",
nullptr};
1498 PyObject *filter =
nullptr;
1499 int filter_flags = 0;
1503 if (!PyArg_ParseTupleAndKeywords(
1504 args, kw,
"O!|$O!:transform", (
char **)kwlist, &
matrix_Type, &mat, &PySet_Type, &filter))
1517 PyErr_SetString(PyExc_ValueError,
"expected a 4x4 matrix");
1521 if (filter !=
nullptr &&
1527 mat_ptr = mat->matrix;
1529 if (!filter_flags) {
1535 const char filter_flags_ch = char(filter_flags);
1548 bpy_bmesh_calc_volume_doc,
1549 ".. method:: calc_volume(signed=False)\n"
1551 " Calculate mesh volume based on face normals.\n"
1553 " :arg signed: when signed is true, negative values may be returned.\n"
1554 " :type signed: bool\n"
1555 " :return: The volume of the mesh.\n"
1556 " :rtype: float\n");
1559 static const char *kwlist[] = {
"signed",
nullptr};
1560 PyObject *is_signed = Py_False;
1564 if (!PyArg_ParseTupleAndKeywords(
1565 args, kw,
"|$O!:calc_volume", (
char **)kwlist, &PyBool_Type, &is_signed))
1575 bpy_bmesh_calc_loop_triangles_doc,
1576 ".. method:: calc_loop_triangles()\n"
1578 " Calculate triangle tessellation from quads/ngons.\n"
1580 " :return: The triangulated faces.\n"
1581 " :rtype: list[tuple[:class:`BMLoop`, :class:`BMLoop`, :class:`BMLoop`]]\n");
1586 int corner_tris_tot;
1599 ret = PyList_New(corner_tris_tot);
1600 for (i = 0; i < corner_tris_tot; i++) {
1612 bpy_bm_elem_select_set_doc,
1613 ".. method:: select_set(select)\n"
1615 " Set the selection.\n"
1616 " This is different from the *select* attribute because it updates the selection "
1617 "state of associated geometry.\n"
1619 " :arg select: Select or de-select.\n"
1620 " :type select: bool\n"
1624 " Currently this only flushes down, so selecting a face will select all its "
1625 "vertices but de-selecting a vertex "
1626 " won't de-select all the faces that use it, before finishing with a mesh "
1627 "typically flushing is still needed.\n");
1645 bpy_bm_elem_hide_set_doc,
1646 ".. method:: hide_set(hide)\n"
1648 " Set the hide state.\n"
1649 " This is different from the *hide* attribute because it updates the selection and "
1650 "hide state of associated geometry.\n"
1652 " :arg hide: Hidden or visible.\n"
1653 " :type hide: bool\n");
1671 bpy_bm_elem_copy_from_doc,
1672 ".. method:: copy_from(other)\n"
1674 " Copy values from another element of matching type.\n");
1679 if (Py_TYPE(
self) != Py_TYPE(value)) {
1680 PyErr_Format(PyExc_TypeError,
1681 "expected element of type '%.200s' not '%.200s'",
1682 Py_TYPE(
self)->tp_name,
1683 Py_TYPE(value)->tp_name);
1687 if (value->ele !=
self->ele) {
1688 switch (
self->ele->head.htype) {
1694 reinterpret_cast<const BMVert *
>(value->ele),
1703 reinterpret_cast<const BMEdge *
>(value->ele),
1712 reinterpret_cast<const BMFace *
>(value->ele),
1721 reinterpret_cast<const BMLoop *
>(value->ele),
1736 bpy_bmvert_copy_from_vert_interp_doc,
1737 ".. method:: copy_from_vert_interp(vert_pair, fac)\n"
1739 " Interpolate the customdata from a vert between 2 other verts.\n"
1741 " :arg vert_pair: The verts between which to interpolate data from.\n"
1742 " :type vert_pair: Sequence[:class:`BMVert`]\n"
1743 " :type fac: float\n");
1751 if (!PyArg_ParseTuple(args,
"Of:BMVert.copy_from_vert_interp", &vert_seq, &fac)) {
1756 BMVert **vert_array =
nullptr;
1757 Py_ssize_t vert_seq_len;
1759 vert_array =
static_cast<BMVert **
>(
1768 "BMVert.copy_from_vert_interp(...)"));
1770 if (vert_array ==
nullptr) {
1776 PyMem_FREE(vert_array);
1782 bpy_bmvert_copy_from_face_interp_doc,
1783 ".. method:: copy_from_face_interp(face)\n"
1785 " Interpolate the customdata from a face onto this loop (the loops vert should "
1786 "overlap the face).\n"
1788 " :arg face: The face to interpolate data from.\n"
1789 " :type face: :class:`BMFace`\n");
1796 if (!PyArg_ParseTuple(args,
"O!:BMVert.copy_from_face_interp", &
BPy_BMFace_Type, &py_face)) {
1811 bpy_bmvert_calc_edge_angle_doc,
1812 ".. method:: calc_edge_angle(fallback=None)\n"
1814 " Return the angle between this vert's two connected edges.\n"
1816 " :arg fallback: return this when the vert doesn't have 2 edges\n"
1817 " (instead of raising a :exc:`ValueError`).\n"
1818 " :type fallback: Any\n"
1819 " :return: Angle between edges in radians.\n"
1820 " :rtype: float\n");
1823 const float angle_invalid = -1.0f;
1825 PyObject *fallback =
nullptr;
1829 if (!PyArg_ParseTuple(args,
"|O:calc_edge_angle", &fallback)) {
1835 if (angle == angle_invalid) {
1838 Py_INCREF(fallback);
1842 PyErr_SetString(PyExc_ValueError,
1843 "BMVert.calc_edge_angle(): "
1844 "vert must connect to exactly 2 edges");
1848 return PyFloat_FromDouble(angle);
1853 bpy_bmvert_calc_shell_factor_doc,
1854 ".. method:: calc_shell_factor()\n"
1856 " Return a multiplier calculated based on the sharpness of the vertex.\n"
1857 " Where a flat surface gives 1.0, and higher values sharper edges.\n"
1858 " This is used to maintain shell thickness when offsetting verts along their normals.\n"
1860 " :return: offset multiplier\n"
1861 " :rtype: float\n");
1870 bpy_bmvert_normal_update_doc,
1871 ".. method:: normal_update()\n"
1873 " Update vertex normal.\n"
1874 " This does not update the normals of adjoining faces.\n"
1878 " The vertex normal will be a zero vector if vertex :attr:`is_wire` is True.\n");
1893 bpy_bmedge_calc_length_doc,
1894 ".. method:: calc_length()\n"
1896 " :return: The length between both verts.\n"
1897 " :rtype: float\n");
1906 bpy_bmedge_calc_face_angle_doc,
1907 ".. method:: calc_face_angle(fallback=None)\n"
1909 " :arg fallback: return this when the edge doesn't have 2 faces\n"
1910 " (instead of raising a :exc:`ValueError`).\n"
1911 " :type fallback: Any\n"
1912 " :return: The angle between 2 connected faces in radians.\n"
1913 " :rtype: float\n");
1916 const float angle_invalid = -1.0f;
1918 PyObject *fallback =
nullptr;
1922 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle", &fallback)) {
1928 if (angle == angle_invalid) {
1931 Py_INCREF(fallback);
1935 PyErr_SetString(PyExc_ValueError,
1936 "BMEdge.calc_face_angle(): "
1937 "edge doesn't use 2 faces");
1941 return PyFloat_FromDouble(angle);
1946 bpy_bmedge_calc_face_angle_signed_doc,
1947 ".. method:: calc_face_angle_signed(fallback=None)\n"
1949 " :arg fallback: return this when the edge doesn't have 2 faces\n"
1950 " (instead of raising a :exc:`ValueError`).\n"
1951 " :type fallback: Any\n"
1952 " :return: The angle between 2 connected faces in radians (negative for concave join).\n"
1953 " :rtype: float\n");
1956 const float angle_invalid = -
FLT_MAX;
1958 PyObject *fallback =
nullptr;
1962 if (!PyArg_ParseTuple(args,
"|O:calc_face_angle_signed", &fallback)) {
1968 if (angle == angle_invalid) {
1971 Py_INCREF(fallback);
1975 PyErr_SetString(PyExc_ValueError,
1976 "BMEdge.calc_face_angle_signed(): "
1977 "edge doesn't use 2 faces");
1981 return PyFloat_FromDouble(angle);
1986 bpy_bmedge_calc_tangent_doc,
1987 ".. method:: calc_tangent(loop)\n"
1989 " Return the tangent at this edge relative to a face (pointing inward into the face).\n"
1990 " This uses the face normal for calculation.\n"
1992 " :arg loop: The loop used for tangent calculation.\n"
1993 " :type loop: :class:`BMLoop`\n"
1994 " :return: a normalized vector.\n"
1995 " :rtype: :class:`mathutils.Vector`\n");
2001 if (!PyArg_ParseTuple(args,
"O!:BMEdge.calc_face_tangent", &
BPy_BMLoop_Type, &py_loop)) {
2014 bpy_bmedge_other_vert_doc,
2015 ".. method:: other_vert(vert)\n"
2017 " Return the other vertex on this edge or None if the vertex is not used by this edge.\n"
2019 " :arg vert: a vert in this edge.\n"
2020 " :type vert: :class:`BMVert`\n"
2021 " :return: The edges other vert.\n"
2022 " :rtype: :class:`BMVert` | None\n");
2029 PyErr_Format(PyExc_TypeError,
2030 "BMEdge.other_vert(vert): BMVert expected, not '%.200s'",
2031 Py_TYPE(value)->tp_name);
2049 bpy_bmedge_normal_update_doc,
2050 ".. method:: normal_update()\n"
2052 " Update normals of all connected faces and the edge verts.\n"
2056 " The normal of edge vertex will be a zero vector if vertex :attr:`is_wire` is True.\n");
2071 bpy_bmface_copy_from_face_interp_doc,
2072 ".. method:: copy_from_face_interp(face, vert=True)\n"
2074 " Interpolate the customdata from another face onto this one (faces should overlap).\n"
2076 " :arg face: The face to interpolate data from.\n"
2077 " :type face: :class:`BMFace`\n"
2078 " :arg vert: When True, also copy vertex data.\n"
2079 " :type vert: bool\n");
2083 bool do_vertex =
true;
2087 if (!PyArg_ParseTuple(args,
2088 "O!|O&:BMFace.copy_from_face_interp",
2108 bpy_bmface_copy_doc,
2109 ".. method:: copy(verts=True, edges=True)\n"
2111 " Make a copy of this face.\n"
2113 " :arg verts: When set, the faces verts will be duplicated too.\n"
2114 " :type verts: bool\n"
2115 " :arg edges: When set, the faces edges will be duplicated too.\n"
2116 " :type edges: bool\n"
2117 " :return: The newly created face.\n"
2118 " :rtype: :class:`BMFace`\n");
2121 static const char *kwlist[] = {
"verts",
"edges",
nullptr};
2124 bool do_verts =
true;
2125 bool do_edges =
true;
2130 if (!PyArg_ParseTupleAndKeywords(args,
2132 "|$O&O&:BMFace.copy",
2148 PyErr_SetString(PyExc_ValueError,
"BMFace.copy(): couldn't create the new face, internal error");
2154 bpy_bmface_calc_area_doc,
2155 ".. method:: calc_area()\n"
2157 " Return the area of the face.\n"
2159 " :return: Return the area of the face.\n"
2160 " :rtype: float\n");
2169 bpy_bmface_calc_perimeter_doc,
2170 ".. method:: calc_perimeter()\n"
2172 " Return the perimeter of the face.\n"
2174 " :return: Return the perimeter of the face.\n"
2175 " :rtype: float\n");
2184 bpy_bmface_calc_tangent_edge_doc,
2185 ".. method:: calc_tangent_edge()\n"
2187 " Return face tangent based on longest edge.\n"
2189 " :return: a normalized vector.\n"
2190 " :rtype: :class:`mathutils.Vector`\n");
2202 bpy_bmface_calc_tangent_edge_pair_doc,
2203 ".. method:: calc_tangent_edge_pair()\n"
2205 " Return face tangent based on the two longest disconnected edges.\n"
2207 " - Tris: Use the edge pair with the most similar lengths.\n"
2208 " - Quads: Use the longest edge pair.\n"
2209 " - NGons: Use the two longest disconnected edges.\n"
2211 " :return: a normalized vector.\n"
2212 " :rtype: :class:`mathutils.Vector`\n");
2224 bpy_bmface_calc_tangent_edge_diagonal_doc,
2225 ".. method:: calc_tangent_edge_diagonal()\n"
2227 " Return face tangent based on the edge farthest from any vertex.\n"
2229 " :return: a normalized vector.\n"
2230 " :rtype: :class:`mathutils.Vector`\n");
2242 bpy_bmface_calc_tangent_vert_diagonal_doc,
2243 ".. method:: calc_tangent_vert_diagonal()\n"
2245 " Return face tangent based on the two most distant vertices.\n"
2247 " :return: a normalized vector.\n"
2248 " :rtype: :class:`mathutils.Vector`\n");
2260 bpy_bmface_calc_center_median_doc,
2261 ".. method:: calc_center_median()\n"
2263 " Return median center of the face.\n"
2265 " :return: a 3D vector.\n"
2266 " :rtype: :class:`mathutils.Vector`\n");
2278 bpy_bmface_calc_center_median_weighted_doc,
2279 ".. method:: calc_center_median_weighted()\n"
2281 " Return median center of the face weighted by edge lengths.\n"
2283 " :return: a 3D vector.\n"
2284 " :rtype: :class:`mathutils.Vector`\n");
2296 bpy_bmface_calc_center_bounds_doc,
2297 ".. method:: calc_center_bounds()\n"
2299 " Return bounds center of the face.\n"
2301 " :return: a 3D vector.\n"
2302 " :rtype: :class:`mathutils.Vector`\n");
2314 bpy_bmface_normal_update_doc,
2315 ".. method:: normal_update()\n"
2317 " Update face normal based on the positions of the face verts.\n"
2318 " This does not update the normals of face verts.\n");
2330 bpy_bmface_normal_flip_doc,
2331 ".. method:: normal_flip()\n"
2333 " Reverses winding of a face, which flips its normal.\n");
2348 bpy_bmloop_copy_from_face_interp_doc,
2349 ".. method:: copy_from_face_interp(face, vert=True, multires=True)\n"
2351 " Interpolate the customdata from a face onto this loop (the loops vert should "
2352 "overlap the face).\n"
2354 " :arg face: The face to interpolate data from.\n"
2355 " :type face: :class:`BMFace`\n"
2356 " :arg vert: When enabled, interpolate the loops vertex data (optional).\n"
2357 " :type vert: bool\n"
2358 " :arg multires: When enabled, interpolate the loops multires data (optional).\n"
2359 " :type multires: bool\n");
2363 bool do_vertex =
true;
2364 bool do_multires =
true;
2368 if (!PyArg_ParseTuple(args,
2369 "O!|O&O&:BMLoop.copy_from_face_interp",
2391 bpy_bmloop_calc_angle_doc,
2392 ".. method:: calc_angle()\n"
2394 " Return the angle at this loops corner of the face.\n"
2395 " This is calculated so sharper corners give lower angles.\n"
2397 " :return: The angle in radians.\n"
2398 " :rtype: float\n");
2407 bpy_bmloop_calc_normal_doc,
2408 ".. method:: calc_normal()\n"
2410 " Return normal at this loops corner of the face.\n"
2411 " Falls back to the face normal for straight lines.\n"
2413 " :return: a normalized vector.\n"
2414 " :rtype: :class:`mathutils.Vector`\n");
2425 bpy_bmloop_calc_tangent_doc,
2426 ".. method:: calc_tangent()\n"
2428 " Return the tangent at this loops corner of the face (pointing inward into the face).\n"
2429 " Falls back to the face normal for straight lines.\n"
2431 " :return: a normalized vector.\n"
2432 " :rtype: :class:`mathutils.Vector`\n");
2445 bpy_bmvertseq_new_doc,
2446 ".. method:: new(co=(0.0, 0.0, 0.0), example=None)\n"
2448 " Create a new vertex.\n"
2450 " :arg co: The initial location of the vertex (optional argument).\n"
2451 " :type co: float triplet\n"
2452 " :arg example: Existing vert to initialize settings.\n"
2453 " :type example: :class:`BMVert`\n"
2454 " :return: The newly created vertex.\n"
2455 " :rtype: :class:`BMVert`\n");
2458 PyObject *py_co =
nullptr;
2463 if (!PyArg_ParseTuple(args,
"|OO!:verts.new", &py_co, &
BPy_BMVert_Type, &py_vert_example)) {
2469 float co[3] = {0.0f, 0.0f, 0.0f};
2471 if (py_vert_example) {
2482 PyErr_SetString(PyExc_ValueError,
2483 "faces.new(verts): couldn't create the new face, internal error");
2487 if (py_vert_example) {
2488 if (py_vert_example->
bm ==
bm) {
2505 bpy_bmedgeseq_new_doc,
2506 ".. method:: new(verts, example=None)\n"
2508 " Create a new edge from a given pair of verts.\n"
2510 " :arg verts: Vertex pair.\n"
2511 " :type verts: Sequence[:class:`BMVert`]\n"
2512 " :arg example: Existing edge to initialize settings (optional argument).\n"
2513 " :type example: :class:`BMEdge`\n"
2514 " :return: The newly created edge.\n"
2515 " :rtype: :class:`BMEdge`\n");
2523 if (!PyArg_ParseTuple(args,
"O|O!:edges.new", &vert_seq, &
BPy_BMEdge_Type, &py_edge_example)) {
2529 BMVert **vert_array =
nullptr;
2530 Py_ssize_t vert_seq_len;
2531 PyObject *
ret =
nullptr;
2533 if (py_edge_example) {
2538 &
bm, vert_seq, 2, 2, &vert_seq_len,
BM_VERT,
true,
true,
"edges.new(...)"));
2540 if (vert_array ==
nullptr) {
2545 PyErr_SetString(PyExc_ValueError,
"edges.new(): this edge exists");
2552 PyErr_SetString(PyExc_ValueError,
2553 "faces.new(verts): couldn't create the new face, internal error");
2557 if (py_edge_example) {
2558 if (py_edge_example->
bm ==
bm) {
2572 PyMem_FREE(vert_array);
2581 bpy_bmfaceseq_new_doc,
2582 ".. method:: new(verts, example=None)\n"
2584 " Create a new face from a given set of verts.\n"
2586 " :arg verts: Sequence of 3 or more verts.\n"
2587 " :type verts: Sequence[:class:`BMVert`]\n"
2588 " :arg example: Existing face to initialize settings (optional argument).\n"
2589 " :type example: :class:`BMFace`\n"
2590 " :return: The newly created face.\n"
2591 " :rtype: :class:`BMFace`\n");
2599 if (!PyArg_ParseTuple(args,
"O|O!:faces.new", &vert_seq, &
BPy_BMFace_Type, &py_face_example)) {
2604 Py_ssize_t vert_seq_len;
2606 BMVert **vert_array =
nullptr;
2608 PyObject *
ret =
nullptr;
2612 if (py_face_example) {
2617 &
bm, vert_seq, 3, PY_SSIZE_T_MAX, &vert_seq_len,
BM_VERT,
true,
true,
"faces.new(...)"));
2619 if (vert_array ==
nullptr) {
2625 PyErr_SetString(PyExc_ValueError,
"faces.new(verts): face already exists");
2635 py_face_example ? py_face_example->
f :
nullptr,
2640 PyErr_SetString(PyExc_ValueError,
2641 "faces.new(verts): couldn't create the new face, internal error");
2650 PyMem_FREE(vert_array);
2660 bpy_bmvertseq_remove_doc,
2661 ".. method:: remove(vert)\n"
2665 " :type vert: :class:`BMVert`\n");
2686 bpy_bmedgeseq_remove_doc,
2687 ".. method:: remove(edge)\n"
2689 " Remove an edge.\n"
2691 " :type edge: :class:`BMEdge`\n");
2712 bpy_bmfaceseq_remove_doc,
2713 ".. method:: remove(face)\n"
2717 " :type face: :class:`BMFace`\n");
2738 bpy_bmedgeseq_get__method_doc,
2739 ".. method:: get(verts, fallback=None)\n"
2741 " Return an edge which uses the **verts** passed.\n"
2743 " :arg verts: Sequence of verts.\n"
2744 " :type verts: Sequence[:class:`BMVert`]\n"
2745 " :arg fallback: Return this value if nothing is found.\n"
2746 " :return: The edge found or None\n"
2747 " :rtype: :class:`BMEdge`\n");
2751 PyObject *fallback = Py_None;
2755 if (!PyArg_ParseTuple(args,
"O|O:edges.get", &vert_seq, &fallback)) {
2761 BMVert **vert_array =
nullptr;
2762 Py_ssize_t vert_seq_len;
2763 PyObject *
ret =
nullptr;
2766 &
bm, vert_seq, 2, 2, &vert_seq_len,
BM_VERT,
true,
true,
"edges.get(...)"));
2768 if (vert_array ==
nullptr) {
2780 PyMem_FREE(vert_array);
2786 bpy_bmfaceseq_get__method_doc,
2787 ".. method:: get(verts, fallback=None)\n"
2789 " Return a face which uses the **verts** passed.\n"
2791 " :arg verts: Sequence of verts.\n"
2792 " :type verts: Sequence[:class:`BMVert`]\n"
2793 " :arg fallback: Return this value if nothing is found.\n"
2794 " :return: The face found or None\n"
2795 " :rtype: :class:`BMFace`\n");
2799 PyObject *fallback = Py_None;
2803 if (!PyArg_ParseTuple(args,
"O|O:faces.get", &vert_seq, &fallback)) {
2809 BMVert **vert_array =
nullptr;
2810 Py_ssize_t vert_seq_len;
2811 PyObject *
ret =
nullptr;
2814 &
bm, vert_seq, 1, PY_SSIZE_T_MAX, &vert_seq_len,
BM_VERT,
true,
true,
"faces.get(...)"));
2816 if (vert_array ==
nullptr) {
2829 PyMem_FREE(vert_array);
2835 bpy_bmelemseq_index_update_doc,
2836 ".. method:: index_update()\n"
2838 " Initialize the index values of this sequence.\n"
2840 " This is the equivalent of looping over all elements and assigning the index values.\n"
2842 " .. code-block:: python\n"
2844 " for index, ele in enumerate(sequence):\n"
2845 " ele.index = index\n"
2849 " Running this on sequences besides :class:`BMesh.verts`, :class:`BMesh.edges`, "
2850 ":class:`BMesh.faces`\n"
2851 " works but won't result in each element having a valid index, instead its order in the "
2852 "sequence will be set.\n");
2893 bpy_bmelemseq_ensure_lookup_table_doc,
2894 ".. method:: ensure_lookup_table()\n"
2896 " Ensure internal data needed for int subscription is initialized with "
2897 "verts/edges/faces, eg ``bm.verts[index]``.\n"
2899 " This needs to be called again after adding/removing data in this sequence.");
2911 bpy_bmelemseq_sort_doc,
2912 ".. method:: sort(key=None, reverse=False)\n"
2914 " Sort the elements of this sequence, using an optional custom sort key.\n"
2915 " Indices of elements are not changed, :class:`BMElemSeq.index_update` can be used for "
2918 " :arg key: The key that sets the ordering of the elements.\n"
2919 " :type key: Callable[[:class:`BMVert` | :class:`BMEdge` | :class:`BMFace`], int] | None\n"
2920 " :arg reverse: Reverse the order of the elements\n"
2921 " :type reverse: bool\n"
2925 " When the 'key' argument is not provided, the elements are reordered following their "
2926 "current index value.\n"
2927 " In particular this can be used by setting indices manually before calling this "
2932 " Existing references to the N'th element, will continue to point the data at that "
2948 const void *index2_v,
2951 const double *keys =
static_cast<const double *
>(keys_v);
2952 const int *index1 = (
int *)index1_v;
2953 const int *index2 = (
int *)index2_v;
2955 if (keys[*index1] < keys[*index2]) {
2958 if (keys[*index1] > keys[*index2]) {
2966 const void *index2_v,
2974 static const char *kwlist[] = {
"key",
"reverse",
nullptr};
2975 PyObject *keyfunc =
nullptr;
2976 bool do_reverse =
false;
2987 int (*elem_idx_compare_by_keys)(
const void *,
const void *,
void *);
2989 uint *vert_idx =
nullptr;
2990 uint *edge_idx =
nullptr;
2991 uint *face_idx =
nullptr;
2998 if (args !=
nullptr) {
2999 if (!PyArg_ParseTupleAndKeywords(args,
3001 "|$OO&:BMElemSeq.sort",
3009 if (keyfunc == Py_None) {
3014 if (keyfunc !=
nullptr && !PyCallable_Check(keyfunc)) {
3015 PyErr_SetString(PyExc_TypeError,
"the 'key' argument is not a callable object");
3025 keys =
static_cast<double *
>(PyMem_MALLOC(
sizeof(*keys) * n_elem));
3026 if (keys ==
nullptr) {
3033 if (keyfunc !=
nullptr) {
3038 index = PyObject_CallFunctionObjArgs(keyfunc, py_elem,
nullptr);
3040 if (index ==
nullptr) {
3047 if ((keys[i] = PyFloat_AsDouble(index)) == -1 && PyErr_Occurred()) {
3048 PyErr_SetString(PyExc_ValueError,
3049 "the value returned by the 'key' function is not a number");
3066 elem_idx =
static_cast<int *
>(PyMem_MALLOC(
sizeof(*elem_idx) * n_elem));
3067 if (elem_idx ==
nullptr) {
3084 BLI_qsort_r(elem_idx, n_elem,
sizeof(*elem_idx), elem_idx_compare_by_keys, keys);
3086 elem_map_idx =
static_cast<uint *
>(PyMem_MALLOC(
sizeof(*elem_map_idx) * n_elem));
3087 if (elem_map_idx ==
nullptr) {
3089 PyMem_FREE(elem_idx);
3099 for (i = 0; i < n_elem; i++) {
3100 elem_map_idx[elem_idx[i]] = i;
3105 vert_idx = elem_map_idx;
3108 edge_idx = elem_map_idx;
3111 face_idx = elem_map_idx;
3114 PyErr_Format(PyExc_TypeError,
"element type %d not supported",
self->itype);
3115 PyMem_FREE(elem_map_idx);
3116 PyMem_FREE(elem_idx);
3123 PyMem_FREE(elem_map_idx);
3124 PyMem_FREE(elem_idx);
3130#if (defined(__GNUC__) && !defined(__clang__))
3131# pragma GCC diagnostic push
3132# pragma GCC diagnostic ignored "-Wcast-function-type"
3137 {
"copy", (PyCFunction)
bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
3138 {
"clear", (PyCFunction)
bpy_bmesh_clear, METH_NOARGS, bpy_bmesh_clear_doc},
3139 {
"free", (PyCFunction)
bpy_bmesh_free, METH_NOARGS, bpy_bmesh_free_doc},
3144 METH_VARARGS | METH_KEYWORDS,
3145 bpy_bmesh_from_object_doc},
3148 METH_VARARGS | METH_KEYWORDS,
3149 bpy_bmesh_from_mesh_doc},
3150 {
"to_mesh", (PyCFunction)
bpy_bmesh_to_mesh, METH_VARARGS, bpy_bmesh_to_mesh_doc},
3153 {
"select_flush_mode",
3156 bpy_bmesh_select_flush_mode_doc},
3161 bpy_bmesh_normal_update_doc},
3164 METH_VARARGS | METH_KEYWORDS,
3165 bpy_bmesh_transform_doc},
3170 METH_VARARGS | METH_KEYWORDS,
3171 bpy_bmesh_calc_volume_doc},
3172 {
"calc_loop_triangles",
3175 bpy_bmesh_calc_loop_triangles_doc},
3176 {
nullptr,
nullptr, 0,
nullptr},
3183 {
"copy_from_face_interp",
3186 bpy_bmvert_copy_from_face_interp_doc},
3187 {
"copy_from_vert_interp",
3190 bpy_bmvert_copy_from_vert_interp_doc},
3195 bpy_bmvert_calc_edge_angle_doc},
3196 {
"calc_shell_factor",
3199 bpy_bmvert_calc_shell_factor_doc},
3204 bpy_bmvert_normal_update_doc},
3206 {
nullptr,
nullptr, 0,
nullptr},
3220 bpy_bmedge_calc_face_angle_doc},
3221 {
"calc_face_angle_signed",
3224 bpy_bmedge_calc_face_angle_signed_doc},
3228 bpy_bmedge_calc_tangent_doc},
3233 bpy_bmedge_normal_update_doc},
3235 {
nullptr,
nullptr, 0,
nullptr},
3243 {
"copy_from_face_interp",
3246 bpy_bmface_copy_from_face_interp_doc},
3248 {
"copy", (PyCFunction)
bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc},
3254 bpy_bmface_calc_perimeter_doc},
3255 {
"calc_tangent_edge",
3258 bpy_bmface_calc_tangent_edge_doc},
3259 {
"calc_tangent_edge_pair",
3262 bpy_bmface_calc_tangent_edge_pair_doc},
3263 {
"calc_tangent_edge_diagonal",
3266 bpy_bmface_calc_tangent_edge_diagonal_doc},
3267 {
"calc_tangent_vert_diagonal",
3270 bpy_bmface_calc_tangent_vert_diagonal_doc},
3271 {
"calc_center_median",
3274 bpy_bmface_calc_center_median_doc},
3275 {
"calc_center_median_weighted",
3278 bpy_bmface_calc_center_median_weighted_doc},
3279 {
"calc_center_bounds",
3282 bpy_bmface_calc_center_bounds_doc},
3287 bpy_bmface_normal_update_doc},
3290 {
nullptr,
nullptr, 0,
nullptr},
3295 {
"copy_from_face_interp",
3298 bpy_bmloop_copy_from_face_interp_doc},
3305 bpy_bmloop_calc_tangent_doc},
3306 {
nullptr,
nullptr, 0,
nullptr},
3314 bpy_bmelemseq_index_update_doc},
3315 {
nullptr,
nullptr, 0,
nullptr},
3326 bpy_bmelemseq_index_update_doc},
3327 {
"ensure_lookup_table",
3330 bpy_bmelemseq_ensure_lookup_table_doc},
3333 METH_VARARGS | METH_KEYWORDS,
3334 bpy_bmelemseq_sort_doc},
3335 {
nullptr,
nullptr, 0,
nullptr},
3348 bpy_bmelemseq_index_update_doc},
3349 {
"ensure_lookup_table",
3352 bpy_bmelemseq_ensure_lookup_table_doc},
3355 METH_VARARGS | METH_KEYWORDS,
3356 bpy_bmelemseq_sort_doc},
3357 {
nullptr,
nullptr, 0,
nullptr},
3370 bpy_bmelemseq_index_update_doc},
3371 {
"ensure_lookup_table",
3374 bpy_bmelemseq_ensure_lookup_table_doc},
3377 METH_VARARGS | METH_KEYWORDS,
3378 bpy_bmelemseq_sort_doc},
3379 {
nullptr,
nullptr, 0,
nullptr},
3386 {
nullptr,
nullptr, 0,
nullptr},
3389#if (defined(__GNUC__) && !defined(__clang__))
3390# pragma GCC diagnostic pop
3437 return self->bm->totvert;
3439 return self->bm->totedge;
3441 return self->bm->totface;
3483 switch (
self->itype) {
3506 PyErr_SetString(PyExc_IndexError,
3507 "BMElemSeq[index]: outdated internal index table, "
3508 "run ensure_lookup_table() first");
3514 self->bm,
self->itype,
self->py_ele ?
self->py_ele->ele :
nullptr, keynum));
3521 PyErr_Format(PyExc_IndexError,
"BMElemSeq[index]: index %d out of range", keynum);
3538 list = PyList_New(0);
3549 for (ok =
true; ok; ok = (BM_iter_step(&iter) !=
nullptr)) {
3550 if (
count == start) {
3557 while ((ele =
static_cast<BMHeader *
>(BM_iter_step(&iter)))) {
3561 if (
count == stop) {
3572 if (PyIndex_Check(key)) {
3573 const Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
3574 if (i == -1 && PyErr_Occurred()) {
3579 if (PySlice_Check(key)) {
3580 PySliceObject *key_slice = (PySliceObject *)key;
3581 Py_ssize_t step = 1;
3583 if (key_slice->step != Py_None && !_PyEval_SliceIndex(key, &step)) {
3587 PyErr_SetString(PyExc_TypeError,
"BMElemSeq[slice]: slice steps not supported");
3590 if (key_slice->start == Py_None && key_slice->stop == Py_None) {
3594 Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
3597 if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) {
3600 if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) {
3604 if (start < 0 || stop < 0) {
3617 if (stop - start <= 0) {
3618 return PyList_New(0);
3624 PyErr_SetString(PyExc_AttributeError,
"BMElemSeq[key]: invalid key, key must be an int");
3634 if (value_bm_ele->
bm ==
self->bm) {
3635 BMElem *ele, *ele_test = value_bm_ele->
ele;
3638 if (ele == ele_test) {
3682 (objobjargproc)
nullptr,
3703 return (PyObject *)py_iter;
3709 if (ele ==
nullptr) {
3710 PyErr_SetNone(PyExc_StopIteration);
3755 void **
ptr =
static_cast<void **
>(
3768 void **
ptr =
static_cast<void **
>(
3781 void **
ptr =
static_cast<void **
>(
3794 void **
ptr =
static_cast<void **
>(
3805 Py_XDECREF(
self->py_ele);
3827 "The BMesh data structure\n");
3831 "The BMesh vertex type\n");
3835 "The BMesh edge connecting 2 verts\n");
3839 "The BMesh face with 3 or more sides\n");
3843 "This is normally accessed from :class:`BMFace.loops` where each face loop "
3844 "represents a corner of the face.\n");
3848 "General sequence type used for accessing any sequence of\n"
3849 ":class:`BMVert`, :class:`BMEdge`, :class:`BMFace`, :class:`BMLoop`.\n"
3851 "When accessed via :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces`\n"
3852 "there are also functions to create/remove items.\n");
3856 "Internal BMesh type for looping over verts/faces/edges,\n"
3857 "used for iterating over :class:`BMElemSeq` types.\n");
3864 return PyUnicode_FromFormat(
"<BMesh(%p), totvert=%d, totedge=%d, totface=%d, totloop=%d>",
3872 return PyUnicode_FromFormat(
"<BMesh dead at %p>",
self);
3884 return PyUnicode_FromFormat(
"<BMVert dead at %p>",
self);
3893 return PyUnicode_FromFormat(
"<BMEdge(%p), index=%d, verts=(%p/%d, %p/%d)>",
3902 return PyUnicode_FromFormat(
"<BMEdge dead at %p>",
self);
3911 return PyUnicode_FromFormat(
3915 return PyUnicode_FromFormat(
"<BMFace dead at %p>",
self);
3924 return PyUnicode_FromFormat(
"<BMLoop(%p), index=%d, vert=%p/%d, edge=%p/%d, face=%p/%d>",
3935 return PyUnicode_FromFormat(
"<BMLoop dead at %p>",
self);
4111 PyModuleDef_HEAD_INIT,
4124 PyObject *submodule;
4184 return (PyObject *)
self;
4191 void **
ptr =
static_cast<void **
>(
4200 if (*
ptr !=
nullptr) {
4211 return (PyObject *)
self;
4218 void **
ptr =
static_cast<void **
>(
4227 if (*
ptr !=
nullptr) {
4238 return (PyObject *)
self;
4245 void **
ptr =
static_cast<void **
>(
4254 if (*
ptr !=
nullptr) {
4265 return (PyObject *)
self;
4272 void **
ptr =
static_cast<void **
>(
4281 if (*
ptr !=
nullptr) {
4292 return (PyObject *)
self;
4299 self->py_ele = py_ele;
4302 return (PyObject *)
self;
4309 self->py_ele =
nullptr;
4311 return (PyObject *)
self;
4318 self->py_ele =
nullptr;
4320 return (PyObject *)
self;
4327 self->py_ele =
nullptr;
4329 return (PyObject *)
self;
4336 self->py_ele =
nullptr;
4338 return (PyObject *)
self;
4346 return (PyObject *)
self;
4351 switch (ele->
htype) {
4362 PyErr_SetString(PyExc_SystemError,
"internal error");
4379 PyExc_ReferenceError,
"BMesh used by %.200s has become invalid", Py_TYPE(
self)->tp_name);
4388 PyExc_ReferenceError,
"BMesh data of type %.200s has been removed", Py_TYPE(
self)->tp_name);
4393 const char *error_prefix,
4399 while (args_tot--) {
4412 PyErr_Format(PyExc_ValueError,
4413 "%.200s: BMesh data of type %.200s is from another mesh",
4415 Py_TYPE(py_bm_elem)->tp_name);
4436 const bool do_unique_check,
4437 const bool do_bm_check,
4438 const char *error_prefix)
4440 BMesh *
bm = (r_bm && *r_bm) ? *r_bm :
nullptr;
4441 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
4442 const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast);
4443 Py_ssize_t i, i_last_dirty = PY_SSIZE_T_MAX;
4450 if (seq_len < min || seq_len > max) {
4451 PyErr_Format(PyExc_TypeError,
4452 "%s: sequence incorrect size, expected [%d - %d], given %d",
4461 alloc =
static_cast<BMElem **
>(PyMem_MALLOC(seq_len *
sizeof(
BPy_BMElem **)));
4463 for (i = 0; i < seq_len; i++) {
4467 PyErr_Format(PyExc_TypeError,
4468 "%s: expected %.200s, not '%.200s'",
4471 Py_TYPE(item)->tp_name);
4476 PyExc_TypeError,
"%s: %d %s has been removed", error_prefix, i, Py_TYPE(item)->tp_name);
4481 else if (do_bm_check && (
bm &&
bm != item->
bm)) {
4482 PyErr_Format(PyExc_ValueError,
4483 "%s: %d %s is from another mesh",
4490 if (
bm ==
nullptr) {
4494 alloc[i] = item->
ele;
4496 if (do_unique_check) {
4502 if (do_unique_check) {
4505 for (i = 0; i < seq_len; i++) {
4516 i_last_dirty = PY_SSIZE_T_MAX;
4517 PyErr_Format(PyExc_ValueError,
4518 "%s: found the same %.200s used multiple times",
4532 if (do_unique_check && (i_last_dirty != PY_SSIZE_T_MAX)) {
4533 for (i = 0; i <= i_last_dirty; i++) {
4547 const bool do_unique_check,
4548 const bool do_bm_check,
4549 const char *error_prefix)
4554 if (!(seq_fast = PySequence_Fast(seq, error_prefix))) {
4559 r_bm, seq_fast,
min, max, r_size, htype, do_unique_check, do_bm_check, error_prefix));
4561 Py_DECREF(seq_fast);
4568 PyObject *
ret = PyTuple_New(elem_len);
4569 for (i = 0; i < elem_len; i++) {
4577 PyObject *
ret = PyTuple_New(elem_len);
4578 for (i = 0; i < elem_len; i++) {
4586 PyObject *
ret = PyTuple_New(elem_len);
4587 for (i = 0; i < elem_len; i++) {
4596 PyObject *
ret = PyTuple_New(elem_len);
4597 for (i = 0; i < elem_len; i++) {
4606 PyObject *
ret = PyTuple_New(elem_len);
4607 for (i = 0; i < elem_len; i++) {
4625 const char *ret_array[4];
4642 ret[ret_ofs + 1] =
'\0';
4648 static char ret[32];
CustomData interface, see also DNA_customdata_types.h.
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)
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)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
@ 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)
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.
ATTR_WARN_UNUSED_RESULT BMesh const char itype
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_select_mode_flush(BMesh *bm)
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
void BM_mesh_select_flush(BMesh *bm)
void BM_mesh_deselect_flush(BMesh *bm)
#define BM_elem_hide_set(bm, ele, hide)
void BM_mesh_remap(BMesh *bm, const uint *vert_idx, const uint *edge_idx, const uint *face_idx)
void BM_mesh_clear(BMesh *bm)
BMesh Clear Mesh.
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
int BM_mesh_elem_count(BMesh *bm, const char htype)
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *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_validate(BMesh *bm)
void BM_face_calc_tangent_edge_pair(const BMFace *f, float r_tangent[3])
void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3])
void BM_vert_normal_update(BMVert *v)
void BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_tangent[3])
void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_tangent[3])
void BM_face_normal_update(BMFace *f)
void BM_face_normal_flip(BMesh *bm, BMFace *f)
void BM_face_calc_tangent_edge(const BMFace *f, float r_tangent[3])
float BM_face_calc_area(const BMFace *f)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
void BM_face_calc_center_median_weighted(const BMFace *f, float r_cent[3])
float BM_face_calc_perimeter(const BMFace *f)
void BM_edge_normals_update(BMEdge *e)
static Py_hash_t bpy_bm_hash(PyObject *self)
PyObject * BPy_BMEdgeSeq_CreatePyObject(BMesh *bm)
static PyObject * bpy_bmedge_calc_face_angle_signed(BPy_BMEdge *self, PyObject *args)
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_bmesh_select_flush_mode(BPy_BMesh *self)
static PyObject * bpy_bmface_calc_center_bounds(BPy_BMFace *self)
PyObject * BPy_BMEdge_Array_As_Tuple(BMesh *bm, BMEdge **elem, Py_ssize_t elem_len)
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)
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_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_len)
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_BMesh_CreatePyObject(BMesh *bm, int flag)
PyObject * BPy_BMVert_Array_As_Tuple(BMesh *bm, BMVert **elem, Py_ssize_t elem_len)
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_bmface_normal_get(BPy_BMFace *self, void *)
static PyObject * bpy_bmloop_edge_get(BPy_BMLoop *self, void *)
PyObject * BPy_BMLoop_Array_As_Tuple(BMesh *bm, BMLoop *const *elem, Py_ssize_t elem_len)
static PyMappingMethods bpy_bm_elem_as_mapping
static PyObject * bpy_bmloop_calc_angle(BPy_BMLoop *self)
static PyObject * bpy_bm_elem_hide_set(BPy_BMElem *self, PyObject *value)
char * BPy_BMElem_StringFromHType(const char htype)
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)
PyObject * BPy_BMFace_Array_As_Tuple(BMesh *bm, BMFace **elem, Py_ssize_t elem_len)
static PyMethodDef bpy_bmvert_methods[]
static PyObject * bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *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_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 *)
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 PyObject * bpy_bmvertseq_new(BPy_BMElemSeq *self, PyObject *args)
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)
static PyObject * bpy_bmedge_is_manifold_get(BPy_BMEdge *self, void *)
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[]
static int bpy_bmfaceseq_active_set(BPy_BMElem *self, PyObject *value, void *)
static PyObject * bpy_bmelemseq_index_update(BPy_BMElemSeq *self)
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 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)
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)
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 void bpy_bmface_dealloc(BPy_BMElem *self)
PyTypeObject BPy_BMFaceSeq_Type
PyTypeObject BPy_BMVert_Type
PyTypeObject BPy_BMIter_Type
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_bm_elem_index_get(BPy_BMElem *self, void *)
PyDoc_STRVAR(bpy_bm_elem_select_doc, "Selected state of this element.\n" "\n" ":type: bool")
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)
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
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)
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)
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
const Depsgraph * depsgraph
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
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_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)
PyObject_VAR_HEAD BMesh * bm
PyObject_VAR_HEAD BMesh * bm
PyObject_VAR_HEAD BMesh * bm
PyObject_VAR_HEAD BMesh * bm