From 43c84c41f0fdef2f417c55d404e0be9604a66548 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 1 Jan 2018 15:16:47 -0500 Subject: [PATCH] Detect invalid nodes in Plasma node trees and don't raise seemingly random AttributeErrors! --- korman/nodes/node_core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/korman/nodes/node_core.py b/korman/nodes/node_core.py index 8d16f22..4d1bb8f 100644 --- a/korman/nodes/node_core.py +++ b/korman/nodes/node_core.py @@ -299,7 +299,11 @@ class PlasmaNodeTree(bpy.types.NodeTree): def harvest_actors(self): actors = set() for node in self.nodes: - actors.update(node.harvest_actors()) + harvest_method = getattr(node, "harvest_actors", None) + if harvest_method is not None: + actors.update(harvest_method()) + elif not isinstance(node, PlasmaNodeBase): + raise ExportError("Plasma Node Tree '{}' Node '{}': is not a valid node for this tree".format(self.id_data.name, node.name)) return actors @classmethod