WIP: Closures and deferred evaluation for geometry nodes #107842

Draft
Lukas Tönne wants to merge 35 commits from LukasTonne/blender:geometry-nodes-closures into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 9 additions and 3 deletions
Showing only changes of commit 4a2b5a30e4 - Show all commits

View File

@ -634,6 +634,13 @@ inline bool bNode::is_group_output() const
return this->type == NODE_GROUP_OUTPUT;
}
inline bool bNode::can_verify_sockets_on_read() const
{
/* Don't update node groups here because they may depend on other node groups which are not
* fully versioned yet and don't have `typeinfo` pointers set. */
return !is_group() && !ELEM(this->type, GEO_NODE_BIND_FUNCTION);
}
inline blender::Span<bNodeLink> bNode::internal_links() const
{
return this->runtime->internal_links;

View File

@ -1340,9 +1340,7 @@ void ntreeBlendReadLib(BlendLibReader *reader, bNodeTree *ntree)
* to match the static layout. */
if (!BLO_read_lib_is_undo(reader)) {
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
/* Don't update node groups here because they may depend on other node groups which are not
* fully versioned yet and don't have `typeinfo` pointers set. */
if (!node->is_group()) {
if (node->can_verify_sockets_on_read()) {
node_verify_sockets(ntree, node, false);
}
}

View File

@ -383,6 +383,7 @@ typedef struct bNode {
bool is_group() const;
bool is_group_input() const;
bool is_group_output() const;
bool can_verify_sockets_on_read() const;
const blender::nodes::NodeDeclaration *declaration() const;
/** A span containing all internal links when the node is muted. */
blender::Span<bNodeLink> internal_links() const;