Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-09-20 14:21:03 +0300
committerJacques Lucke <jacques@blender.org>2022-09-20 14:21:16 +0300
commit2b4cb893e7ebb33c24c7413ba0ff10eeb78bddfe (patch)
tree54ad42003882414a851a4dcbdae1bce366ac4304 /source/blender/nodes/intern
parent22efaa2e7be9a605d6b1b043041dcbe4cb0bc969 (diff)
Fix T101214: hidden link can cause cycle in node tree
Links that are linked to unavailable sockets should be ignored.
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r--source/blender/nodes/intern/derived_node_tree.cc2
-rw-r--r--source/blender/nodes/intern/geometry_nodes_lazy_function.cc6
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/nodes/intern/derived_node_tree.cc b/source/blender/nodes/intern/derived_node_tree.cc
index e8e0f0fa61c..2ea80008af8 100644
--- a/source/blender/nodes/intern/derived_node_tree.cc
+++ b/source/blender/nodes/intern/derived_node_tree.cc
@@ -58,7 +58,7 @@ void DerivedNodeTree::destruct_context_recursively(DTreeContext *context)
bool DerivedNodeTree::has_link_cycles() const
{
for (const bNodeTree *btree : used_btrees_) {
- if (btree->has_link_cycle()) {
+ if (btree->has_available_link_cycle()) {
return true;
}
}
diff --git a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc
index af6861a59c0..718aaef5680 100644
--- a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc
+++ b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc
@@ -1044,10 +1044,10 @@ struct GeometryNodesLazyFunctionGraphBuilder {
if (link->is_muted()) {
continue;
}
- const bNodeSocket &to_bsocket = *link->tosock;
- if (!to_bsocket.is_available()) {
+ if (!link->is_available()) {
continue;
}
+ const bNodeSocket &to_bsocket = *link->tosock;
const CPPType *to_type = get_socket_cpp_type(to_bsocket);
if (to_type == nullptr) {
continue;
@@ -1258,7 +1258,7 @@ const GeometryNodesLazyFunctionGraphInfo *ensure_geometry_nodes_lazy_function_gr
const bNodeTree &btree)
{
btree.ensure_topology_cache();
- if (btree.has_link_cycle()) {
+ if (btree.has_available_link_cycle()) {
return nullptr;
}