Blender  V2.93
BPy_ThicknessNoiseShader.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:`ThicknessNoiseShader`\n"
37  "\n"
38  "[Thickness shader]\n"
39  "\n"
40  ".. method:: __init__(amplitude, period)\n"
41  "\n"
42  " Builds a ThicknessNoiseShader object.\n"
43  "\n"
44  " :arg amplitude: The amplitude of the noise signal.\n"
45  " :type amplitude: float\n"
46  " :arg period: The period of the noise signal.\n"
47  " :type period: float\n"
48  "\n"
49  ".. method:: shade(stroke)\n"
50  "\n"
51  " Adds some noise to the stroke thickness.\n"
52  "\n"
53  " :arg stroke: A Stroke object.\n"
54  " :type stroke: :class:`freestyle.types.Stroke`\n";
55 
57  PyObject *args,
58  PyObject *kwds)
59 {
60  static const char *kwlist[] = {"amplitude", "period", nullptr};
61  float f1, f2;
62 
63  if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) {
64  return -1;
65  }
66  self->py_ss.ss = new StrokeShaders::ThicknessNoiseShader(f1, f2);
67  return 0;
68 }
69 
70 /*-----------------------BPy_ThicknessNoiseShader type definition ------------------------------*/
71 
72 PyTypeObject ThicknessNoiseShader_Type = {
73  PyVarObject_HEAD_INIT(nullptr, 0) "ThicknessNoiseShader", /* tp_name */
74  sizeof(BPy_ThicknessNoiseShader), /* tp_basicsize */
75  0, /* tp_itemsize */
76  nullptr, /* tp_dealloc */
77  0, /* tp_vectorcall_offset */
78  nullptr, /* tp_getattr */
79  nullptr, /* tp_setattr */
80  nullptr, /* tp_reserved */
81  nullptr, /* tp_repr */
82  nullptr, /* tp_as_number */
83  nullptr, /* tp_as_sequence */
84  nullptr, /* tp_as_mapping */
85  nullptr, /* tp_hash */
86  nullptr, /* tp_call */
87  nullptr, /* tp_str */
88  nullptr, /* tp_getattro */
89  nullptr, /* tp_setattro */
90  nullptr, /* tp_as_buffer */
91  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
92  ThicknessNoiseShader___doc__, /* tp_doc */
93  nullptr, /* tp_traverse */
94  nullptr, /* tp_clear */
95  nullptr, /* tp_richcompare */
96  0, /* tp_weaklistoffset */
97  nullptr, /* tp_iter */
98  nullptr, /* tp_iternext */
99  nullptr, /* tp_methods */
100  nullptr, /* tp_members */
101  nullptr, /* tp_getset */
102  &StrokeShader_Type, /* tp_base */
103  nullptr, /* tp_dict */
104  nullptr, /* tp_descr_get */
105  nullptr, /* tp_descr_set */
106  0, /* tp_dictoffset */
107  (initproc)ThicknessNoiseShader___init__, /* tp_init */
108  nullptr, /* tp_alloc */
109  nullptr, /* tp_new */
110 };
111 
113 
114 #ifdef __cplusplus
115 }
116 #endif
PyTypeObject StrokeShader_Type
static int ThicknessNoiseShader___init__(BPy_ThicknessNoiseShader *self, PyObject *args, PyObject *kwds)
static char ThicknessNoiseShader___doc__[]
PyTypeObject ThicknessNoiseShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:32