Blender V5.0
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
22struct bNodeThreadStack;
23
26 /* float[3] */
27 const float *co;
28
31 short thread;
33 int cfra;
34
35 const MTex *mtex;
36};
37
38struct TexParams {
39 const float *co;
40 const float *previewco;
41 int cfra;
42
43 /* optional. we don't really want these here, but image
44 * textures need to do mapping & color correction */
45 const MTex *mtex;
46};
47
48using TexFn = void (*)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread);
49
57
59 const bNodeTree *ntree,
60 const char **r_disabled_hint);
62 std::string idname,
63 std::optional<int16_t> legacy_type = std::nullopt);
64
65void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread);
66void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread);
68
69void tex_output(bNode *node,
70 bNodeExecData *execdata,
71 bNodeStack **in,
75
77
82 void *callerdata,
83 int thread);
84
86 bNodeTree *ntree,
87 bNodeInstanceKey parent_key);
#define MAX_SOCKET
Definition BKE_node.hh:28
BMesh const char void * data
#define in
#define out
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
static void texfn(float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread)
bNodeThreadStack * ntreeGetThreadStack(bNodeTreeExec *exec, int thread)
bool ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *callerdata, int thread)
void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread)
float tex_input_value(bNodeStack *in, TexParams *params, short thread)
void tex_node_type_base(blender::bke::bNodeType *ntype, std::string idname, std::optional< int16_t > legacy_type=std::nullopt)
bNodeTreeExec * ntreeTexBeginExecTree_internal(bNodeExecContext *context, bNodeTree *ntree, bNodeInstanceKey parent_key)
void ntreeTexEndExecTree_internal(bNodeTreeExec *exec)
bool tex_node_poll_default(const blender::bke::bNodeType *ntype, const bNodeTree *ntree, const char **r_disabled_hint)
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
void params_from_cdata(TexParams *out, TexCallData *in)
void ntreeReleaseThreadStack(bNodeThreadStack *nts)
void(*)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread) TexFn
void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *data)
const float * co
TexResult * target
const MTex * mtex
bNodeStack * in[MAX_SOCKET]
TexCallData * cdata
const MTex * mtex
const float * co
const float * previewco
Defines a node type.
Definition BKE_node.hh:238