Blender V5.0
BPy_ConstantColorShader.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
12
13using namespace Freestyle;
14
16
17//------------------------INSTANCE METHODS ----------------------------------
18
20 /* Wrap. */
21 ConstantColorShader___doc__,
22 "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstantColorShader`\n"
23 "\n"
24 "[Color shader]\n"
25 "\n"
26 ".. method:: __init__(red, green, blue, alpha=1.0)\n"
27 "\n"
28 " Builds a ConstantColorShader object.\n"
29 "\n"
30 " :arg red: The red component.\n"
31 " :type red: float\n"
32 " :arg green: The green component.\n"
33 " :type green: float\n"
34 " :arg blue: The blue component.\n"
35 " :type blue: float\n"
36 " :arg alpha: The alpha value.\n"
37 " :type alpha: float\n"
38 "\n"
39 ".. method:: shade(stroke)\n"
40 "\n"
41 " Assigns a constant color to every vertex of the Stroke.\n"
42 "\n"
43 " :arg stroke: A Stroke object.\n"
44 " :type stroke: :class:`freestyle.types.Stroke`\n");
46 PyObject *args,
47 PyObject *kwds)
48{
49 static const char *kwlist[] = {"red", "green", "blue", "alpha", nullptr};
50 float f1, f2, f3, f4 = 1.0;
51
52 if (!PyArg_ParseTupleAndKeywords(args, kwds, "fff|f", (char **)kwlist, &f1, &f2, &f3, &f4)) {
53 return -1;
54 }
55 self->py_ss.ss = new StrokeShaders::ConstantColorShader(f1, f2, f3, f4);
56 return 0;
57}
58
59/*-----------------------BPy_ConstantColorShader type definition ------------------------------*/
60
62 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
63 /*tp_name*/ "ConstantColorShader",
64 /*tp_basicsize*/ sizeof(BPy_ConstantColorShader),
65 /*tp_itemsize*/ 0,
66 /*tp_dealloc*/ nullptr,
67 /*tp_vectorcall_offset*/ 0,
68 /*tp_getattr*/ nullptr,
69 /*tp_setattr*/ nullptr,
70 /*tp_as_async*/ nullptr,
71 /*tp_repr*/ nullptr,
72 /*tp_as_number*/ nullptr,
73 /*tp_as_sequence*/ nullptr,
74 /*tp_as_mapping*/ nullptr,
75 /*tp_hash*/ nullptr,
76 /*tp_call*/ nullptr,
77 /*tp_str*/ nullptr,
78 /*tp_getattro*/ nullptr,
79 /*tp_setattro*/ nullptr,
80 /*tp_as_buffer*/ nullptr,
81 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
82 /*tp_doc*/ ConstantColorShader___doc__,
83 /*tp_traverse*/ nullptr,
84 /*tp_clear*/ nullptr,
85 /*tp_richcompare*/ nullptr,
86 /*tp_weaklistoffset*/ 0,
87 /*tp_iter*/ nullptr,
88 /*tp_iternext*/ nullptr,
89 /*tp_methods*/ nullptr,
90 /*tp_members*/ nullptr,
91 /*tp_getset*/ nullptr,
92 /*tp_base*/ &StrokeShader_Type,
93 /*tp_dict*/ nullptr,
94 /*tp_descr_get*/ nullptr,
95 /*tp_descr_set*/ nullptr,
96 /*tp_dictoffset*/ 0,
97 /*tp_init*/ (initproc)ConstantColorShader___init__,
98 /*tp_alloc*/ nullptr,
99 /*tp_new*/ nullptr,
100};
101
PyTypeObject ConstantColorShader_Type
static int ConstantColorShader___init__(BPy_ConstantColorShader *self, PyObject *args, PyObject *kwds)
PyDoc_STRVAR(ConstantColorShader___doc__, "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstantColorShader`\n" "\n" "[Color shader]\n" "\n" ".. method:: __init__(red, green, blue, alpha=1.0)\n" "\n" " Builds a ConstantColorShader object.\n" "\n" " :arg red: The red component.\n" " :type red: float\n" " :arg green: The green component.\n" " :type green: float\n" " :arg blue: The blue component.\n" " :type blue: float\n" " :arg alpha: The alpha value.\n" " :type alpha: float\n" "\n" ".. method:: shade(stroke)\n" "\n" " Assigns a constant color to every vertex of the Stroke.\n" "\n" " :arg stroke: A Stroke object.\n" " :type stroke: :class:`freestyle.types.Stroke`\n")
PyTypeObject StrokeShader_Type
Class gathering basic stroke shaders.
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20