Browse Source

Fix Sound Message Nodes crashing the exporter. (#368)

If a sound message was being sent to a random sound modifier, the
responder tree might crash on export. This fixes that particular problem
and adds a mitigation to the responder code itself. Remember kids that,
in Python `None and True` is `None`...
pull/369/head
Adam Johnson 2 years ago committed by GitHub
parent
commit
8ebb68a98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      korman/nodes/node_messages.py
  2. 2
      korman/nodes/node_responder.py

1
korman/nodes/node_messages.py

@ -893,6 +893,7 @@ class PlasmaSoundMsgNode(idprops.IDPropObjectMixin, PlasmaMessageWithCallbacksNo
def has_callbacks(self):
if not self.is_random_sound:
return self.event != "NONE"
return False
@classmethod
def _idprop_mapping(cls):

2
korman/nodes/node_responder.py

@ -356,7 +356,7 @@ class PlasmaResponderStateNode(PlasmaNodeBase, bpy.types.Node):
"""
if node is None:
node = self
return sorted(node.find_outputs("msgs"), key=lambda x: x.has_callbacks and x.has_linked_callbacks)
return sorted(node.find_outputs("msgs"), key=lambda x: bool(x.has_callbacks and x.has_linked_callbacks))
class PlasmaRespStateSocket(PlasmaNodeSocketBase, bpy.types.NodeSocket):

Loading…
Cancel
Save