Browse Source

Add random sound check

Random sound mods mixed with local only cause problems, so we raise an error message if that happens.
pull/295/head
Patrick Dulebohn 3 years ago
parent
commit
539e274367
  1. 7
      korman/properties/modifiers/sound.py

7
korman/properties/modifiers/sound.py

@ -373,7 +373,12 @@ class PlasmaSound(idprops.IDPropMixin, bpy.types.PropertyGroup):
if self.incidental: if self.incidental:
sound.properties |= plSound.kPropIncidental sound.properties |= plSound.kPropIncidental
if self.local_only: if self.local_only:
sound.properties |= plSound.kPropLocalOnly # Local only and random sounds hate each other, so we must check for both
for i in bpy.data.objects:
if i.plasma_modifiers.random_sound:
raise ExportError("SoundEmitter '{}': cannot have local only sounds and a random sound mod.".format(self.id_data.name))
else:
sound.properties |= plSound.kPropLocalOnly
sound.dataBuffer = self._find_sound_buffer(exporter, so, wavHeader, dataSize, channel) sound.dataBuffer = self._find_sound_buffer(exporter, so, wavHeader, dataSize, channel)
# Cone effect # Cone effect

Loading…
Cancel
Save