Blender V4.3
COM_SocketProxyNode.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
6
7namespace blender::compositor {
8
10 bNodeSocket *editor_input,
11 bNodeSocket *editor_output,
12 bool use_conversion)
13 : Node(editor_node, false), use_conversion_(use_conversion)
14{
15 DataType dt;
16
17 dt = DataType::Value;
18 if (editor_input->type == SOCK_RGBA) {
19 dt = DataType::Color;
20 }
21 if (editor_input->type == SOCK_VECTOR) {
23 }
24 this->add_input_socket(dt, editor_input);
25
26 dt = DataType::Value;
27 if (editor_output->type == SOCK_RGBA) {
28 dt = DataType::Color;
29 }
30 if (editor_output->type == SOCK_VECTOR) {
32 }
33 this->add_output_socket(dt, editor_output);
34}
35
37 const CompositorContext & /*context*/) const
38{
39 NodeOperationOutput *proxy_output = converter.add_input_proxy(get_input_socket(0),
40 use_conversion_);
41 converter.map_output_socket(get_output_socket(), proxy_output);
42}
43
44} // namespace blender::compositor
@ SOCK_VECTOR
@ SOCK_RGBA
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
void add_output_socket(DataType datatype)
add an NodeOutput to the collection of output-sockets
Definition COM_Node.cc:75
NodeInput * get_input_socket(unsigned int index) const
Definition COM_Node.cc:90
void add_input_socket(DataType datatype)
add an NodeInput to the collection of input-sockets
Definition COM_Node.cc:64
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
SocketProxyNode(bNode *editor_node, bNodeSocket *editor_input, bNodeSocket *editor_output, bool use_conversion)
DataType
possible data types for sockets
Definition COM_defines.h:21
@ Vector
Vector data type.