From a93d7cb51d8d2a7bbeb0132ec56ba853c93f94bf Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Sun, 12 Sep 2021 20:09:07 -0400 Subject: [PATCH] Add Local Only Adds the "Local Only/kIsLocalOnly" property to sound emitters. Dependent on the kPropIsLocalOnly attribute, which still needs to be added to libHSPlasma. --- korman/properties/modifiers/sound.py | 6 ++++++ korman/ui/modifiers/sound.py | 1 + 2 files changed, 7 insertions(+) diff --git a/korman/properties/modifiers/sound.py b/korman/properties/modifiers/sound.py index 65c427e..3cefd7f 100644 --- a/korman/properties/modifiers/sound.py +++ b/korman/properties/modifiers/sound.py @@ -243,6 +243,10 @@ class PlasmaSound(idprops.IDPropMixin, bpy.types.PropertyGroup): description="Loop the sound", default=False, options=set()) + local_only = BoolProperty(name"Local Only", + description="Sounds only plays for local avatar", + default=False, + options=set()) inner_cone = FloatProperty(name="Inner Angle", description="Angle of the inner cone from the negative Z-axis", @@ -368,6 +372,8 @@ class PlasmaSound(idprops.IDPropMixin, bpy.types.PropertyGroup): sound.properties |= plSound.kPropLooping if self.incidental: sound.properties |= plSound.kPropIncidental + if self.local_only: + sound.properties |= plSound.kPropIsLocalOnly sound.dataBuffer = self._find_sound_buffer(exporter, so, wavHeader, dataSize, channel) # Cone effect diff --git a/korman/ui/modifiers/sound.py b/korman/ui/modifiers/sound.py index 95a7826..13d7a34 100644 --- a/korman/ui/modifiers/sound.py +++ b/korman/ui/modifiers/sound.py @@ -110,6 +110,7 @@ def soundemit(modifier, layout, context): col.prop(sound, "auto_start") col.prop(sound, "incidental") col.prop(sound, "loop") + col.prop(sound, "local_only") col.separator() _draw_fade_ui(sound.fade_in, col, "Fade In:")