Blender  V3.3
BPy_StrokeAttribute.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BPy_StrokeAttribute.h"
8 
9 #include "BPy_Convert.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //-------------------MODULE INITIALIZATION--------------------------------
21 {
22  if (module == nullptr) {
23  return -1;
24  }
25 
26  if (PyType_Ready(&StrokeAttribute_Type) < 0) {
27  return -1;
28  }
29  Py_INCREF(&StrokeAttribute_Type);
30  PyModule_AddObject(module, "StrokeAttribute", (PyObject *)&StrokeAttribute_Type);
31 
33  return 0;
34 }
35 
36 //------------------------INSTANCE METHODS ----------------------------------
37 
38 PyDoc_STRVAR(StrokeAttribute_doc,
39  "Class to define a set of attributes associated with a :class:`StrokeVertex`.\n"
40  "The attribute set stores the color, alpha and thickness values for a Stroke\n"
41  "Vertex.\n"
42  "\n"
43  ".. method:: __init__()\n"
44  " __init__(brother)\n"
45  " __init__(red, green, blue, alpha, thickness_right, thickness_left)\n"
46  " __init__(attribute1, attribute2, t)\n"
47  "\n"
48  " Creates a :class:`StrokeAttribute` object using either a default constructor,\n"
49  " copy constructor, overloaded constructor, or and interpolation constructor\n"
50  " to interpolate between two :class:`StrokeAttribute` objects.\n"
51  "\n"
52  " :arg brother: A StrokeAttribute object to be used as a copy constructor.\n"
53  " :type brother: :class:`StrokeAttribute`\n"
54  " :arg red: Red component of a stroke color.\n"
55  " :type red: float\n"
56  " :arg green: Green component of a stroke color.\n"
57  " :type green: float\n"
58  " :arg blue: Blue component of a stroke color.\n"
59  " :type blue: float\n"
60  " :arg alpha: Alpha component of a stroke color.\n"
61  " :type alpha: float\n"
62  " :arg thickness_right: Stroke thickness on the right.\n"
63  " :type thickness_right: float\n"
64  " :arg thickness_left: Stroke thickness on the left.\n"
65  " :type thickness_left: float\n"
66  " :arg attribute1: The first StrokeAttribute object.\n"
67  " :type attribute1: :class:`StrokeAttribute`\n"
68  " :arg attribute2: The second StrokeAttribute object.\n"
69  " :type attribute2: :class:`StrokeAttribute`\n"
70  " :arg t: The interpolation parameter (0 <= t <= 1).\n"
71  " :type t: float\n");
72 
73 static int StrokeAttribute_init(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
74 {
75  static const char *kwlist_1[] = {"brother", nullptr};
76  static const char *kwlist_2[] = {"attribute1", "attribute2", "t", nullptr};
77  static const char *kwlist_3[] = {
78  "red", "green", "blue", "alpha", "thickness_right", "thickness_left", nullptr};
79  PyObject *obj1 = nullptr, *obj2 = nullptr;
80  float red, green, blue, alpha, thickness_right, thickness_left, t;
81 
82  if (PyArg_ParseTupleAndKeywords(
83  args, kwds, "|O!", (char **)kwlist_1, &StrokeAttribute_Type, &obj1)) {
84  if (!obj1) {
85  self->sa = new StrokeAttribute();
86  }
87  else {
88  self->sa = new StrokeAttribute(*(((BPy_StrokeAttribute *)obj1)->sa));
89  }
90  }
91  else if ((void)PyErr_Clear(),
92  PyArg_ParseTupleAndKeywords(args,
93  kwds,
94  "O!O!f",
95  (char **)kwlist_2,
97  &obj1,
99  &obj2,
100  &t)) {
101  self->sa = new StrokeAttribute(
102  *(((BPy_StrokeAttribute *)obj1)->sa), *(((BPy_StrokeAttribute *)obj2)->sa), t);
103  }
104  else if ((void)PyErr_Clear(),
105  PyArg_ParseTupleAndKeywords(args,
106  kwds,
107  "ffffff",
108  (char **)kwlist_3,
109  &red,
110  &green,
111  &blue,
112  &alpha,
113  &thickness_right,
114  &thickness_left)) {
115  self->sa = new StrokeAttribute(red, green, blue, alpha, thickness_right, thickness_left);
116  }
117  else {
118  PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
119  return -1;
120  }
121  self->borrowed = false;
122  return 0;
123 }
124 
126 {
127  if (self->sa && !self->borrowed) {
128  delete self->sa;
129  }
130  Py_TYPE(self)->tp_free((PyObject *)self);
131 }
132 
134 {
135  stringstream repr("StrokeAttribute:");
136  repr << " r: " << self->sa->getColorR() << " g: " << self->sa->getColorG()
137  << " b: " << self->sa->getColorB() << " a: " << self->sa->getAlpha()
138  << " - R: " << self->sa->getThicknessR() << " L: " << self->sa->getThicknessL();
139 
140  return PyUnicode_FromString(repr.str().c_str());
141 }
142 
143 PyDoc_STRVAR(StrokeAttribute_get_attribute_real_doc,
144  ".. method:: get_attribute_real(name)\n"
145  "\n"
146  " Returns an attribute of float type.\n"
147  "\n"
148  " :arg name: The name of the attribute.\n"
149  " :type name: str\n"
150  " :return: The attribute value.\n"
151  " :rtype: float\n");
152 
154  PyObject *args,
155  PyObject *kwds)
156 {
157  static const char *kwlist[] = {"name", nullptr};
158  char *attr;
159 
160  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", (char **)kwlist, &attr)) {
161  return nullptr;
162  }
163  double a = self->sa->getAttributeReal(attr);
164  return PyFloat_FromDouble(a);
165 }
166 
167 PyDoc_STRVAR(StrokeAttribute_get_attribute_vec2_doc,
168  ".. method:: get_attribute_vec2(name)\n"
169  "\n"
170  " Returns an attribute of two-dimensional vector type.\n"
171  "\n"
172  " :arg name: The name of the attribute.\n"
173  " :type name: str\n"
174  " :return: The attribute value.\n"
175  " :rtype: :class:`mathutils.Vector`\n");
176 
178  PyObject *args,
179  PyObject *kwds)
180 {
181  static const char *kwlist[] = {"name", nullptr};
182  char *attr;
183 
184  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", (char **)kwlist, &attr)) {
185  return nullptr;
186  }
187  Vec2f a = self->sa->getAttributeVec2f(attr);
188  return Vector_from_Vec2f(a);
189 }
190 
191 PyDoc_STRVAR(StrokeAttribute_get_attribute_vec3_doc,
192  ".. method:: get_attribute_vec3(name)\n"
193  "\n"
194  " Returns an attribute of three-dimensional vector type.\n"
195  "\n"
196  " :arg name: The name of the attribute.\n"
197  " :type name: str\n"
198  " :return: The attribute value.\n"
199  " :rtype: :class:`mathutils.Vector`\n");
200 
202  PyObject *args,
203  PyObject *kwds)
204 {
205  static const char *kwlist[] = {"name", nullptr};
206  char *attr;
207 
208  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", (char **)kwlist, &attr)) {
209  return nullptr;
210  }
211  Vec3f a = self->sa->getAttributeVec3f(attr);
212  return Vector_from_Vec3f(a);
213 }
214 
215 PyDoc_STRVAR(StrokeAttribute_has_attribute_real_doc,
216  ".. method:: has_attribute_real(name)\n"
217  "\n"
218  " Checks whether the attribute name of float type is available.\n"
219  "\n"
220  " :arg name: The name of the attribute.\n"
221  " :type name: str\n"
222  " :return: True if the attribute is available.\n"
223  " :rtype: bool\n");
224 
226  PyObject *args,
227  PyObject *kwds)
228 {
229  static const char *kwlist[] = {"name", nullptr};
230  char *attr;
231 
232  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", (char **)kwlist, &attr)) {
233  return nullptr;
234  }
235  return PyBool_from_bool(self->sa->isAttributeAvailableReal(attr));
236 }
237 
238 PyDoc_STRVAR(StrokeAttribute_has_attribute_vec2_doc,
239  ".. method:: has_attribute_vec2(name)\n"
240  "\n"
241  " Checks whether the attribute name of two-dimensional vector type\n"
242  " is available.\n"
243  "\n"
244  " :arg name: The name of the attribute.\n"
245  " :type name: str\n"
246  " :return: True if the attribute is available.\n"
247  " :rtype: bool\n");
248 
250  PyObject *args,
251  PyObject *kwds)
252 {
253  static const char *kwlist[] = {"name", nullptr};
254  char *attr;
255 
256  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", (char **)kwlist, &attr)) {
257  return nullptr;
258  }
259  return PyBool_from_bool(self->sa->isAttributeAvailableVec2f(attr));
260 }
261 
262 PyDoc_STRVAR(StrokeAttribute_has_attribute_vec3_doc,
263  ".. method:: has_attribute_vec3(name)\n"
264  "\n"
265  " Checks whether the attribute name of three-dimensional vector\n"
266  " type is available.\n"
267  "\n"
268  " :arg name: The name of the attribute.\n"
269  " :type name: str\n"
270  " :return: True if the attribute is available.\n"
271  " :rtype: bool\n");
272 
274  PyObject *args,
275  PyObject *kwds)
276 {
277  static const char *kwlist[] = {"name", nullptr};
278  char *attr;
279 
280  if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", (char **)kwlist, &attr)) {
281  return nullptr;
282  }
283  return PyBool_from_bool(self->sa->isAttributeAvailableVec3f(attr));
284 }
285 
286 PyDoc_STRVAR(StrokeAttribute_set_attribute_real_doc,
287  ".. method:: set_attribute_real(name, value)\n"
288  "\n"
289  " Adds a user-defined attribute of float type. If there is no\n"
290  " attribute of the given name, it is added. Otherwise, the new value\n"
291  " replaces the old one.\n"
292  "\n"
293  " :arg name: The name of the attribute.\n"
294  " :type name: str\n"
295  " :arg value: The attribute value.\n"
296  " :type value: float\n");
297 
299  PyObject *args,
300  PyObject *kwds)
301 {
302  static const char *kwlist[] = {"name", "value", nullptr};
303  char *s = nullptr;
304  double d = 0;
305 
306  if (!PyArg_ParseTupleAndKeywords(args, kwds, "sd", (char **)kwlist, &s, &d)) {
307  return nullptr;
308  }
309  self->sa->setAttributeReal(s, d);
310  Py_RETURN_NONE;
311 }
312 
313 PyDoc_STRVAR(StrokeAttribute_set_attribute_vec2_doc,
314  ".. method:: set_attribute_vec2(name, value)\n"
315  "\n"
316  " Adds a user-defined attribute of two-dimensional vector type. If\n"
317  " there is no attribute of the given name, it is added. Otherwise,\n"
318  " the new value replaces the old one.\n"
319  "\n"
320  " :arg name: The name of the attribute.\n"
321  " :type name: str\n"
322  " :arg value: The attribute value.\n"
323  " :type value: :class:`mathutils.Vector`, list or tuple of 2 real numbers\n");
324 
326  PyObject *args,
327  PyObject *kwds)
328 {
329  static const char *kwlist[] = {"name", "value", nullptr};
330  char *s;
331  PyObject *obj = nullptr;
332  Vec2f vec;
333 
334  if (!PyArg_ParseTupleAndKeywords(args, kwds, "sO", (char **)kwlist, &s, &obj)) {
335  return nullptr;
336  }
337  if (!Vec2f_ptr_from_PyObject(obj, vec)) {
338  PyErr_SetString(PyExc_TypeError,
339  "argument 2 must be a 2D vector (either a list of 2 elements or Vector)");
340  return nullptr;
341  }
342  self->sa->setAttributeVec2f(s, vec);
343  Py_RETURN_NONE;
344 }
345 
346 PyDoc_STRVAR(StrokeAttribute_set_attribute_vec3_doc,
347  ".. method:: set_attribute_vec3(name, value)\n"
348  "\n"
349  " Adds a user-defined attribute of three-dimensional vector type.\n"
350  " If there is no attribute of the given name, it is added.\n"
351  " Otherwise, the new value replaces the old one.\n"
352  "\n"
353  " :arg name: The name of the attribute.\n"
354  " :type name: str\n"
355  " :arg value: The attribute value.\n"
356  " :type value: :class:`mathutils.Vector`, list or tuple of 3 real numbers\n");
357 
359  PyObject *args,
360  PyObject *kwds)
361 {
362  static const char *kwlist[] = {"name", "value", nullptr};
363  char *s;
364  PyObject *obj = nullptr;
365  Vec3f vec;
366 
367  if (!PyArg_ParseTupleAndKeywords(args, kwds, "sO", (char **)kwlist, &s, &obj)) {
368  return nullptr;
369  }
370  if (!Vec3f_ptr_from_PyObject(obj, vec)) {
371  PyErr_SetString(PyExc_TypeError,
372  "argument 2 must be a 3D vector (either a list of 3 elements or Vector)");
373  return nullptr;
374  }
375  self->sa->setAttributeVec3f(s, vec);
376  Py_RETURN_NONE;
377 }
378 
379 static PyMethodDef BPy_StrokeAttribute_methods[] = {
380  {"get_attribute_real",
382  METH_VARARGS | METH_KEYWORDS,
383  StrokeAttribute_get_attribute_real_doc},
384  {"get_attribute_vec2",
386  METH_VARARGS | METH_KEYWORDS,
387  StrokeAttribute_get_attribute_vec2_doc},
388  {"get_attribute_vec3",
390  METH_VARARGS | METH_KEYWORDS,
391  StrokeAttribute_get_attribute_vec3_doc},
392  {"has_attribute_real",
394  METH_VARARGS | METH_KEYWORDS,
395  StrokeAttribute_has_attribute_real_doc},
396  {"has_attribute_vec2",
398  METH_VARARGS | METH_KEYWORDS,
399  StrokeAttribute_has_attribute_vec2_doc},
400  {"has_attribute_vec3",
402  METH_VARARGS | METH_KEYWORDS,
403  StrokeAttribute_has_attribute_vec3_doc},
404  {"set_attribute_real",
406  METH_VARARGS | METH_KEYWORDS,
407  StrokeAttribute_set_attribute_real_doc},
408  {"set_attribute_vec2",
410  METH_VARARGS | METH_KEYWORDS,
411  StrokeAttribute_set_attribute_vec2_doc},
412  {"set_attribute_vec3",
414  METH_VARARGS | METH_KEYWORDS,
415  StrokeAttribute_set_attribute_vec3_doc},
416  {nullptr, nullptr, 0, nullptr},
417 };
418 
419 /*----------------------mathutils callbacks ----------------------------*/
420 
421 /* subtype */
422 #define MATHUTILS_SUBTYPE_COLOR 1
423 #define MATHUTILS_SUBTYPE_THICKNESS 2
424 
426 {
427  if (!BPy_StrokeAttribute_Check(bmo->cb_user)) {
428  return -1;
429  }
430  return 0;
431 }
432 
433 static int StrokeAttribute_mathutils_get(BaseMathObject *bmo, int subtype)
434 {
435  BPy_StrokeAttribute *self = (BPy_StrokeAttribute *)bmo->cb_user;
436  switch (subtype) {
438  bmo->data[0] = self->sa->getColorR();
439  bmo->data[1] = self->sa->getColorG();
440  bmo->data[2] = self->sa->getColorB();
441  break;
443  bmo->data[0] = self->sa->getThicknessR();
444  bmo->data[1] = self->sa->getThicknessL();
445  break;
446  default:
447  return -1;
448  }
449  return 0;
450 }
451 
452 static int StrokeAttribute_mathutils_set(BaseMathObject *bmo, int subtype)
453 {
454  BPy_StrokeAttribute *self = (BPy_StrokeAttribute *)bmo->cb_user;
455  switch (subtype) {
457  self->sa->setColor(bmo->data[0], bmo->data[1], bmo->data[2]);
458  break;
460  self->sa->setThickness(bmo->data[0], bmo->data[1]);
461  break;
462  default:
463  return -1;
464  }
465  return 0;
466 }
467 
468 static int StrokeAttribute_mathutils_get_index(BaseMathObject *bmo, int subtype, int index)
469 {
470  BPy_StrokeAttribute *self = (BPy_StrokeAttribute *)bmo->cb_user;
471  switch (subtype) {
473  switch (index) {
474  case 0:
475  bmo->data[0] = self->sa->getColorR();
476  break;
477  case 1:
478  bmo->data[1] = self->sa->getColorG();
479  break;
480  case 2:
481  bmo->data[2] = self->sa->getColorB();
482  break;
483  default:
484  return -1;
485  }
486  break;
488  switch (index) {
489  case 0:
490  bmo->data[0] = self->sa->getThicknessR();
491  break;
492  case 1:
493  bmo->data[1] = self->sa->getThicknessL();
494  break;
495  default:
496  return -1;
497  }
498  break;
499  default:
500  return -1;
501  }
502  return 0;
503 }
504 
505 static int StrokeAttribute_mathutils_set_index(BaseMathObject *bmo, int subtype, int index)
506 {
507  BPy_StrokeAttribute *self = (BPy_StrokeAttribute *)bmo->cb_user;
508  switch (subtype) {
510  float r = (index == 0) ? bmo->data[0] : self->sa->getColorR();
511  float g = (index == 1) ? bmo->data[1] : self->sa->getColorG();
512  float b = (index == 2) ? bmo->data[2] : self->sa->getColorB();
513  self->sa->setColor(r, g, b);
514  } break;
516  float tr = (index == 0) ? bmo->data[0] : self->sa->getThicknessR();
517  float tl = (index == 1) ? bmo->data[1] : self->sa->getThicknessL();
518  self->sa->setThickness(tr, tl);
519  } break;
520  default:
521  return -1;
522  }
523  return 0;
524 }
525 
532 };
533 
534 static unsigned char StrokeAttribute_mathutils_cb_index = -1;
535 
537 {
539 }
540 
541 /*----------------------StrokeAttribute get/setters ----------------------------*/
542 
543 PyDoc_STRVAR(StrokeAttribute_alpha_doc,
544  "Alpha component of the stroke color.\n"
545  "\n"
546  ":type: float");
547 
548 static PyObject *StrokeAttribute_alpha_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
549 {
550  return PyFloat_FromDouble(self->sa->getAlpha());
551 }
552 
554  PyObject *value,
555  void *UNUSED(closure))
556 {
557  float scalar;
558  if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
559  /* parsed item not a number */
560  PyErr_SetString(PyExc_TypeError, "value must be a number");
561  return -1;
562  }
563  self->sa->setAlpha(scalar);
564  return 0;
565 }
566 
567 PyDoc_STRVAR(StrokeAttribute_color_doc,
568  "RGB components of the stroke color.\n"
569  "\n"
570  ":type: :class:`mathutils.Color`");
571 
572 static PyObject *StrokeAttribute_color_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
573 {
576 }
577 
579  PyObject *value,
580  void *UNUSED(closure))
581 {
582  float v[3];
583  if (mathutils_array_parse(v, 3, 3, value, "value must be a 3-dimensional vector") == -1) {
584  return -1;
585  }
586  self->sa->setColor(v[0], v[1], v[2]);
587  return 0;
588 }
589 
590 PyDoc_STRVAR(StrokeAttribute_thickness_doc,
591  "Right and left components of the stroke thickness.\n"
592  "The right (left) component is the thickness on the right (left) of the vertex\n"
593  "when following the stroke.\n"
594  "\n"
595  ":type: :class:`mathutils.Vector`");
596 
597 static PyObject *StrokeAttribute_thickness_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
598 {
601 }
602 
604  PyObject *value,
605  void *UNUSED(closure))
606 {
607  float v[2];
608  if (mathutils_array_parse(v, 2, 2, value, "value must be a 2-dimensional vector") == -1) {
609  return -1;
610  }
611  self->sa->setThickness(v[0], v[1]);
612  return 0;
613 }
614 
615 PyDoc_STRVAR(StrokeAttribute_visible_doc,
616  "The visibility flag. True if the StrokeVertex is visible.\n"
617  "\n"
618  ":type: bool");
619 
620 static PyObject *StrokeAttribute_visible_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
621 {
622  return PyBool_from_bool(self->sa->isVisible());
623 }
624 
626  PyObject *value,
627  void *UNUSED(closure))
628 {
629  if (!PyBool_Check(value)) {
630  PyErr_SetString(PyExc_TypeError, "value must be boolean");
631  return -1;
632  }
633  self->sa->setVisible(bool_from_PyBool(value));
634  return 0;
635 }
636 
637 static PyGetSetDef BPy_StrokeAttribute_getseters[] = {
638  {"alpha",
641  StrokeAttribute_alpha_doc,
642  nullptr},
643  {"color",
646  StrokeAttribute_color_doc,
647  nullptr},
648  {"thickness",
651  StrokeAttribute_thickness_doc,
652  nullptr},
653  {"visible",
656  StrokeAttribute_visible_doc,
657  nullptr},
658  {nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */
659 };
660 
661 /*-----------------------BPy_StrokeAttribute type definition ------------------------------*/
662 
663 PyTypeObject StrokeAttribute_Type = {
664  PyVarObject_HEAD_INIT(nullptr, 0) "StrokeAttribute", /* tp_name */
665  sizeof(BPy_StrokeAttribute), /* tp_basicsize */
666  0, /* tp_itemsize */
667  (destructor)StrokeAttribute_dealloc, /* tp_dealloc */
668  0, /* tp_vectorcall_offset */
669  nullptr, /* tp_getattr */
670  nullptr, /* tp_setattr */
671  nullptr, /* tp_reserved */
672  (reprfunc)StrokeAttribute_repr, /* tp_repr */
673  nullptr, /* tp_as_number */
674  nullptr, /* tp_as_sequence */
675  nullptr, /* tp_as_mapping */
676  nullptr, /* tp_hash */
677  nullptr, /* tp_call */
678  nullptr, /* tp_str */
679  nullptr, /* tp_getattro */
680  nullptr, /* tp_setattro */
681  nullptr, /* tp_as_buffer */
682  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
683  StrokeAttribute_doc, /* tp_doc */
684  nullptr, /* tp_traverse */
685  nullptr, /* tp_clear */
686  nullptr, /* tp_richcompare */
687  0, /* tp_weaklistoffset */
688  nullptr, /* tp_iter */
689  nullptr, /* tp_iternext */
690  BPy_StrokeAttribute_methods, /* tp_methods */
691  nullptr, /* tp_members */
692  BPy_StrokeAttribute_getseters, /* tp_getset */
693  nullptr, /* tp_base */
694  nullptr, /* tp_dict */
695  nullptr, /* tp_descr_get */
696  nullptr, /* tp_descr_set */
697  0, /* tp_dictoffset */
698  (initproc)StrokeAttribute_init, /* tp_init */
699  nullptr, /* tp_alloc */
700  PyType_GenericNew, /* tp_new */
701 };
702 
704 
705 #ifdef __cplusplus
706 }
707 #endif
#define UNUSED(x)
PyObject * Vector_from_Vec3f(Vec3f &vec)
Definition: BPy_Convert.cpp:72
PyObject * PyBool_from_bool(bool b)
Definition: BPy_Convert.cpp:59
bool bool_from_PyBool(PyObject *b)
bool Vec3f_ptr_from_PyObject(PyObject *obj, Vec3f &vec)
bool Vec2f_ptr_from_PyObject(PyObject *obj, Vec2f &vec)
PyObject * Vector_from_Vec2f(Vec2f &vec)
Definition: BPy_Convert.cpp:64
static int StrokeAttribute_color_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure))
static unsigned char StrokeAttribute_mathutils_cb_index
static PyObject * StrokeAttribute_color_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
static int StrokeAttribute_init(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeAttribute_get_attribute_real(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeAttribute_set_attribute_vec3(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static int StrokeAttribute_mathutils_set(BaseMathObject *bmo, int subtype)
static PyObject * StrokeAttribute_alpha_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
static PyObject * StrokeAttribute_get_attribute_vec2(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static int StrokeAttribute_visible_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure))
PyTypeObject StrokeAttribute_Type
static int StrokeAttribute_alpha_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure))
static PyObject * StrokeAttribute_set_attribute_vec2(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
#define MATHUTILS_SUBTYPE_THICKNESS
static PyObject * StrokeAttribute_has_attribute_vec2(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeAttribute_has_attribute_vec3(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeAttribute_repr(BPy_StrokeAttribute *self)
static int StrokeAttribute_mathutils_get_index(BaseMathObject *bmo, int subtype, int index)
void StrokeAttribute_mathutils_register_callback()
static PyMethodDef BPy_StrokeAttribute_methods[]
static Mathutils_Callback StrokeAttribute_mathutils_cb
static PyGetSetDef BPy_StrokeAttribute_getseters[]
static PyObject * StrokeAttribute_thickness_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
PyDoc_STRVAR(StrokeAttribute_doc, "Class to define a set of attributes associated with a :class:`StrokeVertex`.\n" "The attribute set stores the color, alpha and thickness values for a Stroke\n" "Vertex.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(red, green, blue, alpha, thickness_right, thickness_left)\n" " __init__(attribute1, attribute2, t)\n" "\n" " Creates a :class:`StrokeAttribute` object using either a default constructor,\n" " copy constructor, overloaded constructor, or and interpolation constructor\n" " to interpolate between two :class:`StrokeAttribute` objects.\n" "\n" " :arg brother: A StrokeAttribute object to be used as a copy constructor.\n" " :type brother: :class:`StrokeAttribute`\n" " :arg red: Red component of a stroke color.\n" " :type red: float\n" " :arg green: Green component of a stroke color.\n" " :type green: float\n" " :arg blue: Blue component of a stroke color.\n" " :type blue: float\n" " :arg alpha: Alpha component of a stroke color.\n" " :type alpha: float\n" " :arg thickness_right: Stroke thickness on the right.\n" " :type thickness_right: float\n" " :arg thickness_left: Stroke thickness on the left.\n" " :type thickness_left: float\n" " :arg attribute1: The first StrokeAttribute object.\n" " :type attribute1: :class:`StrokeAttribute`\n" " :arg attribute2: The second StrokeAttribute object.\n" " :type attribute2: :class:`StrokeAttribute`\n" " :arg t: The interpolation parameter (0 <= t <= 1).\n" " :type t: float\n")
static PyObject * StrokeAttribute_has_attribute_real(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static int StrokeAttribute_mathutils_check(BaseMathObject *bmo)
static int StrokeAttribute_mathutils_get(BaseMathObject *bmo, int subtype)
#define MATHUTILS_SUBTYPE_COLOR
static int StrokeAttribute_mathutils_set_index(BaseMathObject *bmo, int subtype, int index)
static int StrokeAttribute_thickness_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure))
static PyObject * StrokeAttribute_visible_get(BPy_StrokeAttribute *self, void *UNUSED(closure))
static void StrokeAttribute_dealloc(BPy_StrokeAttribute *self)
static PyObject * StrokeAttribute_get_attribute_vec3(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeAttribute_set_attribute_real(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
int StrokeAttribute_Init(PyObject *module)
#define BPy_StrokeAttribute_Check(v)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte blue
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble green
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its red
ATTR_WARN_UNUSED_RESULT const BMVert * v
PyObject * self
Definition: bpy_driver.c:165
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 * Color_CreatePyObject_cb(PyObject *cb_user, uchar cb_type, uchar cb_subtype)
PyObject * Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype)
inherits from class Rep
Definition: AppCanvas.cpp:18
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static struct PyModuleDef module
Definition: python.cpp:972