Blender V5.0
BPy_SpatialNoiseShader.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
12#include "../BPy_Convert.h"
13
14using namespace Freestyle;
15
17
18//------------------------INSTANCE METHODS ----------------------------------
19
21 /* Wrap. */
22 SpatialNoiseShader___doc__,
23 "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SpatialNoiseShader`\n"
24 "\n"
25 "[Geometry shader]\n"
26 "\n"
27 ".. method:: __init__(amount, scale, num_octaves, smooth, pure_random)\n"
28 "\n"
29 " Builds a SpatialNoiseShader object.\n"
30 "\n"
31 " :arg amount: The amplitude of the noise.\n"
32 " :type amount: float\n"
33 " :arg scale: The noise frequency.\n"
34 " :type scale: float\n"
35 " :arg num_octaves: The number of octaves\n"
36 " :type num_octaves: int\n"
37 " :arg smooth: True if you want the noise to be smooth.\n"
38 " :type smooth: bool\n"
39 " :arg pure_random: True if you don't want any coherence.\n"
40 " :type pure_random: bool\n"
41 "\n"
42 ".. method:: shade(stroke)\n"
43 "\n"
44 " Spatial Noise stroke shader. Moves the vertices to make the stroke\n"
45 " more noisy.\n"
46 "\n"
47 " :arg stroke: A Stroke object.\n"
48 " :type stroke: :class:`freestyle.types.Stroke`\n");
50 PyObject *args,
51 PyObject *kwds)
52{
53 static const char *kwlist[] = {
54 "amount", "scale", "num_octaves", "smooth", "pure_random", nullptr};
55 float f1, f2;
56 int i3;
57 PyObject *obj4 = nullptr, *obj5 = nullptr;
58
59 if (!PyArg_ParseTupleAndKeywords(args,
60 kwds,
61 "ffiO!O!",
62 (char **)kwlist,
63 &f1,
64 &f2,
65 &i3,
66 &PyBool_Type,
67 &obj4,
68 &PyBool_Type,
69 &obj5))
70 {
71 return -1;
72 }
73 self->py_ss.ss = new SpatialNoiseShader(
74 f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5));
75 return 0;
76}
77
78/*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/
79
81 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
82 /*tp_name*/ "SpatialNoiseShader",
83 /*tp_basicsize*/ sizeof(BPy_SpatialNoiseShader),
84 /*tp_itemsize*/ 0,
85 /*tp_dealloc*/ nullptr,
86 /*tp_vectorcall_offset*/ 0,
87 /*tp_getattr*/ nullptr,
88 /*tp_setattr*/ nullptr,
89 /*tp_as_async*/ nullptr,
90 /*tp_repr*/ nullptr,
91 /*tp_as_number*/ nullptr,
92 /*tp_as_sequence*/ nullptr,
93 /*tp_as_mapping*/ nullptr,
94 /*tp_hash*/ nullptr,
95 /*tp_call*/ nullptr,
96 /*tp_str*/ nullptr,
97 /*tp_getattro*/ nullptr,
98 /*tp_setattro*/ nullptr,
99 /*tp_as_buffer*/ nullptr,
100 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
101 /*tp_doc*/ SpatialNoiseShader___doc__,
102 /*tp_traverse*/ nullptr,
103 /*tp_clear*/ nullptr,
104 /*tp_richcompare*/ nullptr,
105 /*tp_weaklistoffset*/ 0,
106 /*tp_iter*/ nullptr,
107 /*tp_iternext*/ nullptr,
108 /*tp_methods*/ nullptr,
109 /*tp_members*/ nullptr,
110 /*tp_getset*/ nullptr,
111 /*tp_base*/ &StrokeShader_Type,
112 /*tp_dict*/ nullptr,
113 /*tp_descr_get*/ nullptr,
114 /*tp_descr_set*/ nullptr,
115 /*tp_dictoffset*/ 0,
116 /*tp_init*/ (initproc)SpatialNoiseShader___init__,
117 /*tp_alloc*/ nullptr,
118 /*tp_new*/ nullptr,
119};
120
Fredo's stroke shaders.
bool bool_from_PyBool(PyObject *b)
PyTypeObject SpatialNoiseShader_Type
PyDoc_STRVAR(SpatialNoiseShader___doc__, "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SpatialNoiseShader`\n" "\n" "[Geometry shader]\n" "\n" ".. method:: __init__(amount, scale, num_octaves, smooth, pure_random)\n" "\n" " Builds a SpatialNoiseShader object.\n" "\n" " :arg amount: The amplitude of the noise.\n" " :type amount: float\n" " :arg scale: The noise frequency.\n" " :type scale: float\n" " :arg num_octaves: The number of octaves\n" " :type num_octaves: int\n" " :arg smooth: True if you want the noise to be smooth.\n" " :type smooth: bool\n" " :arg pure_random: True if you don't want any coherence.\n" " :type pure_random: bool\n" "\n" ".. method:: shade(stroke)\n" "\n" " Spatial Noise stroke shader. Moves the vertices to make the stroke\n" " more noisy.\n" "\n" " :arg stroke: A Stroke object.\n" " :type stroke: :class:`freestyle.types.Stroke`\n")
static int SpatialNoiseShader___init__(BPy_SpatialNoiseShader *self, PyObject *args, PyObject *kwds)
PyTypeObject StrokeShader_Type
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20