From 9dbd66204d9ef34eb9e1fd2197b08f4a294c9b7b Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 23 Oct 2019 21:58:50 -0400 Subject: [PATCH] Fix spurious responder wait generation. This fixes an issue in which responders would get "stuck" at the end if the last message had callbacks AND the responder was not attached to a Python node. --- korman/nodes/node_responder.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/korman/nodes/node_responder.py b/korman/nodes/node_responder.py index 3edf068..a79c9b8 100644 --- a/korman/nodes/node_responder.py +++ b/korman/nodes/node_responder.py @@ -263,12 +263,9 @@ class PlasmaResponderStateNode(PlasmaNodeBase, bpy.types.Node): def add_waitable_node(self, node): self.waitable_nodes.append(node) - def ensure_last_wait(self, exporter, so, force=False): + def ensure_last_wait(self, exporter, so): if self.waitable_nodes: - lastWaitNode = self.waitable_nodes[-1] - lastMsgNode = self.commands[-1][0] - if lastMsgNode == lastWaitNode or force: - return self.find_create_wait(exporter, so, lastWaitNode) + return self.find_create_wait(exporter, so, self.waitable_nodes[-1]) return -1 def find_create_wait(self, exporter, so, node): @@ -298,7 +295,8 @@ class PlasmaResponderStateNode(PlasmaNodeBase, bpy.types.Node): # Imaging a responder that sends only one animation command message, for example. # That means a wait will not be set up for that command due to no child linkage. # However, the PFM notification below expects a wait for stuff like that. - lastWait = commands.ensure_last_wait(exporter, so, force=stateMgr.has_pfm) + if stateMgr.has_pfm: + lastWait = commands.ensure_last_wait(exporter, so) # This commits the responder commands to the responder. Needs to happen before we # add the PFM notification directly to the responder.