2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* ***** END GPL LICENSE BLOCK *****
21
/** \file source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp
25
#include "BPy_SpatialNoiseShader.h"
27
#include "../../stroke/AdvancedStrokeShaders.h"
28
#include "../BPy_Convert.h"
34
///////////////////////////////////////////////////////////////////////////////////////////
36
//------------------------INSTANCE METHODS ----------------------------------
38
static char SpatialNoiseShader___doc__[] =
39
"Class hierarchy: :class:`StrokeShader` > :class:`SpatialNoiseShader`\n"
43
".. method:: __init__(amount, scale, num_octaves, smooth, pure_random)\n"
45
" Builds a SpatialNoiseShader object.\n"
47
" :arg amount: The amplitude of the noise.\n"
48
" :type amount: float\n"
49
" :arg scale: The noise frequency.\n"
50
" :type scale: float\n"
51
" :arg num_octaves: The number of octaves\n"
52
" :type num_octaves: int\n"
53
" :arg smooth: True if you want the noise to be smooth.\n"
54
" :type smooth: bool\n"
55
" :arg pure_random: True if you don't want any coherence.\n"
56
" :type pure_random: bool\n"
58
".. method:: shade(stroke)\n"
60
" Spatial Noise stroke shader. Moves the vertices to make the stroke\n"
63
" :arg stroke: A Stroke object.\n"
64
" :type stroke: :class:`Stroke`\n";
66
static int SpatialNoiseShader___init__(BPy_SpatialNoiseShader *self, PyObject *args, PyObject *kwds)
68
static const char *kwlist[] = {"amount", "scale", "num_octaves", "smooth", "pure_random", NULL};
71
PyObject *obj4 = 0, *obj5 = 0;
73
if (!PyArg_ParseTupleAndKeywords(args, kwds, "ffiO!O!", (char **)kwlist,
74
&f1, &f2, &i3, &PyBool_Type, &obj4, &PyBool_Type, &obj5))
78
self->py_ss.ss = new SpatialNoiseShader(f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5));
82
/*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/
84
PyTypeObject SpatialNoiseShader_Type = {
85
PyVarObject_HEAD_INIT(NULL, 0)
86
"SpatialNoiseShader", /* tp_name */
87
sizeof(BPy_SpatialNoiseShader), /* tp_basicsize */
96
0, /* tp_as_sequence */
97
0, /* tp_as_mapping */
103
0, /* tp_as_buffer */
104
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
105
SpatialNoiseShader___doc__, /* tp_doc */
108
0, /* tp_richcompare */
109
0, /* tp_weaklistoffset */
115
&StrokeShader_Type, /* tp_base */
117
0, /* tp_descr_get */
118
0, /* tp_descr_set */
119
0, /* tp_dictoffset */
120
(initproc)SpatialNoiseShader___init__, /* tp_init */
125
///////////////////////////////////////////////////////////////////////////////////////////