Files
test/source/blender/nodes/texture/nodes/node_texture_compose.cc
Iliya Katueshenock 1b67be14c6 Cleanup: BKE: Nodes: Functions renaming
Use snake style naming for all the kernel nodes functions.
Omit kernel prefix in the names since of the using namespace.
Use full forms of the terms
('iter' -> 'iterator', 'ntree' -> 'node_tree', 'rem' -> 'remove', ...).

Pull Request: https://projects.blender.org/blender/blender/pulls/126416
2024-08-19 20:27:37 +02:00

52 lines
1.4 KiB
C++

/* SPDX-FileCopyrightText: 2005 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup texnodes
*/
#include "node_texture_util.hh"
static blender::bke::bNodeSocketTemplate inputs[] = {
{SOCK_FLOAT, N_("Red"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Green"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Blue"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
{SOCK_FLOAT, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
{-1, ""},
};
static blender::bke::bNodeSocketTemplate outputs[] = {
{SOCK_RGBA, N_("Color")},
{-1, ""},
};
static void colorfn(float *out, TexParams *p, bNode * /*node*/, bNodeStack **in, short thread)
{
int i;
for (i = 0; i < 4; i++) {
out[i] = tex_input_value(in[i], p, thread);
}
}
static void exec(void *data,
int /*thread*/,
bNode *node,
bNodeExecData *execdata,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_compose()
{
static blender::bke::bNodeType ntype;
tex_node_type_base(
&ntype, TEX_NODE_COMPOSE_LEGACY, "Combine RGBA (Legacy)", NODE_CLASS_OP_COLOR);
blender::bke::node_type_socket_templates(&ntype, inputs, outputs);
ntype.exec_fn = exec;
blender::bke::node_register_type(&ntype);
}