Blender  V3.3
COM_SwitchNode.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
4 #include "COM_SwitchNode.h"
5 
6 namespace blender::compositor {
7 
8 SwitchNode::SwitchNode(bNode *editor_node) : Node(editor_node)
9 {
10  /* pass */
11 }
12 
14  const CompositorContext & /*context*/) const
15 {
16  bool condition = this->get_bnode()->custom1;
17 
19  if (!condition) {
20  result = converter.add_input_proxy(get_input_socket(0), false);
21  }
22  else {
23  result = converter.add_input_proxy(get_input_socket(1), false);
24  }
25 
27 }
28 
29 } // 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:84
bNode * get_bnode() const
get the reference to the SDNA bNode struct
Definition: COM_Node.h:64
NodeInput * get_input_socket(unsigned int index) const
Definition: COM_Node.cc:89
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
SwitchNode(bNode *editor_node)
short custom1