Blender  V3.3
bmesh_py_types_meshdata.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2012 Blender Foundation. All rights reserved. */
3 
11 #include <Python.h>
12 
13 #include "../mathutils/mathutils.h"
14 
15 #include "DNA_meshdata_types.h"
16 #include "DNA_object_types.h"
17 
18 #include "BLI_math_base.h"
19 #include "BLI_math_vector.h"
20 #include "BLI_utildefines.h"
21 
22 #include "BKE_deform.h"
23 
25 
26 #include "../generic/py_capi_utils.h"
27 #include "../generic/python_utildefines.h"
28 
29 /* Mesh Loop UV
30  * ************ */
31 
32 #define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type)
33 
34 typedef struct BPy_BMLoopUV {
35  PyObject_VAR_HEAD
38 
39 PyDoc_STRVAR(bpy_bmloopuv_uv_doc,
40  "Loops UV (as a 2D Vector).\n\n:type: :class:`mathutils.Vector`");
41 static PyObject *bpy_bmloopuv_uv_get(BPy_BMLoopUV *self, void *UNUSED(closure))
42 {
43  return Vector_CreatePyObject_wrap(self->data->uv, 2, NULL);
44 }
45 
46 static int bpy_bmloopuv_uv_set(BPy_BMLoopUV *self, PyObject *value, void *UNUSED(closure))
47 {
48  float tvec[2];
49  if (mathutils_array_parse(tvec, 2, 2, value, "BMLoopUV.uv") != -1) {
50  copy_v2_v2(self->data->uv, tvec);
51  return 0;
52  }
53 
54  return -1;
55 }
56 
57 PyDoc_STRVAR(bpy_bmloopuv_flag__pin_uv_doc, "UV pin state.\n\n:type: boolean");
58 PyDoc_STRVAR(bpy_bmloopuv_flag__select_doc, "UV select state.\n\n:type: boolean");
59 PyDoc_STRVAR(bpy_bmloopuv_flag__select_edge_doc, "UV edge select state.\n\n:type: boolean");
60 
61 static PyObject *bpy_bmloopuv_flag_get(BPy_BMLoopUV *self, void *flag_p)
62 {
63  const int flag = POINTER_AS_INT(flag_p);
64  return PyBool_FromLong(self->data->flag & flag);
65 }
66 
67 static int bpy_bmloopuv_flag_set(BPy_BMLoopUV *self, PyObject *value, void *flag_p)
68 {
69  const int flag = POINTER_AS_INT(flag_p);
70 
71  switch (PyC_Long_AsBool(value)) {
72  case true:
73  self->data->flag |= flag;
74  return 0;
75  case false:
76  self->data->flag &= ~flag;
77  return 0;
78  default:
79  /* error is set */
80  return -1;
81  }
82 }
83 
84 static PyGetSetDef bpy_bmloopuv_getseters[] = {
85  /* attributes match rna_def_mloopuv. */
86  {"uv", (getter)bpy_bmloopuv_uv_get, (setter)bpy_bmloopuv_uv_set, bpy_bmloopuv_uv_doc, NULL},
87  {"pin_uv",
88  (getter)bpy_bmloopuv_flag_get,
89  (setter)bpy_bmloopuv_flag_set,
90  bpy_bmloopuv_flag__pin_uv_doc,
91  (void *)MLOOPUV_PINNED},
92  {"select",
93  (getter)bpy_bmloopuv_flag_get,
94  (setter)bpy_bmloopuv_flag_set,
95  bpy_bmloopuv_flag__select_doc,
96  (void *)MLOOPUV_VERTSEL},
97  {"select_edge",
98  (getter)bpy_bmloopuv_flag_get,
99  (setter)bpy_bmloopuv_flag_set,
100  bpy_bmloopuv_flag__select_edge_doc,
101  (void *)MLOOPUV_EDGESEL},
102 
103  {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
104 };
105 
106 PyTypeObject BPy_BMLoopUV_Type; /* bm.loops.layers.uv.active */
107 
108 static void bm_init_types_bmloopuv(void)
109 {
110  BPy_BMLoopUV_Type.tp_basicsize = sizeof(BPy_BMLoopUV);
111 
112  BPy_BMLoopUV_Type.tp_name = "BMLoopUV";
113 
114  BPy_BMLoopUV_Type.tp_doc = NULL; /* todo */
115 
117 
118  BPy_BMLoopUV_Type.tp_flags = Py_TPFLAGS_DEFAULT;
119 
120  PyType_Ready(&BPy_BMLoopUV_Type);
121 }
122 
123 int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *mloopuv, PyObject *value)
124 {
125  if (UNLIKELY(!BPy_BMLoopUV_Check(value))) {
126  PyErr_Format(PyExc_TypeError, "expected BMLoopUV, not a %.200s", Py_TYPE(value)->tp_name);
127  return -1;
128  }
129 
130  *((MLoopUV *)mloopuv) = *(((BPy_BMLoopUV *)value)->data);
131  return 0;
132 }
133 
134 PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *mloopuv)
135 {
136  BPy_BMLoopUV *self = PyObject_New(BPy_BMLoopUV, &BPy_BMLoopUV_Type);
137  self->data = mloopuv;
138  return (PyObject *)self;
139 }
140 
141 /* --- End Mesh Loop UV --- */
142 
143 /* Mesh Vert Skin
144  * ************ */
145 
146 #define BPy_BMVertSkin_Check(v) (Py_TYPE(v) == &BPy_BMVertSkin_Type)
147 
148 typedef struct BPy_BMVertSkin {
149  PyObject_VAR_HEAD
152 
153 PyDoc_STRVAR(bpy_bmvertskin_radius_doc,
154  "Vert skin radii (as a 2D Vector).\n\n:type: :class:`mathutils.Vector`");
155 static PyObject *bpy_bmvertskin_radius_get(BPy_BMVertSkin *self, void *UNUSED(closure))
156 {
157  return Vector_CreatePyObject_wrap(self->data->radius, 2, NULL);
158 }
159 
160 static int bpy_bmvertskin_radius_set(BPy_BMVertSkin *self, PyObject *value, void *UNUSED(closure))
161 {
162  float tvec[2];
163  if (mathutils_array_parse(tvec, 2, 2, value, "BMVertSkin.radius") != -1) {
164  copy_v2_v2(self->data->radius, tvec);
165  return 0;
166  }
167 
168  return -1;
169 }
170 
171 PyDoc_STRVAR(bpy_bmvertskin_flag__use_root_doc,
172  "Use as root vertex. Setting this flag does not clear other roots in the same mesh "
173  "island.\n\n:type: boolean");
174 PyDoc_STRVAR(bpy_bmvertskin_flag__use_loose_doc, "Use loose vertex.\n\n:type: boolean");
175 
176 static PyObject *bpy_bmvertskin_flag_get(BPy_BMVertSkin *self, void *flag_p)
177 {
178  const int flag = POINTER_AS_INT(flag_p);
179  return PyBool_FromLong(self->data->flag & flag);
180 }
181 
182 static int bpy_bmvertskin_flag_set(BPy_BMVertSkin *self, PyObject *value, void *flag_p)
183 {
184  const int flag = POINTER_AS_INT(flag_p);
185 
186  switch (PyC_Long_AsBool(value)) {
187  case true:
188  self->data->flag |= flag;
189  return 0;
190  case false:
191  self->data->flag &= ~flag;
192  return 0;
193  default:
194  /* error is set */
195  return -1;
196  }
197 }
198 
199 static PyGetSetDef bpy_bmvertskin_getseters[] = {
200  /* attributes match rna_mesh_gen. */
201  {"radius",
204  bpy_bmvertskin_radius_doc,
205  NULL},
206  {"use_root",
207  (getter)bpy_bmvertskin_flag_get,
208  (setter)bpy_bmvertskin_flag_set,
209  bpy_bmvertskin_flag__use_root_doc,
210  (void *)MVERT_SKIN_ROOT},
211  {"use_loose",
212  (getter)bpy_bmvertskin_flag_get,
213  (setter)bpy_bmvertskin_flag_set,
214  bpy_bmvertskin_flag__use_loose_doc,
215  (void *)MVERT_SKIN_LOOSE},
216 
217  {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
218 };
219 
220 static PyTypeObject BPy_BMVertSkin_Type; /* bm.loops.layers.skin.active */
221 
222 static void bm_init_types_bmvertskin(void)
223 {
224  BPy_BMVertSkin_Type.tp_basicsize = sizeof(BPy_BMVertSkin);
225 
226  BPy_BMVertSkin_Type.tp_name = "BMVertSkin";
227 
228  BPy_BMVertSkin_Type.tp_doc = NULL; /* todo */
229 
231 
232  BPy_BMVertSkin_Type.tp_flags = Py_TPFLAGS_DEFAULT;
233 
234  PyType_Ready(&BPy_BMVertSkin_Type);
235 }
236 
237 int BPy_BMVertSkin_AssignPyObject(struct MVertSkin *mvertskin, PyObject *value)
238 {
239  if (UNLIKELY(!BPy_BMVertSkin_Check(value))) {
240  PyErr_Format(PyExc_TypeError, "expected BMVertSkin, not a %.200s", Py_TYPE(value)->tp_name);
241  return -1;
242  }
243 
244  *((MVertSkin *)mvertskin) = *(((BPy_BMVertSkin *)value)->data);
245  return 0;
246 }
247 
248 PyObject *BPy_BMVertSkin_CreatePyObject(struct MVertSkin *mvertskin)
249 {
250  BPy_BMVertSkin *self = PyObject_New(BPy_BMVertSkin, &BPy_BMVertSkin_Type);
251  self->data = mvertskin;
252  return (PyObject *)self;
253 }
254 
255 /* --- End Mesh Vert Skin --- */
256 
257 /* Mesh Loop Color
258  * *************** */
259 
260 /* This simply provides a color wrapper for
261  * color which uses mathutils callbacks for mathutils.Color
262  */
263 
264 #define MLOOPCOL_FROM_CAPSULE(color_capsule) \
265  ((MLoopCol *)PyCapsule_GetPointer(color_capsule, NULL))
266 
267 static void mloopcol_to_float(const MLoopCol *mloopcol, float r_col[4])
268 {
269  rgba_uchar_to_float(r_col, (const uchar *)&mloopcol->r);
270 }
271 
272 static void mloopcol_from_float(MLoopCol *mloopcol, const float col[4])
273 {
274  rgba_float_to_uchar((uchar *)&mloopcol->r, col);
275 }
276 
278 
280 {
281  /* always ok */
282  return 0;
283 }
284 
285 static int mathutils_bmloopcol_get(BaseMathObject *bmo, int UNUSED(subtype))
286 {
287  MLoopCol *mloopcol = MLOOPCOL_FROM_CAPSULE(bmo->cb_user);
288  mloopcol_to_float(mloopcol, bmo->data);
289  return 0;
290 }
291 
292 static int mathutils_bmloopcol_set(BaseMathObject *bmo, int UNUSED(subtype))
293 {
294  MLoopCol *mloopcol = MLOOPCOL_FROM_CAPSULE(bmo->cb_user);
295  mloopcol_from_float(mloopcol, bmo->data);
296  return 0;
297 }
298 
299 static int mathutils_bmloopcol_get_index(BaseMathObject *bmo, int subtype, int UNUSED(index))
300 {
301  /* lazy, avoid repeteing the case statement */
302  if (mathutils_bmloopcol_get(bmo, subtype) == -1) {
303  return -1;
304  }
305  return 0;
306 }
307 
308 static int mathutils_bmloopcol_set_index(BaseMathObject *bmo, int subtype, int index)
309 {
310  const float f = bmo->data[index];
311 
312  /* lazy, avoid repeteing the case statement */
313  if (mathutils_bmloopcol_get(bmo, subtype) == -1) {
314  return -1;
315  }
316 
317  bmo->data[index] = f;
318  return mathutils_bmloopcol_set(bmo, subtype);
319 }
320 
327 };
328 
329 static void bm_init_types_bmloopcol(void)
330 {
331  /* pass */
333 }
334 
335 int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *mloopcol, PyObject *value)
336 {
337  float tvec[4];
338  if (mathutils_array_parse(tvec, 4, 4, value, "BMLoopCol") != -1) {
339  mloopcol_from_float(mloopcol, tvec);
340  return 0;
341  }
342 
343  return -1;
344 }
345 
346 PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *mloopcol)
347 {
348  PyObject *color_capsule;
349  color_capsule = PyCapsule_New(mloopcol, NULL, NULL);
350  return Vector_CreatePyObject_cb(color_capsule, 4, mathutils_bmloopcol_cb_index, 0);
351 }
352 
353 #undef MLOOPCOL_FROM_CAPSULE
354 
355 /* --- End Mesh Loop Color --- */
356 
357 /* Mesh Deform Vert
358  * **************** */
359 
384 #define BPy_BMDeformVert_Check(v) (Py_TYPE(v) == &BPy_BMDeformVert_Type)
385 
386 typedef struct BPy_BMDeformVert {
387  PyObject_VAR_HEAD
390 
391 /* Mapping Protocols
392  * ================= */
393 
395 {
396  return self->data->totweight;
397 }
398 
399 static PyObject *bpy_bmdeformvert_subscript(BPy_BMDeformVert *self, PyObject *key)
400 {
401  if (PyIndex_Check(key)) {
402  int i;
403  i = PyNumber_AsSsize_t(key, PyExc_IndexError);
404  if (i == -1 && PyErr_Occurred()) {
405  return NULL;
406  }
407 
408  MDeformWeight *dw = BKE_defvert_find_index(self->data, i);
409 
410  if (dw == NULL) {
411  PyErr_SetString(PyExc_KeyError,
412  "BMDeformVert[key] = x: "
413  "key not found");
414  return NULL;
415  }
416 
417  return PyFloat_FromDouble(dw->weight);
418  }
419 
420  PyErr_Format(
421  PyExc_TypeError, "BMDeformVert keys must be integers, not %.200s", Py_TYPE(key)->tp_name);
422  return NULL;
423 }
424 
425 static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key, PyObject *value)
426 {
427  if (PyIndex_Check(key)) {
428  int i;
429 
430  i = PyNumber_AsSsize_t(key, PyExc_IndexError);
431  if (i == -1 && PyErr_Occurred()) {
432  return -1;
433  }
434 
435  if (value) {
436  /* Handle `dvert[group_index] = 0.5`. */
437  if (i < 0) {
438  PyErr_SetString(PyExc_KeyError,
439  "BMDeformVert[key] = x: "
440  "weight keys can't be negative");
441  return -1;
442  }
443 
445  const float f = PyFloat_AsDouble(value);
446  if (f == -1 && PyErr_Occurred()) { /* Parsed key not a number. */
447  PyErr_SetString(PyExc_TypeError,
448  "BMDeformVert[key] = x: "
449  "assigned value not a number");
450  return -1;
451  }
452 
453  dw->weight = clamp_f(f, 0.0f, 1.0f);
454  }
455  else {
456  /* Handle `del dvert[group_index]`. */
457  MDeformWeight *dw = BKE_defvert_find_index(self->data, i);
458 
459  if (dw == NULL) {
460  PyErr_SetString(PyExc_KeyError,
461  "del BMDeformVert[key]: "
462  "key not found");
463  }
464  BKE_defvert_remove_group(self->data, dw);
465  }
466 
467  return 0;
468  }
469 
470  PyErr_Format(
471  PyExc_TypeError, "BMDeformVert keys must be integers, not %.200s", Py_TYPE(key)->tp_name);
472  return -1;
473 }
474 
475 static int bpy_bmdeformvert_contains(BPy_BMDeformVert *self, PyObject *value)
476 {
477  const int key = PyLong_AsSsize_t(value);
478 
479  if (key == -1 && PyErr_Occurred()) {
480  PyErr_SetString(PyExc_TypeError, "BMDeformVert.__contains__: expected an int");
481  return -1;
482  }
483 
484  return (BKE_defvert_find_index(self->data, key) != NULL) ? 1 : 0;
485 }
486 
487 /* only defined for __contains__ */
488 static PySequenceMethods bpy_bmdeformvert_as_sequence = {
489  (lenfunc)bpy_bmdeformvert_len, /* sq_length */
490  NULL, /* sq_concat */
491  NULL, /* sq_repeat */
492 
493  /* NOTE: if this is set #PySequence_Check() returns True,
494  * but in this case we don't want to be treated as a seq. */
495  NULL, /* sq_item */
496 
497  NULL, /* sq_slice */
498  NULL, /* sq_ass_item */
499  NULL, /* *was* sq_ass_slice */
500  (objobjproc)bpy_bmdeformvert_contains, /* sq_contains */
501  (binaryfunc)NULL, /* sq_inplace_concat */
502  (ssizeargfunc)NULL, /* sq_inplace_repeat */
503 };
504 
505 static PyMappingMethods bpy_bmdeformvert_as_mapping = {
506  (lenfunc)bpy_bmdeformvert_len,
507  (binaryfunc)bpy_bmdeformvert_subscript,
508  (objobjargproc)bpy_bmdeformvert_ass_subscript,
509 };
510 
511 /* Methods
512  * ======= */
513 
514 PyDoc_STRVAR(bpy_bmdeformvert_keys_doc,
515  ".. method:: keys()\n"
516  "\n"
517  " Return the group indices used by this vertex\n"
518  " (matching pythons dict.keys() functionality).\n"
519  "\n"
520  " :return: the deform group this vertex uses\n"
521  " :rtype: list of ints\n");
523 {
524  PyObject *ret;
525  int i;
526  MDeformWeight *dw = self->data->dw;
527 
528  ret = PyList_New(self->data->totweight);
529  for (i = 0; i < self->data->totweight; i++, dw++) {
530  PyList_SET_ITEM(ret, i, PyLong_FromLong(dw->def_nr));
531  }
532 
533  return ret;
534 }
535 
536 PyDoc_STRVAR(bpy_bmdeformvert_values_doc,
537  ".. method:: values()\n"
538  "\n"
539  " Return the weights of the deform vertex\n"
540  " (matching pythons dict.values() functionality).\n"
541  "\n"
542  " :return: The weights that influence this vertex\n"
543  " :rtype: list of floats\n");
545 {
546  PyObject *ret;
547  int i;
548  MDeformWeight *dw = self->data->dw;
549 
550  ret = PyList_New(self->data->totweight);
551  for (i = 0; i < self->data->totweight; i++, dw++) {
552  PyList_SET_ITEM(ret, i, PyFloat_FromDouble(dw->weight));
553  }
554 
555  return ret;
556 }
557 
558 PyDoc_STRVAR(bpy_bmdeformvert_items_doc,
559  ".. method:: items()\n"
560  "\n"
561  " Return (group, weight) pairs for this vertex\n"
562  " (matching pythons dict.items() functionality).\n"
563  "\n"
564  " :return: (key, value) pairs for each deform weight of this vertex.\n"
565  " :rtype: list of tuples\n");
567 {
568  PyObject *ret;
569  PyObject *item;
570  int i;
571  MDeformWeight *dw = self->data->dw;
572 
573  ret = PyList_New(self->data->totweight);
574  for (i = 0; i < self->data->totweight; i++, dw++) {
575  item = PyTuple_New(2);
576  PyTuple_SET_ITEMS(item, PyLong_FromLong(dw->def_nr), PyFloat_FromDouble(dw->weight));
577  PyList_SET_ITEM(ret, i, item);
578  }
579 
580  return ret;
581 }
582 
583 PyDoc_STRVAR(bpy_bmdeformvert_get_doc,
584  ".. method:: get(key, default=None)\n"
585  "\n"
586  " Returns the deform weight matching the key or default\n"
587  " when not found (matches pythons dictionary function of the same name).\n"
588  "\n"
589  " :arg key: The key associated with deform weight.\n"
590  " :type key: int\n"
591  " :arg default: Optional argument for the value to return if\n"
592  " *key* is not found.\n"
593  " :type default: Undefined\n");
594 static PyObject *bpy_bmdeformvert_get(BPy_BMDeformVert *self, PyObject *args)
595 {
596  int key;
597  PyObject *def = Py_None;
598 
599  if (!PyArg_ParseTuple(args, "i|O:get", &key, &def)) {
600  return NULL;
601  }
602 
603  MDeformWeight *dw = BKE_defvert_find_index(self->data, key);
604 
605  if (dw) {
606  return PyFloat_FromDouble(dw->weight);
607  }
608 
609  return Py_INCREF_RET(def);
610 }
611 
612 PyDoc_STRVAR(bpy_bmdeformvert_clear_doc,
613  ".. method:: clear()\n"
614  "\n"
615  " Clears all weights.\n");
617 {
618  BKE_defvert_clear(self->data);
619 
620  Py_RETURN_NONE;
621 }
622 
623 static struct PyMethodDef bpy_bmdeformvert_methods[] = {
624  {"keys", (PyCFunction)bpy_bmdeformvert_keys, METH_NOARGS, bpy_bmdeformvert_keys_doc},
625  {"values", (PyCFunction)bpy_bmdeformvert_values, METH_NOARGS, bpy_bmdeformvert_values_doc},
626  {"items", (PyCFunction)bpy_bmdeformvert_items, METH_NOARGS, bpy_bmdeformvert_items_doc},
627  {"get", (PyCFunction)bpy_bmdeformvert_get, METH_VARARGS, bpy_bmdeformvert_get_doc},
628  /* BMESH_TODO pop, popitem, update */
629  {"clear", (PyCFunction)bpy_bmdeformvert_clear, METH_NOARGS, bpy_bmdeformvert_clear_doc},
630  {NULL, NULL, 0, NULL},
631 };
632 
633 PyTypeObject BPy_BMDeformVert_Type; /* bm.loops.layers.uv.active */
634 
635 static void bm_init_types_bmdvert(void)
636 {
637  BPy_BMDeformVert_Type.tp_basicsize = sizeof(BPy_BMDeformVert);
638 
639  BPy_BMDeformVert_Type.tp_name = "BMDeformVert";
640 
641  BPy_BMDeformVert_Type.tp_doc = NULL; /* todo */
642 
645 
647 
648  BPy_BMDeformVert_Type.tp_flags = Py_TPFLAGS_DEFAULT;
649 
650  PyType_Ready(&BPy_BMDeformVert_Type);
651 }
652 
653 int BPy_BMDeformVert_AssignPyObject(struct MDeformVert *dvert, PyObject *value)
654 {
655  if (UNLIKELY(!BPy_BMDeformVert_Check(value))) {
656  PyErr_Format(PyExc_TypeError, "expected BMDeformVert, not a %.200s", Py_TYPE(value)->tp_name);
657  return -1;
658  }
659 
660  MDeformVert *dvert_src = ((BPy_BMDeformVert *)value)->data;
661  if (LIKELY(dvert != dvert_src)) {
662  BKE_defvert_copy(dvert, dvert_src);
663  }
664  return 0;
665 }
666 
668 {
670  self->data = dvert;
671  return (PyObject *)self;
672 }
673 
674 /* --- End Mesh Deform Vert --- */
675 
677 {
682 }
support for deformation groups and hooks.
struct MDeformWeight * BKE_defvert_find_index(const struct MDeformVert *dv, int defgroup)
struct MDeformWeight * BKE_defvert_ensure_index(struct MDeformVert *dv, int defgroup)
Definition: deform.c:748
void BKE_defvert_remove_group(struct MDeformVert *dvert, struct MDeformWeight *dw)
Definition: deform.c:804
void BKE_defvert_copy(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src)
void BKE_defvert_clear(struct MDeformVert *dvert)
Definition: deform.c:835
MINLINE float clamp_f(float value, float min, float max)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
Definition: math_color.c:383
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
Definition: math_color.c:396
MINLINE void copy_v2_v2(float r[2], const float a[2])
unsigned char uchar
Definition: BLI_sys_types.h:70
#define UNUSED(x)
#define POINTER_AS_INT(i)
#define UNLIKELY(x)
#define LIKELY(x)
@ MVERT_SKIN_LOOSE
@ MVERT_SKIN_ROOT
@ MLOOPUV_PINNED
@ MLOOPUV_VERTSEL
@ MLOOPUV_EDGESEL
Object is a sort of wrapper for general info.
static PySequenceMethods bpy_bmdeformvert_as_sequence
static PyObject * bpy_bmvertskin_radius_get(BPy_BMVertSkin *self, void *UNUSED(closure))
static int bpy_bmloopuv_uv_set(BPy_BMLoopUV *self, PyObject *value, void *UNUSED(closure))
int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *mloopcol, PyObject *value)
static void bm_init_types_bmdvert(void)
static void bm_init_types_bmloopuv(void)
static int mathutils_bmloopcol_get(BaseMathObject *bmo, int UNUSED(subtype))
PyObject * BPy_BMLoopColor_CreatePyObject(struct MLoopCol *mloopcol)
struct BPy_BMDeformVert BPy_BMDeformVert
static int bpy_bmvertskin_flag_set(BPy_BMVertSkin *self, PyObject *value, void *flag_p)
static void bm_init_types_bmloopcol(void)
int BPy_BMDeformVert_AssignPyObject(struct MDeformVert *dvert, PyObject *value)
static int bpy_bmdeformvert_len(BPy_BMDeformVert *self)
static void mloopcol_to_float(const MLoopCol *mloopcol, float r_col[4])
int BPy_BMVertSkin_AssignPyObject(struct MVertSkin *mvertskin, PyObject *value)
static int mathutils_bmloopcol_check(BaseMathObject *UNUSED(bmo))
static PyObject * bpy_bmdeformvert_values(BPy_BMDeformVert *self)
#define MLOOPCOL_FROM_CAPSULE(color_capsule)
void BPy_BM_init_types_meshdata(void)
struct BPy_BMLoopUV BPy_BMLoopUV
static int bpy_bmvertskin_radius_set(BPy_BMVertSkin *self, PyObject *value, void *UNUSED(closure))
static PyObject * bpy_bmloopuv_flag_get(BPy_BMLoopUV *self, void *flag_p)
PyObject * BPy_BMDeformVert_CreatePyObject(struct MDeformVert *dvert)
static int mathutils_bmloopcol_set_index(BaseMathObject *bmo, int subtype, int index)
static Mathutils_Callback mathutils_bmloopcol_cb
static PyObject * bpy_bmloopuv_uv_get(BPy_BMLoopUV *self, void *UNUSED(closure))
static PyGetSetDef bpy_bmloopuv_getseters[]
struct BPy_BMVertSkin BPy_BMVertSkin
static int bpy_bmloopuv_flag_set(BPy_BMLoopUV *self, PyObject *value, void *flag_p)
static PyObject * bpy_bmdeformvert_clear(BPy_BMDeformVert *self)
int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *mloopuv, PyObject *value)
static PyObject * bpy_bmdeformvert_subscript(BPy_BMDeformVert *self, PyObject *key)
static int bpy_bmdeformvert_contains(BPy_BMDeformVert *self, PyObject *value)
static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key, PyObject *value)
PyTypeObject BPy_BMDeformVert_Type
static void bm_init_types_bmvertskin(void)
static int mathutils_bmloopcol_get_index(BaseMathObject *bmo, int subtype, int UNUSED(index))
PyObject * BPy_BMLoopUV_CreatePyObject(struct MLoopUV *mloopuv)
static PyGetSetDef bpy_bmvertskin_getseters[]
#define BPy_BMVertSkin_Check(v)
static PyObject * bpy_bmdeformvert_items(BPy_BMDeformVert *self)
static void mloopcol_from_float(MLoopCol *mloopcol, const float col[4])
#define BPy_BMDeformVert_Check(v)
static uchar mathutils_bmloopcol_cb_index
static int mathutils_bmloopcol_set(BaseMathObject *bmo, int UNUSED(subtype))
static PyObject * bpy_bmvertskin_flag_get(BPy_BMVertSkin *self, void *flag_p)
PyTypeObject BPy_BMLoopUV_Type
static PyObject * bpy_bmdeformvert_keys(BPy_BMDeformVert *self)
#define BPy_BMLoopUV_Check(v)
static struct PyMethodDef bpy_bmdeformvert_methods[]
static PyObject * bpy_bmdeformvert_get(BPy_BMDeformVert *self, PyObject *args)
static PyMappingMethods bpy_bmdeformvert_as_mapping
PyObject * BPy_BMVertSkin_CreatePyObject(struct MVertSkin *mvertskin)
PyDoc_STRVAR(bpy_bmloopuv_uv_doc, "Loops UV (as a 2D Vector).\n\n:type: :class:`mathutils.Vector`")
static PyTypeObject BPy_BMVertSkin_Type
PyObject * self
Definition: bpy_driver.c:165
uint col
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
Definition: mathutils.c:98
uchar Mathutils_RegisterCallback(Mathutils_Callback *cb)
Definition: mathutils.c:551
PyObject * Vector_CreatePyObject_wrap(float *vec, const int vec_num, PyTypeObject *base_type)
PyObject * Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype)
int PyC_Long_AsBool(PyObject *value)
#define PyTuple_SET_ITEMS(op_arg,...)
return ret
PyObject_VAR_HEAD MDeformVert * data
PyObject_VAR_HEAD MLoopUV * data
PyObject_VAR_HEAD MVertSkin * data
unsigned int def_nr
unsigned char r