Blender  V3.3
node_texture_coord.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #include "NOD_texture.h"
9 #include "node_texture_util.h"
10 
12  {SOCK_VECTOR, N_("Coordinates")},
13  {-1, ""},
14 };
15 
16 static void vectorfn(
17  float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **UNUSED(in), short UNUSED(thread))
18 {
19  copy_v3_v3(out, p->co);
20 }
21 
22 static void exec(void *data,
23  int UNUSED(thread),
24  bNode *node,
25  bNodeExecData *execdata,
26  bNodeStack **in,
27  bNodeStack **out)
28 {
29  tex_output(node, execdata, in, out[0], &vectorfn, data);
30 }
31 
33 {
34  static bNodeType ntype;
35 
36  tex_node_type_base(&ntype, TEX_NODE_COORD, "Coordinates", NODE_CLASS_INPUT);
38  node_type_exec(&ntype, NULL, NULL, exec);
39 
40  nodeRegisterType(&ntype);
41 }
#define TEX_NODE_COORD
Definition: BKE_node.h:1363
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4358
#define NODE_CLASS_INPUT
Definition: BKE_node.h:345
void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction init_exec_fn, NodeFreeExecFunction free_exec_fn, NodeExecFunction exec_fn)
Definition: node.cc:4455
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define UNUSED(x)
@ SOCK_VECTOR
Definition: thread.h:34
OperationNode * node
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
void register_node_type_tex_coord(void)
static void vectorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **UNUSED(in), short UNUSED(thread))
static bNodeSocketTemplate outputs[]
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
void tex_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
const float * co
Compact definition of a node socket.
Definition: BKE_node.h:84
Defines a node type.
Definition: BKE_node.h:226
#define N_(msgid)