Blender V4.3
node_texture_viewer.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#include <cmath>
11
13 {SOCK_RGBA, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f},
14 {-1, ""},
15};
16
17static void exec(void *data,
18 int /*thread*/,
19 bNode * /*node*/,
20 bNodeExecData * /*execdata*/,
21 bNodeStack **in,
22 bNodeStack ** /*out*/)
23{
24 TexCallData *cdata = (TexCallData *)data;
25
26 if (cdata->do_preview) {
28 float col[4];
30
31 tex_input_rgba(col, in[0], &params, cdata->thread);
32 }
33}
34
36{
37 static blender::bke::bNodeType ntype;
38
39 tex_node_type_base(&ntype, TEX_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT);
40 blender::bke::node_type_socket_templates(&ntype, inputs, nullptr);
41 ntype.exec_fn = exec;
42
43 ntype.no_muting = true;
44 ntype.flag |= NODE_PREVIEW;
45
47}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:405
@ NODE_PREVIEW
@ SOCK_RGBA
uint col
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
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
void tex_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
void params_from_cdata(TexParams *out, TexCallData *in)
static void exec(void *data, int, bNode *, bNodeExecData *, bNodeStack **in, bNodeStack **)
void register_node_type_tex_viewer()
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)