Browse Source

Implement suggestions:

- syntax improvements
- merge both EAX presets lists into one

Co-authored-by: Adam Johnson <AdamJohnso@gmail.com>
pull/253/head
Jrius 3 years ago
parent
commit
23d0aeb363
  1. 27
      korman/properties/modifiers/region.py
  2. 2
      korman/properties/modifiers/sound.py
  3. 2
      korman/ui/modifiers/sound.py

27
korman/properties/modifiers/region.py

@ -249,15 +249,7 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
("DRUGGED", "Drugged", ""),
("DIZZY", "Drizzy", ""),
("PSYCHOTIC", "Psychotic", ""),
("MORE", "More choices...", ""),
("CUSTOM", "Custom", "Setup your own environment")],
default="GENERIC",
options=set())
# Thicc list for annoying users.
preset_more = EnumProperty(name="More Environment Preset",
description="Some more environment presets for your convenience",
items=[("CASTLE_SMALLROOM", "Castle - Small room", ""),
("CASTLE_SMALLROOM", "Castle - Small room", ""),
("CASTLE_SHORTPASSAGE", "Castle - Short passage", ""),
("CASTLE_MEDIUMROOM", "Castle - Medium room", ""),
("CASTLE_LONGPASSAGE", "Castle - Long passage", ""),
@ -343,8 +335,9 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
("CITY_ABANDONED", "City - Abandoned", ""),
("DUSTYROOM", "Dusty room", ""),
("CHAPEL", "Chapel", ""),
("SMALLWATERROOM", "Small water room", "")],
default="OUTDOORS_ROLLINGPLAINS",
("SMALLWATERROOM", "Small water room", ""),
("CUSTOM", "Custom", "Setup your own environment")],
default="GENERIC",
options=set())
environment_size = FloatProperty(name="Environment Size", description="Environment Size",
@ -405,15 +398,11 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
default=250.0, min=20.0, max=1000.0,
options=set())
# Room rolloff - always at 0 in all presets, so screw it.
# room_rolloff_factor = FloatProperty(name="Room Rolloff Factor", description="Room Rolloff Factor",
# default=0.0, min=0.0, max=1.0)
flags = EnumProperty(name="Flags",
description="Reverb flags",
items=reverb_flags,
default={ "kFlagDecayTimeScale", "kFlagReflectionsScale", "kFlagReflectionsDelayScale",
"kFlagReverbScale", "kFlagReverbDelayScale", "kFlagEchoTimeScale" },
default={"kFlagDecayTimeScale", "kFlagReflectionsScale", "kFlagReflectionsDelayScale",
"kFlagReverbScale", "kFlagReverbDelayScale", "kFlagEchoTimeScale"},
options={"ENUM_FLAG"})
def export(self, exporter, bo, so):
@ -445,10 +434,8 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
for flag in self.flags:
props.flags |= getattr(EAXReverbProperties, flag)
eax_listener.listenerProps = props
elif self.preset == "MORE":
eax_listener.listenerProps = getattr(EAXReverbProperties, "REVERB_PRESET_" + self.preset_more)
else:
eax_listener.listenerProps = getattr(EAXReverbProperties, "REVERB_PRESET_" + self.preset)
eax_listener.listenerProps = getattr(EAXReverbProperties, "REVERB_PRESET_{}".format(self.preset))
class PlasmaSoftVolume(idprops.IDPropMixin, PlasmaModifierProperties):

2
korman/properties/modifiers/sound.py

@ -297,7 +297,7 @@ class PlasmaSound(idprops.IDPropMixin, bpy.types.PropertyGroup):
sound.channel = plWin32Sound.kRightChannel
# Reverb/EAX
if self.sfx_type in ("kSoundFX", "kNPCVoices") and self.reverb_amount > 0:
if self.sfx_type in {"kSoundFX", "kNPCVoices"} and self.reverb_amount > 0:
eax = sound.eaxSettings
eax.enable = True
# Occlusion: the minimum is -100 dB (but the value is multiplied by 100 in EAX's API)

2
korman/ui/modifiers/sound.py

@ -83,7 +83,7 @@ def soundemit(modifier, layout, context):
col.separator()
_draw_fade_ui(sound.fade_out, col, "Fade Out:")
if sound.sfx_type in ("kSoundFX", "kNPCVoices"):
if sound.sfx_type in {"kSoundFX", "kNPCVoices"}:
col.separator()
col.prop(sound, "reverb_amount", text="Reverb Amount")

Loading…
Cancel
Save