Blender V4.3
node_composite_value.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2006 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
12
13/* **************** VALUE ******************** */
14
16
18{
19 b.add_output<decl::Float>("Value").default_value(0.5f);
20}
21
22using namespace blender::realtime_compositor;
23
25 public:
27
28 void execute() override
29 {
30 Result &result = get_result("Value");
31 result.allocate_single_value();
32
33 const bNodeSocket *socket = static_cast<bNodeSocket *>(bnode().outputs.first);
34 float value = static_cast<bNodeSocketValueFloat *>(socket->default_value)->value;
35
36 result.set_float_value(value);
37 }
38};
39
41{
42 return new ValueOperation(context, node);
43}
44
45} // namespace blender::nodes::node_composite_value_cc
46
48{
50
51 static blender::bke::bNodeType ntype;
52
53 cmp_node_type_base(&ntype, CMP_NODE_VALUE, "Value", NODE_CLASS_INPUT);
54 ntype.declare = file_ns::cmp_node_value_declare;
56 ntype.get_compositor_operation = file_ns::get_compositor_operation;
57
59}
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
NodeOperation(Context &context, DNode node)
Result & get_result(StringRef identifier)
Definition operation.cc:46
local_group_size(16, 16) .push_constant(Type b
void node_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
Definition node.cc:4614
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void cmp_node_value_declare(NodeDeclarationBuilder &b)
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_cmp_value()
void * first
void * default_value
ListBase outputs
Defines a node type.
Definition BKE_node.hh:218
NodeGetCompositorOperationFunction get_compositor_operation
Definition BKE_node.hh:324
NodeDeclareFunction declare
Definition BKE_node.hh:347