diff --git a/source/blender/blenkernel/BKE_node_runtime.hh b/source/blender/blenkernel/BKE_node_runtime.hh index 802410c464f..b28dd2c15c6 100644 --- a/source/blender/blenkernel/BKE_node_runtime.hh +++ b/source/blender/blenkernel/BKE_node_runtime.hh @@ -822,6 +822,11 @@ inline bool bNode::is_group_output() const return this->type_legacy == NODE_GROUP_OUTPUT; } +inline bool bNode::is_undefined() const +{ + return this->typeinfo == &blender::bke::NodeTypeUndefined; +} + inline bool bNode::is_type(const blender::StringRef query_idname) const { return this->typeinfo->is_type(query_idname); diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 175d10a1ff9..74a1643937e 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -492,6 +492,7 @@ typedef struct bNode { bool is_group() const; bool is_group_input() const; bool is_group_output() const; + bool is_undefined() const; /** * Check if the node has the given idname. diff --git a/source/blender/nodes/intern/socket_usage_inference.cc b/source/blender/nodes/intern/socket_usage_inference.cc index 4862fb5bdb2..6103f227bb9 100644 --- a/source/blender/nodes/intern/socket_usage_inference.cc +++ b/source/blender/nodes/intern/socket_usage_inference.cc @@ -148,6 +148,10 @@ struct SocketUsageInferencer { if (all_socket_usages_.contains(socket)) { return; } + if (socket->owner_node().is_undefined()) { + all_socket_usages_.add_new(socket, false); + return; + } if (socket->is_input()) { this->usage_task__input(socket); } @@ -481,6 +485,10 @@ struct SocketUsageInferencer { /* Task is done already. */ return; } + if (socket->owner_node().is_undefined()) { + all_socket_values_.add_new(socket, nullptr); + return; + } const CPPType *base_type = socket->typeinfo->base_cpp_type; if (!base_type) { /* The socket type is unknown for some reason (maybe a socket type from the future?).*/