Blender V4.5
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 /* all float[3] */
27 const float *co;
28 float *dxt, *dyt;
29
30 int osatex;
33 short thread;
35 int cfra;
36
37 const MTex *mtex;
38};
39
40struct TexParams {
41 const float *co;
42 float *dxt, *dyt;
43 const float *previewco;
44 int cfra;
45 int osatex;
46
47 /* optional. we don't really want these here, but image
48 * textures need to do mapping & color correction */
49 const MTex *mtex;
50};
51
52using TexFn = void (*)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread);
53
61
63 const bNodeTree *ntree,
64 const char **r_disabled_hint);
66 std::string idname,
67 std::optional<int16_t> legacy_type = std::nullopt);
68
69void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread);
70void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread);
72
73void tex_output(bNode *node,
74 bNodeExecData *execdata,
75 bNodeStack **in,
79
81
86 void *callerdata,
87 int thread);
88
90 bNodeTree *ntree,
91 bNodeInstanceKey parent_key);
#define MAX_SOCKET
Definition BKE_node.hh:27
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:226