Blender
V3.3
source
blender
freestyle
intern
python
StrokeShader
BPy_ConstantColorShader.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
7
#include "
BPy_ConstantColorShader.h
"
8
9
#include "../../stroke/BasicStrokeShaders.h"
10
11
#ifdef __cplusplus
12
extern
"C"
{
13
#endif
14
15
using namespace
Freestyle
;
16
18
19
//------------------------INSTANCE METHODS ----------------------------------
20
21
static
char
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"
;
45
46
static
int
ConstantColorShader___init__
(
BPy_ConstantColorShader
*
self
,
47
PyObject *args,
48
PyObject *kwds)
49
{
50
static
const
char
*kwlist[] = {
"red"
,
"green"
,
"blue"
,
"alpha"
,
nullptr
};
51
float
f1, f2, f3, f4 = 1.0;
52
53
if
(!PyArg_ParseTupleAndKeywords(args, kwds,
"fff|f"
, (
char
**)kwlist, &f1, &f2, &f3, &f4)) {
54
return
-1;
55
}
56
self
->py_ss.ss =
new
StrokeShaders::ConstantColorShader
(f1, f2, f3, f4);
57
return
0;
58
}
59
60
/*-----------------------BPy_ConstantColorShader type definition ------------------------------*/
61
62
PyTypeObject
ConstantColorShader_Type
= {
63
PyVarObject_HEAD_INIT(
nullptr
, 0)
"ConstantColorShader"
,
/* tp_name */
64
sizeof
(
BPy_ConstantColorShader
),
/* tp_basicsize */
65
0,
/* tp_itemsize */
66
nullptr
,
/* tp_dealloc */
67
0,
/* tp_vectorcall_offset */
68
nullptr
,
/* tp_getattr */
69
nullptr
,
/* tp_setattr */
70
nullptr
,
/* tp_reserved */
71
nullptr
,
/* tp_repr */
72
nullptr
,
/* tp_as_number */
73
nullptr
,
/* tp_as_sequence */
74
nullptr
,
/* tp_as_mapping */
75
nullptr
,
/* tp_hash */
76
nullptr
,
/* tp_call */
77
nullptr
,
/* tp_str */
78
nullptr
,
/* tp_getattro */
79
nullptr
,
/* tp_setattro */
80
nullptr
,
/* tp_as_buffer */
81
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
/* tp_flags */
82
ConstantColorShader___doc__
,
/* tp_doc */
83
nullptr
,
/* tp_traverse */
84
nullptr
,
/* tp_clear */
85
nullptr
,
/* tp_richcompare */
86
0,
/* tp_weaklistoffset */
87
nullptr
,
/* tp_iter */
88
nullptr
,
/* tp_iternext */
89
nullptr
,
/* tp_methods */
90
nullptr
,
/* tp_members */
91
nullptr
,
/* tp_getset */
92
&
StrokeShader_Type
,
/* tp_base */
93
nullptr
,
/* tp_dict */
94
nullptr
,
/* tp_descr_get */
95
nullptr
,
/* tp_descr_set */
96
0,
/* tp_dictoffset */
97
(initproc)
ConstantColorShader___init__
,
/* tp_init */
98
nullptr
,
/* tp_alloc */
99
nullptr
,
/* tp_new */
100
};
101
103
104
#ifdef __cplusplus
105
}
106
#endif
ConstantColorShader_Type
PyTypeObject ConstantColorShader_Type
Definition:
BPy_ConstantColorShader.cpp:62
ConstantColorShader___init__
static int ConstantColorShader___init__(BPy_ConstantColorShader *self, PyObject *args, PyObject *kwds)
Definition:
BPy_ConstantColorShader.cpp:46
ConstantColorShader___doc__
static char ConstantColorShader___doc__[]
Definition:
BPy_ConstantColorShader.cpp:21
BPy_ConstantColorShader.h
StrokeShader_Type
PyTypeObject StrokeShader_Type
Definition:
BPy_StrokeShader.cpp:268
Freestyle::StrokeShaders::ConstantColorShader
Definition:
BasicStrokeShaders.h:242
Freestyle
inherits from class Rep
Definition:
AppCanvas.cpp:18
BPy_ConstantColorShader
Definition:
BPy_ConstantColorShader.h:23
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1