Blender V5.3
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 " :param red: The red component.\n"
31 " :type red: float\n"
32 " :param green: The green component.\n"
33 " :type green: float\n"
34 " :param blue: The blue component.\n"
35 " :type blue: float\n"
36 " :param 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 " :param 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,
53 kwds,
54 "f" /* `red` */
55 "f" /* `green` */
56 "f" /* `blue` */
57 "|" /* Optional arguments. */
58 "f" /* `alpha` */
59 ":__init__",
60 (char **)kwlist,
61 &f1,
62 &f2,
63 &f3,
64 &f4))
65 {
66 return -1;
67 }
68 self->py_ss.ss = new StrokeShaders::ConstantColorShader(f1, f2, f3, f4);
69 return 0;
70}
71
72/*-----------------------BPy_ConstantColorShader type definition ------------------------------*/
73
75 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
76 /*tp_name*/ "ConstantColorShader",
77 /*tp_basicsize*/ sizeof(BPy_ConstantColorShader),
78 /*tp_itemsize*/ 0,
79 /*tp_dealloc*/ nullptr,
80 /*tp_vectorcall_offset*/ 0,
81 /*tp_getattr*/ nullptr,
82 /*tp_setattr*/ nullptr,
83 /*tp_as_async*/ nullptr,
84 /*tp_repr*/ nullptr,
85 /*tp_as_number*/ nullptr,
86 /*tp_as_sequence*/ nullptr,
87 /*tp_as_mapping*/ nullptr,
88 /*tp_hash*/ nullptr,
89 /*tp_call*/ nullptr,
90 /*tp_str*/ nullptr,
91 /*tp_getattro*/ nullptr,
92 /*tp_setattro*/ nullptr,
93 /*tp_as_buffer*/ nullptr,
94 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
95 /*tp_doc*/ ConstantColorShader___doc__,
96 /*tp_traverse*/ nullptr,
97 /*tp_clear*/ nullptr,
98 /*tp_richcompare*/ nullptr,
99 /*tp_weaklistoffset*/ 0,
100 /*tp_iter*/ nullptr,
101 /*tp_iternext*/ nullptr,
102 /*tp_methods*/ nullptr,
103 /*tp_members*/ nullptr,
104 /*tp_getset*/ nullptr,
105 /*tp_base*/ &StrokeShader_Type,
106 /*tp_dict*/ nullptr,
107 /*tp_descr_get*/ nullptr,
108 /*tp_descr_set*/ nullptr,
109 /*tp_dictoffset*/ 0,
110 /*tp_init*/ (initproc)ConstantColorShader___init__,
111 /*tp_alloc*/ nullptr,
112 /*tp_new*/ nullptr,
113};
114
PyTypeObject ConstantColorShader_Type
static int ConstantColorShader___init__(BPy_ConstantColorShader *self, PyObject *args, PyObject *kwds)
PyDoc_STRVAR(FalseBP1D___doc__, "Class hierarchy: :class:`freestyle.types.BinaryPredicate1D` > :class:`FalseBP1D`\n" "\n" ".. method:: __call__(inter1, inter2)\n" "\n" " Always returns false.\n" "\n" " :param inter1: The first Interface1D object.\n" " :type inter1: :class:`freestyle.types.Interface1D`\n" " :param inter2: The second Interface1D object.\n" " :type inter2: :class:`freestyle.types.Interface1D`\n" " :return: False.\n" " :rtype: bool\n")
PyTypeObject StrokeShader_Type
Class gathering basic stroke shaders.
inherits from class Rep
Definition AppCanvas.cpp:20
PyObject_HEAD Freestyle::StrokeShader * ss