Blender  V3.3
BPy_IncreasingThicknessShader.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #include "../../stroke/BasicStrokeShaders.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //------------------------INSTANCE METHODS ----------------------------------
20 
22  "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingThicknessShader`\n"
23  "\n"
24  "[Thickness shader]\n"
25  "\n"
26  ".. method:: __init__(thickness_A, thickness_B)\n"
27  "\n"
28  " Builds an IncreasingThicknessShader object.\n"
29  "\n"
30  " :arg thickness_A: The first thickness value.\n"
31  " :type thickness_A: float\n"
32  " :arg thickness_B: The second thickness value.\n"
33  " :type thickness_B: float\n"
34  "\n"
35  ".. method:: shade(stroke)\n"
36  "\n"
37  " Assigns thicknesses values such as the thickness increases from a\n"
38  " thickness value A to a thickness value B between the first vertex\n"
39  " to the midpoint vertex and then decreases from B to a A between\n"
40  " this midpoint vertex and the last vertex. The thickness is\n"
41  " linearly interpolated from A to B.\n"
42  "\n"
43  " :arg stroke: A Stroke object.\n"
44  " :type stroke: :class:`freestyle.types.Stroke`\n";
45 
47  PyObject *args,
48  PyObject *kwds)
49 {
50  static const char *kwlist[] = {"thickness_A", "thickness_B", nullptr};
51  float f1, f2;
52 
53  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) {
54  return -1;
55  }
56  self->py_ss.ss = new StrokeShaders::IncreasingThicknessShader(f1, f2);
57  return 0;
58 }
59 
60 /*-----------------------BPy_IncreasingThicknessShader type definition --------------------------*/
61 
63  PyVarObject_HEAD_INIT(nullptr, 0) "IncreasingThicknessShader", /* tp_name */
64  sizeof(BPy_IncreasingThicknessShader), /* tp_basicsize */
65  0, /* tp_itemsize */
66  nullptr, /* tp_dealloc */
67  0, /* tp_vectorcall_offset */
68  nullptr, /* tp_getattr */
69  nullptr, /* tp_setattr */
70  nullptr, /* tp_reserved */
71  nullptr, /* tp_repr */
72  nullptr, /* tp_as_number */
73  nullptr, /* tp_as_sequence */
74  nullptr, /* tp_as_mapping */
75  nullptr, /* tp_hash */
76  nullptr, /* tp_call */
77  nullptr, /* tp_str */
78  nullptr, /* tp_getattro */
79  nullptr, /* tp_setattro */
80  nullptr, /* tp_as_buffer */
81  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
83  nullptr, /* tp_traverse */
84  nullptr, /* tp_clear */
85  nullptr, /* tp_richcompare */
86  0, /* tp_weaklistoffset */
87  nullptr, /* tp_iter */
88  nullptr, /* tp_iternext */
89  nullptr, /* tp_methods */
90  nullptr, /* tp_members */
91  nullptr, /* tp_getset */
92  &StrokeShader_Type, /* tp_base */
93  nullptr, /* tp_dict */
94  nullptr, /* tp_descr_get */
95  nullptr, /* tp_descr_set */
96  0, /* tp_dictoffset */
97  (initproc)IncreasingThicknessShader___init__, /* tp_init */
98  nullptr, /* tp_alloc */
99  nullptr, /* tp_new */
100 };
101 
103 
104 #ifdef __cplusplus
105 }
106 #endif
PyTypeObject IncreasingThicknessShader_Type
static int IncreasingThicknessShader___init__(BPy_IncreasingThicknessShader *self, PyObject *args, PyObject *kwds)
static char IncreasingThicknessShader___doc__[]
PyTypeObject StrokeShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:18