|
Blender V4.3
|
#include <Python.h>#include "../mathutils/mathutils.hh"#include "DNA_meshdata_types.h"#include "BKE_customdata.hh"#include "BLI_math_base.h"#include "BLI_math_color.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "BKE_deform.hh"#include "bmesh.hh"#include "bmesh_py_types_meshdata.hh"#include "../generic/py_capi_utils.hh"#include "../generic/python_utildefines.hh"Go to the source code of this file.
Classes | |
| struct | BPy_BMLoopUV |
| struct | BPy_BMVertSkin |
| struct | BPy_BMDeformVert |
Macros | |
| #define | BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type) |
| #define | BPy_BMVertSkin_Check(v) (Py_TYPE(v) == &BPy_BMVertSkin_Type) |
| #define | MLOOPCOL_FROM_CAPSULE(color_capsule) ((MLoopCol *)PyCapsule_GetPointer(color_capsule, nullptr)) |
| #define | BPy_BMDeformVert_Check(v) (Py_TYPE(v) == &BPy_BMDeformVert_Type) |
Functions | |
| PyDoc_STRVAR (bpy_bmloopuv_uv_doc, "Loops UV (as a 2D Vector).\n" "\n" ":type: :class:`mathutils.Vector`") | |
| static PyObject * | bpy_bmloopuv_uv_get (BPy_BMLoopUV *self, void *) |
| static int | bpy_bmloopuv_uv_set (BPy_BMLoopUV *self, PyObject *value, void *) |
| PyDoc_STRVAR (bpy_bmloopuv_pin_uv_doc, "UV pin state.\n" "\n" ":type: bool") | |
| PyDoc_STRVAR (bpy_bmloopuv_select_doc, "UV select state.\n" "\n" ":type: bool") | |
| PyDoc_STRVAR (bpy_bmloopuv_select_edge_doc, "UV edge select state.\n" "\n" ":type: bool") | |
| static PyObject * | bpy_bmloopuv_pin_uv_get (BPy_BMLoopUV *self, void *) |
| static int | bpy_bmloopuv_pin_uv_set (BPy_BMLoopUV *self, PyObject *value, void *) |
| static PyObject * | bpy_bmloopuv_select_get (BPy_BMLoopUV *self, void *) |
| static int | bpy_bmloopuv_select_set (BPy_BMLoopUV *self, PyObject *value, void *) |
| static PyObject * | bpy_bmloopuv_select_edge_get (BPy_BMLoopUV *self, void *) |
| static int | bpy_bmloopuv_select_edge_set (BPy_BMLoopUV *self, PyObject *value, void *) |
| static void | bm_init_types_bmloopuv () |
| int | BPy_BMLoopUV_AssignPyObject (BMesh *bm, BMLoop *loop, PyObject *value) |
| PyObject * | BPy_BMLoopUV_CreatePyObject (BMesh *bm, BMLoop *loop, int layer) |
| PyDoc_STRVAR (bpy_bmvertskin_radius_doc, "Vert skin radii (as a 2D Vector).\n" "\n" ":type: :class:`mathutils.Vector`") | |
| static PyObject * | bpy_bmvertskin_radius_get (BPy_BMVertSkin *self, void *) |
| static int | bpy_bmvertskin_radius_set (BPy_BMVertSkin *self, PyObject *value, void *) |
| PyDoc_STRVAR (bpy_bmvertskin_flag__use_root_doc, "Use as root vertex. Setting this flag does not clear other roots in the same mesh island.\n" "\n" ":type: bool") | |
| PyDoc_STRVAR (bpy_bmvertskin_flag__use_loose_doc, "Use loose vertex.\n" "\n" ":type: bool") | |
| static PyObject * | bpy_bmvertskin_flag_get (BPy_BMVertSkin *self, void *flag_p) |
| static int | bpy_bmvertskin_flag_set (BPy_BMVertSkin *self, PyObject *value, void *flag_p) |
| static void | bm_init_types_bmvertskin () |
| int | BPy_BMVertSkin_AssignPyObject (MVertSkin *mvertskin, PyObject *value) |
| PyObject * | BPy_BMVertSkin_CreatePyObject (MVertSkin *mvertskin) |
| static void | mloopcol_to_float (const MLoopCol *mloopcol, float r_col[4]) |
| static void | mloopcol_from_float (MLoopCol *mloopcol, const float col[4]) |
| static int | mathutils_bmloopcol_check (BaseMathObject *) |
| static int | mathutils_bmloopcol_get (BaseMathObject *bmo, int) |
| static int | mathutils_bmloopcol_set (BaseMathObject *bmo, int) |
| static int | mathutils_bmloopcol_get_index (BaseMathObject *bmo, int subtype, int) |
| static int | mathutils_bmloopcol_set_index (BaseMathObject *bmo, int subtype, int index) |
| static void | bm_init_types_bmloopcol () |
| int | BPy_BMLoopColor_AssignPyObject (MLoopCol *mloopcol, PyObject *value) |
| PyObject * | BPy_BMLoopColor_CreatePyObject (MLoopCol *mloopcol) |
| static Py_ssize_t | bpy_bmdeformvert_len (BPy_BMDeformVert *self) |
| static PyObject * | bpy_bmdeformvert_subscript (BPy_BMDeformVert *self, PyObject *key) |
| static int | bpy_bmdeformvert_ass_subscript (BPy_BMDeformVert *self, PyObject *key, PyObject *value) |
| static int | bpy_bmdeformvert_contains (BPy_BMDeformVert *self, PyObject *value) |
| PyDoc_STRVAR (bpy_bmdeformvert_keys_doc, ".. method:: keys()\n" "\n" " Return the group indices used by this vertex\n" " (matching Python's dict.keys() functionality).\n" "\n" " :return: the deform group this vertex uses\n" " :rtype: list[int]\n") | |
| static PyObject * | bpy_bmdeformvert_keys (BPy_BMDeformVert *self) |
| PyDoc_STRVAR (bpy_bmdeformvert_values_doc, ".. method:: values()\n" "\n" " Return the weights of the deform vertex\n" " (matching Python's dict.values() functionality).\n" "\n" " :return: The weights that influence this vertex\n" " :rtype: list[float]\n") | |
| static PyObject * | bpy_bmdeformvert_values (BPy_BMDeformVert *self) |
| PyDoc_STRVAR (bpy_bmdeformvert_items_doc, ".. method:: items()\n" "\n" " Return (group, weight) pairs for this vertex\n" " (matching Python's dict.items() functionality).\n" "\n" " :return: (key, value) pairs for each deform weight of this vertex.\n" " :rtype: list[tuple[int, float]]\n") | |
| static PyObject * | bpy_bmdeformvert_items (BPy_BMDeformVert *self) |
| PyDoc_STRVAR (bpy_bmdeformvert_get_doc, ".. method:: get(key, default=None)\n" "\n" " Returns the deform weight matching the key or default\n" " when not found (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The key associated with deform weight.\n" " :type key: int\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n") | |
| static PyObject * | bpy_bmdeformvert_get (BPy_BMDeformVert *self, PyObject *args) |
| PyDoc_STRVAR (bpy_bmdeformvert_clear_doc, ".. method:: clear()\n" "\n" " Clears all weights.\n") | |
| static PyObject * | bpy_bmdeformvert_clear (BPy_BMDeformVert *self) |
| static void | bm_init_types_bmdvert () |
| int | BPy_BMDeformVert_AssignPyObject (MDeformVert *dvert, PyObject *value) |
| PyObject * | BPy_BMDeformVert_CreatePyObject (MDeformVert *dvert) |
| void | BPy_BM_init_types_meshdata () |
Variables | |
| static PyGetSetDef | bpy_bmloopuv_getseters [] |
| PyTypeObject | BPy_BMLoopUV_Type |
| static PyGetSetDef | bpy_bmvertskin_getseters [] |
| static PyTypeObject | BPy_BMVertSkin_Type |
| static uchar | mathutils_bmloopcol_cb_index = -1 |
| static Mathutils_Callback | mathutils_bmloopcol_cb |
| static PySequenceMethods | bpy_bmdeformvert_as_sequence |
| static PyMappingMethods | bpy_bmdeformvert_as_mapping |
| static PyMethodDef | bpy_bmdeformvert_methods [] |
| PyTypeObject | BPy_BMDeformVert_Type |
This file defines custom-data types which can't be accessed as primitive Python types such as MDeformVert. It also exposed UV map data in a way compatible with the (deprecated) #MLoopUV type. MLoopUV used to be a struct containing both the UV information and various selection flags. This has since been split up into a float2 attribute and three boolean attributes for the selection/pin states. For backwards compatibility, the original #MLoopUV is emulated in the python API. This comes at a performance penalty however, and the plan is to provide direct access to the boolean layers for faster access. Eventually (probably in 4.0) BPy_BMLoopUV should be removed on the Python side as well.
Definition in file bmesh_py_types_meshdata.cc.
| #define BPy_BMDeformVert_Check | ( | v | ) | (Py_TYPE(v) == &BPy_BMDeformVert_Type) |
This is python type wraps a deform vert as a python dictionary, hiding the MDeformWeight on access, since the mapping is very close, eg:
Definition at line 503 of file bmesh_py_types_meshdata.cc.
Referenced by BPy_BMDeformVert_AssignPyObject().
| #define BPy_BMLoopUV_Check | ( | v | ) | (Py_TYPE(v) == &BPy_BMLoopUV_Type) |
Definition at line 44 of file bmesh_py_types_meshdata.cc.
Referenced by BPy_BMLoopUV_AssignPyObject().
| #define BPy_BMVertSkin_Check | ( | v | ) | (Py_TYPE(v) == &BPy_BMVertSkin_Type) |
Definition at line 253 of file bmesh_py_types_meshdata.cc.
Referenced by BPy_BMVertSkin_AssignPyObject().
| #define MLOOPCOL_FROM_CAPSULE | ( | color_capsule | ) | ((MLoopCol *)PyCapsule_GetPointer(color_capsule, nullptr)) |
Definition at line 383 of file bmesh_py_types_meshdata.cc.
Referenced by mathutils_bmloopcol_get(), and mathutils_bmloopcol_set().
|
static |
Definition at line 771 of file bmesh_py_types_meshdata.cc.
References bpy_bmdeformvert_as_mapping, bpy_bmdeformvert_as_sequence, bpy_bmdeformvert_methods, and BPy_BMDeformVert_Type.
Referenced by BPy_BM_init_types_meshdata().
|
static |
Definition at line 448 of file bmesh_py_types_meshdata.cc.
References mathutils_bmloopcol_cb, mathutils_bmloopcol_cb_index, and Mathutils_RegisterCallback().
Referenced by BPy_BM_init_types_meshdata().
|
static |
Definition at line 191 of file bmesh_py_types_meshdata.cc.
References bpy_bmloopuv_getseters, and BPy_BMLoopUV_Type.
Referenced by BPy_BM_init_types_meshdata().
|
static |
Definition at line 341 of file bmesh_py_types_meshdata.cc.
References bpy_bmvertskin_getseters, and BPy_BMVertSkin_Type.
Referenced by BPy_BM_init_types_meshdata().
| void BPy_BM_init_types_meshdata | ( | ) |
Definition at line 812 of file bmesh_py_types_meshdata.cc.
References bm_init_types_bmdvert(), bm_init_types_bmloopcol(), bm_init_types_bmloopuv(), and bm_init_types_bmvertskin().
Referenced by BPyInit_bmesh().
|
static |
Definition at line 544 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_ensure_index(), BKE_defvert_find_index(), BKE_defvert_remove_group(), clamp_f(), self, and MDeformWeight::weight.
| int BPy_BMDeformVert_AssignPyObject | ( | MDeformVert * | dvert, |
| PyObject * | value ) |
Definition at line 789 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_copy(), BPy_BMDeformVert_Check, LIKELY, and UNLIKELY.
Referenced by BPy_BMLayerItem_SetItem().
|
static |
Definition at line 743 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_clear(), and self.
|
static |
Definition at line 594 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_find_index(), and self.
| PyObject * BPy_BMDeformVert_CreatePyObject | ( | MDeformVert * | dvert | ) |
Definition at line 803 of file bmesh_py_types_meshdata.cc.
References BPy_BMDeformVert_Type, and self.
Referenced by BPy_BMLayerItem_GetItem().
|
static |
Definition at line 719 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_find_index(), self, and MDeformWeight::weight.
|
static |
Definition at line 689 of file bmesh_py_types_meshdata.cc.
References MDeformWeight::def_nr, PyTuple_SET_ITEMS, ret, self, and MDeformWeight::weight.
|
static |
Definition at line 641 of file bmesh_py_types_meshdata.cc.
References MDeformWeight::def_nr, ret, and self.
|
static |
Definition at line 513 of file bmesh_py_types_meshdata.cc.
References self, and MDeformVert::totweight.
|
static |
Definition at line 518 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_find_index(), self, and MDeformWeight::weight.
|
static |
Definition at line 665 of file bmesh_py_types_meshdata.cc.
References ret, self, and MDeformWeight::weight.
Definition at line 454 of file bmesh_py_types_meshdata.cc.
References mathutils_array_parse(), and mloopcol_from_float().
Referenced by BPy_BMLayerItem_SetItem().
| PyObject * BPy_BMLoopColor_CreatePyObject | ( | MLoopCol * | mloopcol | ) |
Definition at line 465 of file bmesh_py_types_meshdata.cc.
References mathutils_bmloopcol_cb_index, and Vector_CreatePyObject_cb().
Referenced by BPy_BMLayerItem_GetItem().
Definition at line 206 of file bmesh_py_types_meshdata.cc.
References bm, BM_ELEM_CD_GET_FLOAT_P, BM_ELEM_CD_SET_BOOL, BM_uv_map_get_offsets(), BPy_BMLoopUV_Check, copy_v2_v2(), BPy_BMLoopUV::edge_select, BMUVOffsets::pin, BPy_BMLoopUV::pin, BMUVOffsets::select_edge, BMUVOffsets::select_vert, UNLIKELY, BMUVOffsets::uv, BPy_BMLoopUV::uv, and BPy_BMLoopUV::vert_select.
Referenced by BPy_BMLayerItem_SetItem().
Definition at line 232 of file bmesh_py_types_meshdata.cc.
References bm, BM_ELEM_CD_GET_BOOL_P, BM_ELEM_CD_GET_FLOAT_P, BM_uv_map_get_offsets_from_layer(), BPy_BMLoopUV_Type, BMUVOffsets::pin, BMUVOffsets::select_edge, BMUVOffsets::select_vert, self, and BMUVOffsets::uv.
Referenced by BPy_BMLayerItem_GetItem().
|
static |
Definition at line 102 of file bmesh_py_types_meshdata.cc.
References self.
|
static |
Definition at line 108 of file bmesh_py_types_meshdata.cc.
References BLI_assert, PyC_Long_AsBool(), and self.
|
static |
Definition at line 147 of file bmesh_py_types_meshdata.cc.
References self.
|
static |
Definition at line 152 of file bmesh_py_types_meshdata.cc.
References BLI_assert, PyC_Long_AsBool(), and self.
|
static |
Definition at line 127 of file bmesh_py_types_meshdata.cc.
References self.
|
static |
Definition at line 132 of file bmesh_py_types_meshdata.cc.
References BLI_assert, PyC_Long_AsBool(), and self.
|
static |
Definition at line 67 of file bmesh_py_types_meshdata.cc.
References self, and Vector_CreatePyObject_wrap().
|
static |
Definition at line 72 of file bmesh_py_types_meshdata.cc.
References copy_v2_v2(), mathutils_array_parse(), and self.
Definition at line 356 of file bmesh_py_types_meshdata.cc.
References BPy_BMVertSkin_Check, and UNLIKELY.
Referenced by BPy_BMLayerItem_SetItem().
| PyObject * BPy_BMVertSkin_CreatePyObject | ( | MVertSkin * | mvertskin | ) |
Definition at line 367 of file bmesh_py_types_meshdata.cc.
References BPy_BMVertSkin_Type, and self.
Referenced by BPy_BMLayerItem_GetItem().
|
static |
Definition at line 295 of file bmesh_py_types_meshdata.cc.
References flag, POINTER_AS_INT, and self.
|
static |
Definition at line 301 of file bmesh_py_types_meshdata.cc.
References flag, POINTER_AS_INT, PyC_Long_AsBool(), and self.
|
static |
Definition at line 266 of file bmesh_py_types_meshdata.cc.
References self, and Vector_CreatePyObject_wrap().
|
static |
Definition at line 271 of file bmesh_py_types_meshdata.cc.
References copy_v2_v2(), mathutils_array_parse(), and self.
|
static |
Definition at line 398 of file bmesh_py_types_meshdata.cc.
|
static |
Definition at line 404 of file bmesh_py_types_meshdata.cc.
References MLOOPCOL_FROM_CAPSULE, and mloopcol_to_float().
Referenced by mathutils_bmloopcol_get_index(), and mathutils_bmloopcol_set_index().
|
static |
Definition at line 418 of file bmesh_py_types_meshdata.cc.
References mathutils_bmloopcol_get().
|
static |
Definition at line 411 of file bmesh_py_types_meshdata.cc.
References MLOOPCOL_FROM_CAPSULE, and mloopcol_from_float().
Referenced by mathutils_bmloopcol_set_index().
|
static |
Definition at line 427 of file bmesh_py_types_meshdata.cc.
References mathutils_bmloopcol_get(), and mathutils_bmloopcol_set().
Definition at line 391 of file bmesh_py_types_meshdata.cc.
References col, MLoopCol::r, and rgba_float_to_uchar().
Referenced by BPy_BMLoopColor_AssignPyObject(), and mathutils_bmloopcol_set().
Definition at line 386 of file bmesh_py_types_meshdata.cc.
References MLoopCol::r, and rgba_uchar_to_float().
Referenced by mathutils_bmloopcol_get().
| PyDoc_STRVAR | ( | bpy_bmdeformvert_clear_doc | , |
| ".. method:: clear()\n" "\n" " Clears all weights.\n" | ) |
| PyDoc_STRVAR | ( | bpy_bmdeformvert_get_doc | , |
| ".. method:: get(key, default=None)\n" "\n" " Returns the deform weight matching the key or default\n" " when not found (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The key associated with deform weight.\n" " :type key: int\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n" | ) |
| PyDoc_STRVAR | ( | bpy_bmdeformvert_items_doc | , |
| ".. method:: items()\n" "\n" " Return (group, weight) pairs for this vertex\n" " (matching Python's dict.items() functionality).\n" "\n" " :return: (key, value) pairs for each deform weight of this vertex.\n" " :rtype: list]\n" | [tuple[int, float] ) |
| PyDoc_STRVAR | ( | bpy_bmdeformvert_keys_doc | , |
| ".. method:: keys()\n" "\n" " Return the group indices used by this vertex\n" " (matching Python's dict.keys() functionality).\n" "\n" " :return: the deform group this vertex uses\n" " :rtype: list\n" | [int] ) |
| PyDoc_STRVAR | ( | bpy_bmdeformvert_values_doc | , |
| ".. method:: values()\n" "\n" " Return the weights of the deform vertex\n" " (matching Python's dict.values() functionality).\n" "\n" " :return: The weights that influence this vertex\n" " :rtype: list\n" | [float] ) |
| PyDoc_STRVAR | ( | bpy_bmloopuv_pin_uv_doc | , |
| "UV pin state.\n" "\n" ":type: bool" | ) |
| PyDoc_STRVAR | ( | bpy_bmloopuv_select_doc | , |
| "UV select state.\n" "\n" ":type: bool" | ) |
| PyDoc_STRVAR | ( | bpy_bmloopuv_select_edge_doc | , |
| "UV edge select state.\n" "\n" ":type: bool" | ) |
| PyDoc_STRVAR | ( | bpy_bmloopuv_uv_doc | , |
| "Loops UV (as a 2D Vector).\n" "\n" ":type: :class:`mathutils.Vector`" | ) |
| PyDoc_STRVAR | ( | bpy_bmvertskin_flag__use_loose_doc | , |
| "Use loose vertex.\n" "\n" ":type: bool" | ) |
| PyDoc_STRVAR | ( | bpy_bmvertskin_flag__use_root_doc | , |
| "Use as root vertex. Setting this flag does not clear other roots in the same mesh island.\n" "\n" ":type: bool" | ) |
| PyDoc_STRVAR | ( | bpy_bmvertskin_radius_doc | , |
| "Vert skin radii (as a 2D Vector).\n" "\n" ":type: :class:`mathutils.Vector`" | ) |
|
static |
Definition at line 622 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert().
|
static |
Definition at line 607 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert().
|
static |
Definition at line 755 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert().
| PyTypeObject BPy_BMDeformVert_Type |
Definition at line 769 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert(), BPy_BMDeformVert_CreatePyObject(), and BPyInit_bmesh_types().
|
static |
Definition at line 167 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopuv().
| PyTypeObject BPy_BMLoopUV_Type |
Definition at line 189 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopuv(), BPy_BMLoopUV_CreatePyObject(), and BPyInit_bmesh_types().
|
static |
Definition at line 318 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmvertskin().
|
static |
Definition at line 339 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmvertskin(), and BPy_BMVertSkin_CreatePyObject().
|
static |
Definition at line 440 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopcol().
|
static |
Definition at line 396 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopcol(), and BPy_BMLoopColor_CreatePyObject().