Previously, we used `SocketInterfaceKey` as identifier for bundle and closure items. It contained multiple identifiers (although only one was ever used so far). The idea was that multiple identifiers could provide more flexibility. E.g. an Evaluate Closure node could work with closures with slightly different identifier names, or a bundle could be passed into different systems that expect the same data but named differently. The added complexity by allowing for this is greater than I anticipated even though most places didn't even support multiple identifiers yet. In addition to that, it seems like there may be simpler workaround for many situations where multiple identifiers were supposed to help. E.g. one could just add the same value to a bundle twice with different names or one can build a node group that maps a bundle for one system to one for another system. Overall, the complexity of `SocketInterfaceKey` didn't seem worth it, and we can probably just build a better system when we don't allow multiple identifiers per item. Pull Request: https://projects.blender.org/blender/blender/pulls/142947
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
/* SPDX-FileCopyrightText: 2025 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include "NOD_geometry_nodes_closure.hh"
|
|
|
|
#include "NOD_geometry_nodes_lazy_function.hh"
|
|
|
|
namespace blender::nodes {
|
|
|
|
struct ClosureEagerEvalParams {
|
|
struct InputItem {
|
|
std::string key;
|
|
const bke::bNodeSocketType *type = nullptr;
|
|
/**
|
|
* The actual socket value of type bNodeSocketType::geometry_nodes_cpp_type.
|
|
* This is not const, because it may be moved from.
|
|
*/
|
|
void *value = nullptr;
|
|
};
|
|
|
|
struct OutputItem {
|
|
std::string key;
|
|
const bke::bNodeSocketType *type = nullptr;
|
|
/**
|
|
* Where the output value should be stored. This is expected to point to uninitialized memory
|
|
* when it's passed into #evaluate_closure_eagerly which will then construct the value inplace.
|
|
*/
|
|
void *value = nullptr;
|
|
};
|
|
|
|
Vector<InputItem> inputs;
|
|
Vector<OutputItem> outputs;
|
|
GeoNodesUserData *user_data = nullptr;
|
|
};
|
|
|
|
void evaluate_closure_eagerly(const Closure &closure, ClosureEagerEvalParams ¶ms);
|
|
|
|
} // namespace blender::nodes
|