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>2021-06-11 15:54:44 +0300
committerJacques Lucke <jacques@blender.org>2021-06-11 15:55:10 +0300
commitfe22635bf664af844933695ba3a0d79a01807818 (patch)
tree3a63201a119dfdc79d3627708c6408881ca74ff1 /source/blender/nodes/intern/derived_node_tree.cc
parentc0367b19e20e7bd7ffe25588dee6466c1a8157e8 (diff)
Nodes: add utilities to check if there are undefined nodes/sockets
Diffstat (limited to 'source/blender/nodes/intern/derived_node_tree.cc')
-rw-r--r--source/blender/nodes/intern/derived_node_tree.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/derived_node_tree.cc b/source/blender/nodes/intern/derived_node_tree.cc
index cfa790780f2..9a3eb574bcd 100644
--- a/source/blender/nodes/intern/derived_node_tree.cc
+++ b/source/blender/nodes/intern/derived_node_tree.cc
@@ -84,6 +84,16 @@ bool DerivedNodeTree::has_link_cycles() const
return false;
}
+bool DerivedNodeTree::has_undefined_nodes_or_sockets() const
+{
+ for (const NodeTreeRef *tree_ref : used_node_tree_refs_) {
+ if (tree_ref->has_undefined_nodes_or_sockets()) {
+ return true;
+ }
+ }
+ return false;
+}
+
/* Calls the given callback on all nodes in the (possibly nested) derived node tree. */
void DerivedNodeTree::foreach_node(FunctionRef<void(DNode)> callback) const
{