Blender V4.3
node_texture_compose.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
12 {SOCK_FLOAT, N_("Red"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
13 {SOCK_FLOAT, N_("Green"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
14 {SOCK_FLOAT, N_("Blue"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
15 {SOCK_FLOAT, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
16 {-1, ""},
17};
19 {SOCK_RGBA, N_("Color")},
20 {-1, ""},
21};
22
23static void colorfn(float *out, TexParams *p, bNode * /*node*/, bNodeStack **in, short thread)
24{
25 int i;
26 for (i = 0; i < 4; i++) {
27 out[i] = tex_input_value(in[i], p, thread);
28 }
29}
30
31static void exec(void *data,
32 int /*thread*/,
33 bNode *node,
34 bNodeExecData *execdata,
35 bNodeStack **in,
36 bNodeStack **out)
37{
38 tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
39}
40
42{
43 static blender::bke::bNodeType ntype;
44
46 &ntype, TEX_NODE_COMPOSE_LEGACY, "Combine RGBA (Legacy)", NODE_CLASS_OP_COLOR);
47 blender::bke::node_type_socket_templates(&ntype, inputs, outputs);
48 ntype.exec_fn = exec;
49
51}
#define NODE_CLASS_OP_COLOR
Definition BKE_node.hh:406
@ SOCK_FLOAT
@ SOCK_RGBA
@ PROP_UNSIGNED
Definition RNA_types.hh:152
void node_type_socket_templates(bNodeType *ntype, bNodeSocketTemplate *inputs, bNodeSocketTemplate *outputs)
Definition node.cc:4570
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void colorfn(float *out, TexParams *p, bNode *, bNodeStack **in, short thread)
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
void register_node_type_tex_compose()
void tex_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
Compact definition of a node socket.
Definition BKE_node.hh:103
Defines a node type.
Definition BKE_node.hh:218
NodeExecFunction exec_fn
Definition BKE_node.hh:316
#define N_(msgid)