Blender V4.5
geometry_nodes_closure.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
7namespace blender::nodes {
8
9std::optional<int> ClosureSignature::find_input_index(const SocketInterfaceKey &key) const
10{
11 for (const int i : this->inputs.index_range()) {
12 const Item &item = this->inputs[i];
13 if (item.key.matches(key)) {
14 return i;
15 }
16 }
17 return std::nullopt;
18}
19
20std::optional<int> ClosureSignature::find_output_index(const SocketInterfaceKey &key) const
21{
22 for (const int i : this->outputs.index_range()) {
23 const Item &item = this->outputs[i];
24 if (item.key.matches(key)) {
25 return i;
26 }
27 }
28 return std::nullopt;
29}
30
31} // namespace blender::nodes
std::optional< int > find_input_index(const SocketInterfaceKey &key) const
std::optional< int > find_output_index(const SocketInterfaceKey &key) const
bool matches(const SocketInterfaceKey &other) const
i
Definition text_draw.cc:230