Blender V5.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
8
10
11namespace blender {
12
14 {SOCK_RGBA, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f},
15 {-1, ""},
16};
17
18static void exec(void *data,
19 int /*thread*/,
20 bNode * /*node*/,
21 bNodeExecData * /*execdata*/,
22 bNodeStack **in,
23 bNodeStack ** /*out*/)
24{
25 TexCallData *cdata = static_cast<TexCallData *>(data);
26
27 if (cdata->do_preview) {
28 TexParams params;
29 float col[4];
30 params_from_cdata(&params, cdata);
31
32 tex_input_rgba(col, in[0], &params, cdata->thread);
33 }
34}
35
37{
38 static bke::bNodeType ntype;
39
40 tex_node_type_base(&ntype, "TextureNodeViewer"_ustr, TEX_NODE_VIEWER);
41 ntype.ui_name = "Viewer";
42 ntype.enum_name_legacy = "VIEWER";
45 ntype.exec_fn = exec;
46
47 ntype.no_muting = true;
48 ntype.flag |= NODE_PREVIEW;
49
51}
52
53} // namespace blender
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:479
#define TEX_NODE_VIEWER
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
void node_type_socket_templates(bNodeType *ntype, bNodeSocketTemplate *inputs, bNodeSocketTemplate *outputs)
Definition node.cc:6134
BMesh Iterators.
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
static void exec(void *data, int, bNode *, bNodeExecData *, bNodeStack **in, bNodeStack **)
BMesh const char void * data
void params_from_cdata(TexParams *out, TexCallData *in)
static bke::bNodeSocketTemplate inputs[]
void tex_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void register_node_type_tex_viewer()
Compact definition of a node socket.
Definition BKE_node.hh:102
Defines a node type.
Definition BKE_node.hh:265
NodeExecFunction exec_fn
Definition BKE_node.hh:371
const char * enum_name_legacy
Definition BKE_node.hh:274
#define N_(msgid)