Browse Source

Merge pull request #242 from Jrius/region_sensor_receiver_fix

Region sensor: assume receiver on parent_so instead of own sceneobject
pull/243/head
Adam Johnson 4 years ago committed by GitHub
parent
commit
b4d229e761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      korman/nodes/node_conditions.py

14
korman/nodes/node_conditions.py

@ -417,14 +417,14 @@ class PlasmaVolumeSensorNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.type
enter_simple = self.find_input_socket("enter").allow
enter_settings = self.find_input("enter", "PlasmaVolumeReportNode")
if enter_simple or enter_settings is not None:
key = self._export_volume_event(exporter, region_bo, region_so, plVolumeSensorConditionalObject.kTypeEnter, enter_settings)
key = self._export_volume_event(exporter, region_bo, region_so, parent_so, plVolumeSensorConditionalObject.kTypeEnter, enter_settings)
interface.addIntfKey(key)
# Region Exits
exit_simple = self.find_input_socket("exit").allow
exit_settings = self.find_input("exit", "PlasmaVolumeReportNode")
if exit_simple or exit_settings is not None:
key = self._export_volume_event(exporter, region_bo, region_so, plVolumeSensorConditionalObject.kTypeExit, exit_settings)
key = self._export_volume_event(exporter, region_bo, region_so, parent_so, plVolumeSensorConditionalObject.kTypeExit, exit_settings)
interface.addIntfKey(key)
# Don't forget to export the physical object itself!
@ -432,21 +432,21 @@ class PlasmaVolumeSensorNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.type
member_group="kGroupDetector",
report_groups=self.report_on)
def _export_volume_event(self, exporter, bo, so, event, settings):
def _export_volume_event(self, exporter, region_bo, region_so, parent_so, event, settings):
if event == plVolumeSensorConditionalObject.kTypeEnter:
suffix = "Enter"
else:
suffix = "Exit"
logicKey = self._find_create_key(plLogicModifier, exporter, suffix=suffix, bl=bo, so=so)
logicKey = self._find_create_key(plLogicModifier, exporter, suffix=suffix, bl=region_bo, so=region_so)
logicmod = logicKey.object
logicmod.setLogicFlag(plLogicModifier.kMultiTrigger, True)
logicmod.notify = self.generate_notify_msg(exporter, so, "satisfies")
logicmod.notify = self.generate_notify_msg(exporter, parent_so, "satisfies")
# Now, the detector objects
det = self._find_create_object(plObjectInVolumeDetector, exporter, suffix=suffix, bl=bo, so=so)
det = self._find_create_object(plObjectInVolumeDetector, exporter, suffix=suffix, bl=region_bo, so=region_so)
volKey = self._find_create_key(plVolumeSensorConditionalObject, exporter, suffix=suffix, bl=bo, so=so)
volKey = self._find_create_key(plVolumeSensorConditionalObject, exporter, suffix=suffix, bl=region_bo, so=region_so)
volsens = volKey.object
volsens.type = event

Loading…
Cancel
Save