Browse Source

Warn about controlling 3D Stereo sounds.

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

13
korman/nodes/node_messages.py

@ -862,6 +862,9 @@ class PlasmaSoundMsgNode(idprops.IDPropObjectMixin, PlasmaMessageWithCallbacksNo
if self.looping != "CURRENT": if self.looping != "CURRENT":
msg.setCmd(getattr(plSoundMsg, self.looping)) msg.setCmd(getattr(plSoundMsg, self.looping))
if self.action != "CURRENT": 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)) msg.setCmd(getattr(plSoundMsg, self.action))
# This used to potentially result in multiple messages. Not anymore! # This used to potentially result in multiple messages. Not anymore!
@ -886,7 +889,17 @@ class PlasmaSoundMsgNode(idprops.IDPropObjectMixin, PlasmaMessageWithCallbacksNo
if self.go_to == "TIME": if self.go_to == "TIME":
layout.prop(self, "time") layout.prop(self, "time")
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.prop(self, "action")
layout.alert = False
else:
layout.prop(self, "action")
if self.volume == "CUSTOM": if self.volume == "CUSTOM":
layout.prop(self, "volume_pct") layout.prop(self, "volume_pct")
if not random: if not random:

Loading…
Cancel
Save