From 6cabd9bb64882abc3105871bc480b132df8db95c Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 12 Jul 2015 18:39:17 -0400 Subject: [PATCH] Replace _finalize_message in ResponderCommandNode It was silly, and this is Python. Function calls are our enemy, after all... --- korman/nodes/node_messages.py | 1 + korman/nodes/node_responder.py | 17 +++-------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/korman/nodes/node_messages.py b/korman/nodes/node_messages.py index a27569f..e359396 100644 --- a/korman/nodes/node_messages.py +++ b/korman/nodes/node_messages.py @@ -341,5 +341,6 @@ class PlasmaFootstepSoundMsgNode(PlasmaMessageNode, bpy.types.Node): def convert_message(self, exporter, tree, so): msg = plArmatureEffectStateMsg() + msg.BCastFlags |= (plMessage.kPropagateToModifiers | plMessage.kNetPropagate) msg.surface = footstep_surface_ids[self.surface] return msg diff --git a/korman/nodes/node_responder.py b/korman/nodes/node_responder.py index 7548790..54014d7 100644 --- a/korman/nodes/node_responder.py +++ b/korman/nodes/node_responder.py @@ -189,7 +189,9 @@ class PlasmaResponderCommandNode(PlasmaNodeBase, bpy.types.Node): # Finally, convert our message... msg = msgNode.convert_message(exporter, tree, so) - self._finalize_message(exporter, responder, msg) + if msg.sender is None: + msg.sender = responder.key + msg.BCastFlags |= plMessage.kLocalPropagate # If we have child commands, we need to make sure that we support chaining this message as a callback # If not, we'll export our children and tell them to not actually wait on us. @@ -207,19 +209,6 @@ class PlasmaResponderCommandNode(PlasmaNodeBase, bpy.types.Node): for i in self.find_outputs("trigger", "PlasmaResponderCommandNode"): i.convert_command(exporter, tree, so, responder, commandMgr, childWaitOn) - _bcast_flags = { - plArmatureEffectStateMsg: (plMessage.kPropagateToModifiers | plMessage.kNetPropagate), - } - - def _finalize_message(self, exporter, responder, msg): - msg.sender = responder.key - - # BCast Flags are pretty common... - _cls = msg.__class__ - if _cls in self._bcast_flags: - msg.BCastFlags = self._bcast_flags[_cls] - msg.BCastFlags |= plMessage.kLocalPropagate - class PlasmaRespCommandSocket(PlasmaNodeSocketBase, bpy.types.NodeSocket): bl_color = (0.451, 0.0, 0.263, 1.0)