Skip to content

Commit

Permalink
Merge pull request #275 from MozillaReality/switch-audio-params-overr…
Browse files Browse the repository at this point in the history
…ide-default-to-false

Switch the audio-params override to be disabled by default.
  • Loading branch information
keianhzo authored Apr 17, 2024
2 parents f3e5aee + cbcb44e commit 0f0532f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions addons/io_hubs_addon/components/definitions/audio_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class AudioParams(HubsComponent):
'display_name': 'Audio Params',
'node_type': NodeType.NODE,
'panel_type': [PanelType.OBJECT, PanelType.BONE],
'version': (1, 0, 0)
'version': (1, 0, 1)
}

overrideAudioSettings: BoolProperty(
name="Override Audio Settings",
description="Override Audio Settings",
default=True)
default=False)

audioType: EnumProperty(
name="Audio Type",
Expand Down Expand Up @@ -120,6 +120,11 @@ def migrate(self, migration_type, panel_type, instance_version, host, migration_
migration_report.append(
f"Warning: The Media Cone angles may not have migrated correctly for the Audio Params component on the {panel_type.value} {host_reference}")

if instance_version <= (1, 0, 0):
if self.get("overrideAudioSettings") is None:
migration_occurred = True
self.overrideAudioSettings = True

return migration_occurred

def draw(self, context, layout, panel):
Expand Down
4 changes: 4 additions & 0 deletions addons/io_hubs_addon/components/definitions/audio_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ class AudioTarget(HubsComponent):
description="Show debug visuals",
default=False)

@classmethod
def init(cls, obj):
obj.hubs_component_audio_params.overrideAudioSettings = True

def draw(self, context, layout, panel):
dep_name = AudioSource.get_name()

Expand Down
4 changes: 4 additions & 0 deletions addons/io_hubs_addon/components/definitions/audio_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def create_gizmo(cls, ob, gizmo_group):

return gizmo

@classmethod
def init(cls, obj):
obj.hubs_component_audio_params.overrideAudioSettings = True

def migrate(self, migration_type, panel_type, instance_version, host, migration_report, ob=None):
migration_occurred = False
if instance_version < (1, 0, 0):
Expand Down

0 comments on commit 0f0532f

Please sign in to comment.