From fe49e4139cd3f78f126b60ea4240a0294eac9483 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sat, 18 Jul 2020 10:51:38 +0200 Subject: Simulation: cleanup deduplicating attribute input nodes --- source/blender/functions/FN_multi_function_network.hh | 2 ++ source/blender/functions/intern/multi_function_network.cc | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'source/blender/functions') diff --git a/source/blender/functions/FN_multi_function_network.hh b/source/blender/functions/FN_multi_function_network.hh index e47c8260057..91eb5bb65dc 100644 --- a/source/blender/functions/FN_multi_function_network.hh +++ b/source/blender/functions/FN_multi_function_network.hh @@ -233,6 +233,8 @@ class MFNetwork : NonCopyable, NonMovable { VectorSet &r_dummy_sockets, VectorSet &r_unlinked_inputs) const; + bool have_dummy_or_unlinked_dependencies(Span sockets) const; + std::string to_dot(Span marked_nodes = {}) const; }; diff --git a/source/blender/functions/intern/multi_function_network.cc b/source/blender/functions/intern/multi_function_network.cc index 11c9c065f51..1d3d3a8b5f2 100644 --- a/source/blender/functions/intern/multi_function_network.cc +++ b/source/blender/functions/intern/multi_function_network.cc @@ -269,6 +269,14 @@ void MFNetwork::find_dependencies(Span sockets, } } +bool MFNetwork::have_dummy_or_unlinked_dependencies(Span sockets) const +{ + VectorSet dummy_sockets; + VectorSet unlinked_inputs; + this->find_dependencies(sockets, dummy_sockets, unlinked_inputs); + return dummy_sockets.size() + unlinked_inputs.size() > 0; +} + std::string MFNetwork::to_dot(Span marked_nodes) const { dot::DirectedGraph digraph; -- cgit v1.2.3