Skip to content

Commit

Permalink
Add support for importing video texture/audio targets that point to b…
Browse files Browse the repository at this point in the history
…ones.
  • Loading branch information
Exairnous committed Apr 2, 2024
1 parent fa775ca commit 9cc9669
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,8 @@ def gather(self, export_settings, object):
'srcNode': gather_joint_property(export_settings, self.srcNode, self, 'bone') if self.bone_id != BLANK_ID else gather_node_property(
export_settings, object, self, 'srcNode'),
}

@classmethod
@delayed_gather
def gather_import(cls, gltf, blender_host, component_name, component_value, blender_ob=None):
super().gather_import(gltf, blender_host, component_name, component_value, blender_ob=blender_ob)
13 changes: 11 additions & 2 deletions addons/io_hubs_addon/io/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,17 @@ def assign_property(vnodes, blender_component, property_name, property_value):
if property_value.get('__mhc_link_type'):
if len(property_value) == 2:
if property_value['__mhc_link_type'] == "node":
setattr(blender_component, property_name,
vnodes[property_value['index']].blender_object)
try:
setattr(blender_component, property_name,
vnodes[property_value['index']].blender_object)
except AttributeError:
# Assume that the target is a bone
bone_vnode = vnodes[property_value['index']]
armature_vnode = vnodes[bone_vnode.bone_arma]
setattr(blender_component, property_name,
armature_vnode.blender_object)
setattr(blender_component, "bone",
bone_vnode.blender_bone_name)
elif property_value['__mhc_link_type'] == "texture":
global imported_images
blender_image_name = imported_images[property_value['index']]
Expand Down

0 comments on commit 9cc9669

Please sign in to comment.