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