Blender V5.3
node_texture_coord.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#include "node_texture_util.hh"
11
12namespace blender {
13
15 {SOCK_VECTOR, N_("Coordinates")},
16 {-1, ""},
17};
18
19static void vectorfn(
20 float *out, TexParams *p, bNode * /*node*/, bNodeStack ** /*in*/, short /*thread*/)
21{
22 copy_v3_v3(out, p->co);
23}
24
25static void exec(void *data,
26 int /*thread*/,
27 bNode *node,
28 bNodeExecData *execdata,
29 bNodeStack **in,
31{
32 tex_output(node, execdata, in, out[0], &vectorfn, static_cast<TexCallData *>(data));
33}
34
36{
37 static bke::bNodeType ntype;
38
39 tex_node_type_base(&ntype, "TextureNodeCoordinates"_ustr, TEX_NODE_COORD);
40 ntype.ui_name = "Coordinates";
41 ntype.enum_name_legacy = "COORD";
44 ntype.exec_fn = exec;
45
47}
48
49} // namespace blender
#define NODE_CLASS_INPUT
Definition BKE_node.hh:478
#define TEX_NODE_COORD
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.
MINLINE void copy_v3_v3(float r[3], const float a[3])
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
BMesh const char void * data
void tex_output(bNode *node, bNodeExecData *, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
static void vectorfn(float *out, TexParams *p, bNode *, bNodeStack **, short)
void tex_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
static bke::bNodeSocketTemplate outputs[]
void register_node_type_tex_coord()
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)