Blender V5.3
node_texture_at.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_("Texture"), 0.0f, 0.0f, 0.0f, 1.0f},
15 {SOCK_VECTOR, N_("Coordinates"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE},
16 {-1, ""},
17};
19 {SOCK_RGBA, N_("Texture")},
20 {-1, ""},
21};
22
23static void colorfn(float *out, TexParams *p, bNode * /*node*/, bNodeStack **in, short thread)
24{
25 TexParams np = *p;
26 float new_co[3];
27 np.co = new_co;
28
29 tex_input_vec(new_co, in[1], p, thread);
30 tex_input_rgba(out, in[0], &np, thread);
31}
32
33static void exec(void *data,
34 int /*thread*/,
35 bNode *node,
36 bNodeExecData *execdata,
37 bNodeStack **in,
39{
40 tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
41}
42
44{
45 static bke::bNodeType ntype;
46
47 tex_node_type_base(&ntype, "TextureNodeAt"_ustr, TEX_NODE_AT);
48 ntype.ui_name = "At";
49 ntype.enum_name_legacy = "AT";
52 ntype.exec_fn = exec;
53
55}
56
57} // namespace blender
#define NODE_CLASS_DISTORT
Definition BKE_node.hh:486
#define TEX_NODE_AT
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_vec(float *out, bNodeStack *in, TexParams *params, short thread)
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
static void colorfn(float *out, TexParams *p, bNode *, bNodeStack **in, short thread)
BMesh const char void * data
void tex_output(bNode *node, bNodeExecData *, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
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_at()
static bke::bNodeSocketTemplate outputs[]
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)