Blender V4.5
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");
49
51 PyObject *args,
52 PyObject *kwds)
53{
54 static const char *kwlist[] = {
55 "amount", "scale", "num_octaves", "smooth", "pure_random", nullptr};
56 float f1, f2;
57 int i3;
58 PyObject *obj4 = nullptr, *obj5 = nullptr;
59
60 if (!PyArg_ParseTupleAndKeywords(args,
61 kwds,
62 "ffiO!O!",
63 (char **)kwlist,
64 &f1,
65 &f2,
66 &i3,
67 &PyBool_Type,
68 &obj4,
69 &PyBool_Type,
70 &obj5))
71 {
72 return -1;
73 }
74 self->py_ss.ss = new SpatialNoiseShader(
75 f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5));
76 return 0;
77}
78
79/*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/
80
82 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
83 /*tp_name*/ "SpatialNoiseShader",
84 /*tp_basicsize*/ sizeof(BPy_SpatialNoiseShader),
85 /*tp_itemsize*/ 0,
86 /*tp_dealloc*/ nullptr,
87 /*tp_vectorcall_offset*/ 0,
88 /*tp_getattr*/ nullptr,
89 /*tp_setattr*/ nullptr,
90 /*tp_as_async*/ nullptr,
91 /*tp_repr*/ nullptr,
92 /*tp_as_number*/ nullptr,
93 /*tp_as_sequence*/ nullptr,
94 /*tp_as_mapping*/ nullptr,
95 /*tp_hash*/ nullptr,
96 /*tp_call*/ nullptr,
97 /*tp_str*/ nullptr,
98 /*tp_getattro*/ nullptr,
99 /*tp_setattro*/ nullptr,
100 /*tp_as_buffer*/ nullptr,
101 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
102 /*tp_doc*/ SpatialNoiseShader___doc__,
103 /*tp_traverse*/ nullptr,
104 /*tp_clear*/ nullptr,
105 /*tp_richcompare*/ nullptr,
106 /*tp_weaklistoffset*/ 0,
107 /*tp_iter*/ nullptr,
108 /*tp_iternext*/ nullptr,
109 /*tp_methods*/ nullptr,
110 /*tp_members*/ nullptr,
111 /*tp_getset*/ nullptr,
112 /*tp_base*/ &StrokeShader_Type,
113 /*tp_dict*/ nullptr,
114 /*tp_descr_get*/ nullptr,
115 /*tp_descr_set*/ nullptr,
116 /*tp_dictoffset*/ 0,
117 /*tp_init*/ (initproc)SpatialNoiseShader___init__,
118 /*tp_alloc*/ nullptr,
119 /*tp_new*/ nullptr,
120};
121
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