Blender  V3.3
node_texture_at.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_RGBA, N_("Texture"), 0.0f, 0.0f, 0.0f, 1.0f},
13  {SOCK_VECTOR, N_("Coordinates"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE},
14  {-1, ""},
15 };
17  {SOCK_RGBA, N_("Texture")},
18  {-1, ""},
19 };
20 
21 static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread)
22 {
23  TexParams np = *p;
24  float new_co[3];
25  np.co = new_co;
26 
27  tex_input_vec(new_co, in[1], p, thread);
28  tex_input_rgba(out, in[0], &np, thread);
29 }
30 
31 static void exec(void *data,
32  int UNUSED(thread),
33  bNode *node,
34  bNodeExecData *execdata,
35  bNodeStack **in,
36  bNodeStack **out)
37 {
38  tex_output(node, execdata, in, out[0], &colorfn, data);
39 }
40 
42 {
43  static bNodeType ntype;
44 
47  node_type_size(&ntype, 140, 100, 320);
48  node_type_exec(&ntype, NULL, NULL, exec);
49 
50  nodeRegisterType(&ntype);
51 }
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4396
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4358
#define TEX_NODE_AT
Definition: BKE_node.h:1369
#define NODE_CLASS_DISTORT
Definition: BKE_node.h:353
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
#define UNUSED(x)
@ SOCK_VECTOR
@ SOCK_RGBA
@ PROP_NONE
Definition: RNA_types.h:126
Definition: thread.h:34
OperationNode * node
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static bNodeSocketTemplate outputs[]
static bNodeSocketTemplate inputs[]
static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread)
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
void register_node_type_tex_at(void)
void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
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)