Browse Source

Detect invalid nodes in Plasma node trees

and don't raise seemingly random AttributeErrors!
pull/94/head
Adam Johnson 7 years ago
parent
commit
43c84c41f0
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 6
      korman/nodes/node_core.py

6
korman/nodes/node_core.py

@ -299,7 +299,11 @@ class PlasmaNodeTree(bpy.types.NodeTree):
def harvest_actors(self): def harvest_actors(self):
actors = set() actors = set()
for node in self.nodes: 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 return actors
@classmethod @classmethod

Loading…
Cancel
Save