Blender V5.0
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
8
10
12 {SOCK_RGBA, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f},
13 {-1, ""},
14};
15
16static void exec(void *data,
17 int /*thread*/,
18 bNode * /*node*/,
19 bNodeExecData * /*execdata*/,
20 bNodeStack **in,
21 bNodeStack ** /*out*/)
22{
23 TexCallData *cdata = (TexCallData *)data;
24
25 if (cdata->do_preview) {
27 float col[4];
29
30 tex_input_rgba(col, in[0], &params, cdata->thread);
31 }
32}
33
35{
36 static blender::bke::bNodeType ntype;
37
38 tex_node_type_base(&ntype, "TextureNodeViewer", TEX_NODE_VIEWER);
39 ntype.ui_name = "Viewer";
40 ntype.enum_name_legacy = "VIEWER";
43 ntype.exec_fn = exec;
44
45 ntype.no_muting = true;
46 ntype.flag |= NODE_PREVIEW;
47
49}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:448
#define TEX_NODE_VIEWER
@ NODE_PREVIEW
@ SOCK_RGBA
BMesh const char void * data
uint col
#define in
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
void node_type_socket_templates(bNodeType *ntype, bNodeSocketTemplate *inputs, bNodeSocketTemplate *outputs)
Definition node.cc:5352
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
static blender::bke::bNodeSocketTemplate inputs[]
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
void tex_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
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:99
Defines a node type.
Definition BKE_node.hh:238
NodeExecFunction exec_fn
Definition BKE_node.hh:340
const char * enum_name_legacy
Definition BKE_node.hh:247
#define N_(msgid)