|
Blender V5.0
|
#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) |
| #define | BPy_BMVertSkin_Check(v) |
| #define | MLOOPCOL_FROM_CAPSULE(color_capsule) |
| #define | BPy_BMDeformVert_Check(v) |
Functions | |
| PyDoc_STRVAR (bpy_bmloopuv_uv_doc, "Loops UV (as a 2D Vector).\n" "\n" ":type: :class:`mathutils.Vector`\n") | |
| 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\n") | |
| 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 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`\n") | |
| 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\n") | |
| PyDoc_STRVAR (bpy_bmvertskin_flag__use_loose_doc, "Use loose vertex.\n" "\n" ":type: bool\n") | |
| 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 | ) |
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 429 of file bmesh_py_types_meshdata.cc.
Referenced by BPy_BMDeformVert_AssignPyObject().
| #define BPy_BMLoopUV_Check | ( | v | ) |
Definition at line 44 of file bmesh_py_types_meshdata.cc.
Referenced by BPy_BMLoopUV_AssignPyObject().
| #define BPy_BMVertSkin_Check | ( | v | ) |
Definition at line 179 of file bmesh_py_types_meshdata.cc.
Referenced by BPy_BMVertSkin_AssignPyObject().
| #define MLOOPCOL_FROM_CAPSULE | ( | color_capsule | ) |
Definition at line 309 of file bmesh_py_types_meshdata.cc.
Referenced by mathutils_bmloopcol_get(), and mathutils_bmloopcol_set().
|
static |
Definition at line 706 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 374 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 129 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 267 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 747 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 470 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_ensure_index(), BKE_defvert_find_index(), BKE_defvert_remove_group(), clamp_f(), i, self, and MDeformWeight::weight.
|
nodiscard |
Definition at line 724 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 669 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_clear(), and self.
|
static |
Definition at line 520 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_find_index(), and self.
|
nodiscard |
Definition at line 738 of file bmesh_py_types_meshdata.cc.
References BPy_BMDeformVert_Type, and self.
Referenced by BPy_BMLayerItem_GetItem().
|
static |
Definition at line 645 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_find_index(), self, and MDeformWeight::weight.
|
static |
Definition at line 615 of file bmesh_py_types_meshdata.cc.
References MDeformWeight::def_nr, i, PyTuple_SET_ITEMS, ret, self, and MDeformWeight::weight.
|
static |
Definition at line 567 of file bmesh_py_types_meshdata.cc.
References MDeformWeight::def_nr, i, ret, and self.
|
static |
Definition at line 439 of file bmesh_py_types_meshdata.cc.
References self.
|
static |
Definition at line 444 of file bmesh_py_types_meshdata.cc.
References BKE_defvert_find_index(), i, self, and MDeformWeight::weight.
|
static |
Definition at line 591 of file bmesh_py_types_meshdata.cc.
References i, ret, self, and MDeformWeight::weight.
|
nodiscard |
Definition at line 380 of file bmesh_py_types_meshdata.cc.
References mathutils_array_parse(), and mloopcol_from_float().
Referenced by BPy_BMLayerItem_SetItem().
|
nodiscard |
Definition at line 391 of file bmesh_py_types_meshdata.cc.
References mathutils_bmloopcol_cb_index, and Vector_CreatePyObject_cb().
Referenced by BPy_BMLayerItem_GetItem().
Definition at line 144 of file bmesh_py_types_meshdata.cc.
References bm, BM_ELEM_CD_GET_FLOAT_P, BM_ELEM_CD_SET_BOOL, BM_uv_map_offsets_get(), BPy_BMLoopUV_Check, copy_v2_v2(), BMUVOffsets::pin, BPy_BMLoopUV::pin, UNLIKELY, BMUVOffsets::uv, and BPy_BMLoopUV::uv.
Referenced by BPy_BMLayerItem_SetItem().
Definition at line 162 of file bmesh_py_types_meshdata.cc.
References bm, BM_ELEM_CD_GET_BOOL_P, BM_ELEM_CD_GET_FLOAT_P, BM_uv_map_offsets_from_layer(), BPy_BMLoopUV_Type, BMUVOffsets::pin, self, and BMUVOffsets::uv.
Referenced by BPy_BMLayerItem_GetItem().
|
static |
Definition at line 91 of file bmesh_py_types_meshdata.cc.
References self.
|
static |
Definition at line 97 of file bmesh_py_types_meshdata.cc.
References BLI_assert, PyC_Long_AsBool(), and self.
|
static |
Definition at line 68 of file bmesh_py_types_meshdata.cc.
References self, and Vector_CreatePyObject_wrap().
|
static |
Definition at line 73 of file bmesh_py_types_meshdata.cc.
References copy_v2_v2(), mathutils_array_parse(), and self.
|
nodiscard |
Definition at line 282 of file bmesh_py_types_meshdata.cc.
References BPy_BMVertSkin_Check, data, and UNLIKELY.
Referenced by BPy_BMLayerItem_SetItem().
|
nodiscard |
Definition at line 293 of file bmesh_py_types_meshdata.cc.
References BPy_BMVertSkin_Type, and self.
Referenced by BPy_BMLayerItem_GetItem().
|
static |
Definition at line 221 of file bmesh_py_types_meshdata.cc.
References flag, POINTER_AS_INT, and self.
|
static |
Definition at line 227 of file bmesh_py_types_meshdata.cc.
References flag, POINTER_AS_INT, PyC_Long_AsBool(), and self.
|
static |
Definition at line 192 of file bmesh_py_types_meshdata.cc.
References self, and Vector_CreatePyObject_wrap().
|
static |
Definition at line 197 of file bmesh_py_types_meshdata.cc.
References copy_v2_v2(), mathutils_array_parse(), and self.
|
static |
Definition at line 324 of file bmesh_py_types_meshdata.cc.
|
static |
Definition at line 330 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 344 of file bmesh_py_types_meshdata.cc.
References mathutils_bmloopcol_get().
|
static |
Definition at line 337 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 353 of file bmesh_py_types_meshdata.cc.
References mathutils_bmloopcol_get(), and mathutils_bmloopcol_set().
Definition at line 317 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 312 of file bmesh_py_types_meshdata.cc.
References MLoopCol::r, and rgba_uchar_to_float().
Referenced by mathutils_bmloopcol_get().
| 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\n" | ) |
| PyDoc_STRVAR | ( | bpy_bmloopuv_uv_doc | , |
| "Loops UV (as a 2D Vector).\n" "\n" ":type: :class:`mathutils.Vector`\n" | ) |
| PyDoc_STRVAR | ( | bpy_bmvertskin_flag__use_loose_doc | , |
| "Use loose vertex.\n" "\n" ":type: bool\n" | ) |
| 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\n" | ) |
| PyDoc_STRVAR | ( | bpy_bmvertskin_radius_doc | , |
| "Vert skin radii (as a 2D Vector).\n" "\n" ":type: :class:`mathutils.Vector`\n" | ) |
|
static |
Definition at line 548 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert().
|
static |
Definition at line 533 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert().
|
static |
Definition at line 686 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert().
| PyTypeObject BPy_BMDeformVert_Type |
Definition at line 704 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmdvert(), BPy_BMDeformVert_CreatePyObject(), and BPyInit_bmesh_types().
|
static |
Definition at line 116 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopuv().
| PyTypeObject BPy_BMLoopUV_Type |
Definition at line 127 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopuv(), BPy_BMLoopUV_CreatePyObject(), and BPyInit_bmesh_types().
|
static |
Definition at line 244 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmvertskin().
|
static |
Definition at line 265 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmvertskin(), and BPy_BMVertSkin_CreatePyObject().
|
static |
Definition at line 366 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopcol().
|
static |
Definition at line 322 of file bmesh_py_types_meshdata.cc.
Referenced by bm_init_types_bmloopcol(), and BPy_BMLoopColor_CreatePyObject().