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