Blender V4.3
COM_CombineXYZNode.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
8
9namespace blender::compositor {
10
11CombineXYZNode::CombineXYZNode(bNode *editor_node) : Node(editor_node) {}
12
14 const CompositorContext & /*context*/) const
15{
16 NodeInput *input_x_socket = this->get_input_socket(0);
17 NodeInput *input_y_socket = this->get_input_socket(1);
18 NodeInput *input_z_socket = this->get_input_socket(2);
19 NodeOutput *output_socket = this->get_output_socket(0);
20
22 if (input_x_socket->is_linked()) {
23 operation->set_canvas_input_index(0);
24 }
25 else if (input_y_socket->is_linked()) {
26 operation->set_canvas_input_index(1);
27 }
28 else {
29 operation->set_canvas_input_index(2);
30 }
31 converter.add_operation(operation);
32
33 converter.map_input_socket(input_x_socket, operation->get_input_socket(0));
34 converter.map_input_socket(input_y_socket, operation->get_input_socket(1));
35 converter.map_input_socket(input_z_socket, operation->get_input_socket(2));
36 converter.map_output_socket(output_socket, operation->get_output_socket());
37}
38
39} // namespace blender::compositor
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
Overall context of the compositor.
void map_output_socket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
void add_operation(NodeOperation *operation)
void map_input_socket(NodeInput *node_socket, NodeOperationInput *operation_socket)
NodeInput are sockets that can receive data/input.
Definition COM_Node.h:191
NodeOperationOutput * get_output_socket(unsigned int index=0)
NodeOperationInput * get_input_socket(unsigned int index)
void set_canvas_input_index(unsigned int index)
set the index of the input socket that will determine the canvas of this operation
NodeOutput are sockets that can send data/input.
Definition COM_Node.h:239
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