This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/compositor/nodes/COM_SeparateXYZNode.cc
Hans Goudey 97746129d5 Cleanup: replace UNUSED macro with commented args in C++ code
This is the conventional way of dealing with unused arguments in C++,
since it works on all compilers.

Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-10-03 17:38:16 -05:00

49 lines
1.6 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2021 Blender Foundation. */
#include "COM_SeparateXYZNode.h"
#include "COM_ConvertOperation.h"
namespace blender::compositor {
SeparateXYZNode::SeparateXYZNode(bNode *editor_node) : Node(editor_node)
{
/* pass */
}
void SeparateXYZNode::convert_to_operations(NodeConverter &converter,
const CompositorContext & /*context*/) const
{
NodeInput *vector_socket = this->get_input_socket(0);
NodeOutput *output_x_socket = this->get_output_socket(0);
NodeOutput *output_y_socket = this->get_output_socket(1);
NodeOutput *output_z_socket = this->get_output_socket(2);
{
SeparateChannelOperation *operation = new SeparateChannelOperation();
operation->set_channel(0);
converter.add_operation(operation);
converter.map_input_socket(vector_socket, operation->get_input_socket(0));
converter.map_output_socket(output_x_socket, operation->get_output_socket(0));
}
{
SeparateChannelOperation *operation = new SeparateChannelOperation();
operation->set_channel(1);
converter.add_operation(operation);
converter.map_input_socket(vector_socket, operation->get_input_socket(0));
converter.map_output_socket(output_y_socket, operation->get_output_socket(0));
}
{
SeparateChannelOperation *operation = new SeparateChannelOperation();
operation->set_channel(2);
converter.add_operation(operation);
converter.map_input_socket(vector_socket, operation->get_input_socket(0));
converter.map_output_socket(output_z_socket, operation->get_output_socket(0));
}
}
} // namespace blender::compositor