Blender V5.3
node_texture_util.hh
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#pragma once
10
11#include <optional>
12
13#include "BKE_node.hh"
14#include "BKE_node_legacy_types.hh" // IWYU pragma: export
15
16#include "node_texture_register.hh" // IWYU pragma: export
17
18#include "BLT_translation.hh" // IWYU pragma: export
19
20#include "RE_texture.h"
21
22namespace blender {
23
24struct bNodeThreadStack;
25
28 /* float[3] */
29 const float *co;
30
33 short thread;
35 int cfra;
36
37 const MTex *mtex;
38};
39
40struct TexParams {
41 const float *co;
42 const float *previewco;
43 int cfra;
44
45 /* optional. we don't really want these here, but image
46 * textures need to do mapping & color correction */
47 const MTex *mtex;
48};
49
50using TexFn = void (*)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread);
51
59
61 const bNodeTree *ntree,
62 const char **r_disabled_hint);
64 UString idname,
65 std::optional<int16_t> legacy_type = std::nullopt);
66
67void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread);
68void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread);
69float tex_input_value(bNodeStack *in, TexParams *params, short thread);
70
72 bNodeExecData *execdata,
73 bNodeStack **in,
75 TexFn texfn,
77
79
84 void *callerdata,
85 int thread);
86
88 bNodeTree *ntree,
89 bNodeInstanceKey parent_key);
91
92} // namespace blender
#define MAX_SOCKET
Definition BKE_node.hh:30
BMesh Iterators.
void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread)
void ntreeTexEndExecTree_internal(bNodeTreeExec *exec)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
void(*)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread) TexFn
bNodeTreeExec * ntreeTexBeginExecTree_internal(bNodeExecContext *context, bNodeTree *ntree, bNodeInstanceKey parent_key)
BMesh const char void * data
void tex_output(bNode *node, bNodeExecData *, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
void params_from_cdata(TexParams *out, TexCallData *in)
void tex_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *callerdata, int thread)
bool tex_node_poll_default(const bke::bNodeType *, const bNodeTree *ntree, const char **r_disabled_hint)
bNodeThreadStack * ntreeGetThreadStack(bNodeTreeExec *exec, int thread)
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
void ntreeReleaseThreadStack(bNodeThreadStack *nts)
bNodeStack * in[MAX_SOCKET]
Defines a node type.
Definition BKE_node.hh:265