Blender  V2.93
BPy_IncreasingThicknessShader.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
22 
23 #include "../../stroke/BasicStrokeShaders.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 using namespace Freestyle;
30 
32 
33 //------------------------INSTANCE METHODS ----------------------------------
34 
36  "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingThicknessShader`\n"
37  "\n"
38  "[Thickness shader]\n"
39  "\n"
40  ".. method:: __init__(thickness_A, thickness_B)\n"
41  "\n"
42  " Builds an IncreasingThicknessShader object.\n"
43  "\n"
44  " :arg thickness_A: The first thickness value.\n"
45  " :type thickness_A: float\n"
46  " :arg thickness_B: The second thickness value.\n"
47  " :type thickness_B: float\n"
48  "\n"
49  ".. method:: shade(stroke)\n"
50  "\n"
51  " Assigns thicknesses values such as the thickness increases from a\n"
52  " thickness value A to a thickness value B between the first vertex\n"
53  " to the midpoint vertex and then decreases from B to a A between\n"
54  " this midpoint vertex and the last vertex. The thickness is\n"
55  " linearly interpolated from A to B.\n"
56  "\n"
57  " :arg stroke: A Stroke object.\n"
58  " :type stroke: :class:`freestyle.types.Stroke`\n";
59 
61  PyObject *args,
62  PyObject *kwds)
63 {
64  static const char *kwlist[] = {"thickness_A", "thickness_B", nullptr};
65  float f1, f2;
66 
67  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) {
68  return -1;
69  }
70  self->py_ss.ss = new StrokeShaders::IncreasingThicknessShader(f1, f2);
71  return 0;
72 }
73 
74 /*-----------------------BPy_IncreasingThicknessShader type definition --------------------------*/
75 
77  PyVarObject_HEAD_INIT(nullptr, 0) "IncreasingThicknessShader", /* tp_name */
78  sizeof(BPy_IncreasingThicknessShader), /* tp_basicsize */
79  0, /* tp_itemsize */
80  nullptr, /* tp_dealloc */
81  0, /* tp_vectorcall_offset */
82  nullptr, /* tp_getattr */
83  nullptr, /* tp_setattr */
84  nullptr, /* tp_reserved */
85  nullptr, /* tp_repr */
86  nullptr, /* tp_as_number */
87  nullptr, /* tp_as_sequence */
88  nullptr, /* tp_as_mapping */
89  nullptr, /* tp_hash */
90  nullptr, /* tp_call */
91  nullptr, /* tp_str */
92  nullptr, /* tp_getattro */
93  nullptr, /* tp_setattro */
94  nullptr, /* tp_as_buffer */
95  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
97  nullptr, /* tp_traverse */
98  nullptr, /* tp_clear */
99  nullptr, /* tp_richcompare */
100  0, /* tp_weaklistoffset */
101  nullptr, /* tp_iter */
102  nullptr, /* tp_iternext */
103  nullptr, /* tp_methods */
104  nullptr, /* tp_members */
105  nullptr, /* tp_getset */
106  &StrokeShader_Type, /* tp_base */
107  nullptr, /* tp_dict */
108  nullptr, /* tp_descr_get */
109  nullptr, /* tp_descr_set */
110  0, /* tp_dictoffset */
111  (initproc)IncreasingThicknessShader___init__, /* tp_init */
112  nullptr, /* tp_alloc */
113  nullptr, /* tp_new */
114 };
115 
117 
118 #ifdef __cplusplus
119 }
120 #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:32