Blender
V4.3
source
blender
freestyle
intern
python
StrokeShader
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
9
#include "
BPy_ConstantColorShader.h
"
10
11
#include "
../../stroke/BasicStrokeShaders.h
"
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
17
using namespace
Freestyle
;
18
20
21
//------------------------INSTANCE METHODS ----------------------------------
22
23
PyDoc_STRVAR
(
24
/* Wrap. */
25
ConstantColorShader___doc__,
26
"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstantColorShader`\n"
27
"\n"
28
"[Color shader]\n"
29
"\n"
30
".. method:: __init__(red, green, blue, alpha=1.0)\n"
31
"\n"
32
" Builds a ConstantColorShader object.\n"
33
"\n"
34
" :arg red: The red component.\n"
35
" :type red: float\n"
36
" :arg green: The green component.\n"
37
" :type green: float\n"
38
" :arg blue: The blue component.\n"
39
" :type blue: float\n"
40
" :arg alpha: The alpha value.\n"
41
" :type alpha: float\n"
42
"\n"
43
".. method:: shade(stroke)\n"
44
"\n"
45
" Assigns a constant color to every vertex of the Stroke.\n"
46
"\n"
47
" :arg stroke: A Stroke object.\n"
48
" :type stroke: :class:`freestyle.types.Stroke`\n"
);
49
50
static
int
ConstantColorShader___init__
(
BPy_ConstantColorShader
*
self
,
51
PyObject *args,
52
PyObject *kwds)
53
{
54
static
const
char
*kwlist[] = {
"red"
,
"green"
,
"blue"
,
"alpha"
,
nullptr
};
55
float
f1, f2, f3, f4 = 1.0;
56
57
if
(!PyArg_ParseTupleAndKeywords(args, kwds,
"fff|f"
, (
char
**)kwlist, &f1, &f2, &f3, &f4)) {
58
return
-1;
59
}
60
self
->py_ss.ss =
new
StrokeShaders::ConstantColorShader
(f1, f2, f3, f4);
61
return
0;
62
}
63
64
/*-----------------------BPy_ConstantColorShader type definition ------------------------------*/
65
66
PyTypeObject
ConstantColorShader_Type
= {
67
/*ob_base*/
PyVarObject_HEAD_INIT(
nullptr
, 0)
68
/*tp_name*/
"ConstantColorShader"
,
69
/*tp_basicsize*/
sizeof
(
BPy_ConstantColorShader
),
70
/*tp_itemsize*/
0,
71
/*tp_dealloc*/
nullptr
,
72
/*tp_vectorcall_offset*/
0,
73
/*tp_getattr*/
nullptr
,
74
/*tp_setattr*/
nullptr
,
75
/*tp_as_async*/
nullptr
,
76
/*tp_repr*/
nullptr
,
77
/*tp_as_number*/
nullptr
,
78
/*tp_as_sequence*/
nullptr
,
79
/*tp_as_mapping*/
nullptr
,
80
/*tp_hash*/
nullptr
,
81
/*tp_call*/
nullptr
,
82
/*tp_str*/
nullptr
,
83
/*tp_getattro*/
nullptr
,
84
/*tp_setattro*/
nullptr
,
85
/*tp_as_buffer*/
nullptr
,
86
/*tp_flags*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
87
/*tp_doc*/
ConstantColorShader___doc__,
88
/*tp_traverse*/
nullptr
,
89
/*tp_clear*/
nullptr
,
90
/*tp_richcompare*/
nullptr
,
91
/*tp_weaklistoffset*/
0,
92
/*tp_iter*/
nullptr
,
93
/*tp_iternext*/
nullptr
,
94
/*tp_methods*/
nullptr
,
95
/*tp_members*/
nullptr
,
96
/*tp_getset*/
nullptr
,
97
/*tp_base*/
&
StrokeShader_Type
,
98
/*tp_dict*/
nullptr
,
99
/*tp_descr_get*/
nullptr
,
100
/*tp_descr_set*/
nullptr
,
101
/*tp_dictoffset*/
0,
102
/*tp_init*/
(initproc)
ConstantColorShader___init__
,
103
/*tp_alloc*/
nullptr
,
104
/*tp_new*/
nullptr
,
105
};
106
108
109
#ifdef __cplusplus
110
}
111
#endif
ConstantColorShader_Type
PyTypeObject ConstantColorShader_Type
Definition
BPy_ConstantColorShader.cpp:66
ConstantColorShader___init__
static int ConstantColorShader___init__(BPy_ConstantColorShader *self, PyObject *args, PyObject *kwds)
Definition
BPy_ConstantColorShader.cpp:50
PyDoc_STRVAR
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")
BPy_ConstantColorShader.h
StrokeShader_Type
PyTypeObject StrokeShader_Type
Definition
BPy_StrokeShader.cpp:261
BasicStrokeShaders.h
Class gathering basic stroke shaders.
self
PyObject * self
Definition
bpy_driver.cc:166
Freestyle::StrokeShaders::ConstantColorShader
Definition
BasicStrokeShaders.h:234
Freestyle
inherits from class Rep
Definition
AppCanvas.cpp:20
BPy_ConstantColorShader
Definition
BPy_ConstantColorShader.h:25
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0