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/blenkernel/BKE_node_runtime.hh
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/blenkernel/BKE_node_runtime.hh')
-rw-r--r--source/blender/blenkernel/BKE_node_runtime.hh15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_node_runtime.hh b/source/blender/blenkernel/BKE_node_runtime.hh
index c3e0460bdb1..65c801a087b 100644
--- a/source/blender/blenkernel/BKE_node_runtime.hh
+++ b/source/blender/blenkernel/BKE_node_runtime.hh
@@ -81,7 +81,7 @@ class bNodeTreeRuntime : NonCopyable, NonMovable {
Vector<bNode *> toposort_left_to_right;
Vector<bNode *> toposort_right_to_left;
Vector<bNode *> group_nodes;
- bool has_link_cycle = false;
+ bool has_available_link_cycle = false;
bool has_undefined_nodes_or_sockets = false;
bNode *group_output_node = nullptr;
};
@@ -152,8 +152,8 @@ class bNodeRuntime : NonCopyable, NonMovable {
Map<StringRefNull, bNodeSocket *> inputs_by_identifier;
Map<StringRefNull, bNodeSocket *> outputs_by_identifier;
int index_in_tree = -1;
- bool has_linked_inputs = false;
- bool has_linked_outputs = false;
+ bool has_available_linked_inputs = false;
+ bool has_available_linked_outputs = false;
bNodeTree *owner_tree = nullptr;
};
@@ -269,10 +269,10 @@ inline blender::Span<bNode *> bNodeTree::group_nodes()
return this->runtime->group_nodes;
}
-inline bool bNodeTree::has_link_cycle() const
+inline bool bNodeTree::has_available_link_cycle() const
{
BLI_assert(blender::bke::node_tree_runtime::topology_cache_is_available(*this));
- return this->runtime->has_link_cycle;
+ return this->runtime->has_available_link_cycle;
}
inline bool bNodeTree::has_undefined_nodes_or_sockets() const
@@ -455,6 +455,11 @@ inline bool bNodeLink::is_muted() const
return this->flag & NODE_LINK_MUTED;
}
+inline bool bNodeLink::is_available() const
+{
+ return this->fromsock->is_available() && this->tosock->is_available();
+}
+
/** \} */
/* -------------------------------------------------------------------- */