Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for importing old Audio Target components. #301

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions addons/io_hubs_addon/components/definitions/audio_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ..ui import add_link_indicator
from bpy.types import Object
from ...utils import delayed_gather
from ...io.utils import import_component, assign_property
from .audio_source import AudioSource


Expand Down Expand Up @@ -175,3 +176,13 @@ def gather(self, export_settings, object):
'minDelay': self.minDelay,
'debug': self.debug
}

@classmethod
def gather_import(cls, gltf, blender_host, component_name, component_value, import_report, blender_ob=None):
component = import_component(component_name, blender_host)
for property_name, property_value in component_value.items():
if property_name == "srcNode" and type(property_value) is int:
# This srcNode property was generated from an older version of the exporter which stored the index directly as an integer.
property_value = {"__mhc_link_type": "node", "index": property_value}
assign_property(gltf.vnodes, component,
property_name, property_value)
Loading