Browse Source

Warn about controlling 3D Stereo sounds.

pull/364/head
Adam Johnson 1 year ago
parent
commit
96221308c5
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 15
      korman/nodes/node_messages.py

15
korman/nodes/node_messages.py

@ -862,6 +862,9 @@ class PlasmaSoundMsgNode(idprops.IDPropObjectMixin, PlasmaMessageWithCallbacksNo
if self.looping != "CURRENT":
msg.setCmd(getattr(plSoundMsg, self.looping))
if self.action != "CURRENT":
sound = soundemit.sounds.get(self.sound_name, None)
if sound is not None and sound.is_3d_stereo:
exporter.report.warn(f"'{self.id_data.name}' Node '{self.name}': 3D Stereo sounds should not be started or stopped by messages - they may get out of sync.")
msg.setCmd(getattr(plSoundMsg, self.action))
# This used to potentially result in multiple messages. Not anymore!
@ -886,7 +889,17 @@ class PlasmaSoundMsgNode(idprops.IDPropObjectMixin, PlasmaMessageWithCallbacksNo
if self.go_to == "TIME":
layout.prop(self, "time")
layout.prop(self, "action")
if not random and self.emitter_object is not None:
soundemit = self.emitter_object.plasma_modifiers.soundemit
sound = soundemit.sounds.get(self.sound_name, None)
action_on_3d_stereo = sound is not None and sound.is_3d_stereo and self.action != "CURRENT"
layout.alert = action_on_3d_stereo
layout.prop(self, "action")
layout.alert = False
else:
layout.prop(self, "action")
if self.volume == "CUSTOM":
layout.prop(self, "volume_pct")
if not random:

Loading…
Cancel
Save