Blender V4.3
COM_SwitchNode.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "COM_SwitchNode.h"
6
7namespace blender::compositor {
8
9SwitchNode::SwitchNode(bNode *editor_node) : Node(editor_node)
10{
11 /* pass */
12}
13
15 const CompositorContext & /*context*/) const
16{
17 bool condition = this->get_bnode()->custom1;
18
20 if (!condition) {
21 result = converter.add_input_proxy(get_input_socket(0), false);
22 }
23 else {
24 result = converter.add_input_proxy(get_input_socket(1), false);
25 }
26
27 converter.map_output_socket(get_output_socket(0), result);
28}
29
30} // namespace blender::compositor
Overall context of the compositor.
void map_output_socket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
NodeOperationOutput * add_input_proxy(NodeInput *input, bool use_conversion)
NodeOutput * get_output_socket(unsigned int index=0) const
Definition COM_Node.cc:85
NodeInput * get_input_socket(unsigned int index) const
Definition COM_Node.cc:90
const bNode * get_bnode() const
get the reference to the SDNA bNode struct
Definition COM_Node.h:65
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
int16_t custom1