Browse Source

Replace _finalize_message in ResponderCommandNode

It was silly, and this is Python. Function calls are our enemy, after
all...
pull/10/head
Adam Johnson 10 years ago
parent
commit
6cabd9bb64
  1. 1
      korman/nodes/node_messages.py
  2. 17
      korman/nodes/node_responder.py

1
korman/nodes/node_messages.py

@ -341,5 +341,6 @@ class PlasmaFootstepSoundMsgNode(PlasmaMessageNode, bpy.types.Node):
def convert_message(self, exporter, tree, so): def convert_message(self, exporter, tree, so):
msg = plArmatureEffectStateMsg() msg = plArmatureEffectStateMsg()
msg.BCastFlags |= (plMessage.kPropagateToModifiers | plMessage.kNetPropagate)
msg.surface = footstep_surface_ids[self.surface] msg.surface = footstep_surface_ids[self.surface]
return msg return msg

17
korman/nodes/node_responder.py

@ -189,7 +189,9 @@ class PlasmaResponderCommandNode(PlasmaNodeBase, bpy.types.Node):
# Finally, convert our message... # Finally, convert our message...
msg = msgNode.convert_message(exporter, tree, so) 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 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. # 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"): for i in self.find_outputs("trigger", "PlasmaResponderCommandNode"):
i.convert_command(exporter, tree, so, responder, commandMgr, childWaitOn) 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): class PlasmaRespCommandSocket(PlasmaNodeSocketBase, bpy.types.NodeSocket):
bl_color = (0.451, 0.0, 0.263, 1.0) bl_color = (0.451, 0.0, 0.263, 1.0)

Loading…
Cancel
Save