Skip to content

Commit

Permalink
fix(shape node): Fix merge group and skinned mesh export
Browse files Browse the repository at this point in the history
Fix a regression introduced in fbec170, which renamed the `ShapeNode` constructor parameter `mesh_object` to `shape_object` without updating the super class constructor call for merge groups and skinned meshes.
  • Loading branch information
LKAMinco authored Nov 27, 2023
1 parent 54be34a commit 4ed9d82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addon/i3dio/node_classes/merge_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, id_: int, merge_group_object: [bpy.types.Object, None], i3d:
parent: [SceneGraphNode or None] = None):
self.merge_group_name = i3d.merge_groups[merge_group_object.i3d_merge_group_index].name
self.skin_bind_ids = f"{id_:d} "
super().__init__(id_=id_, mesh_object=merge_group_object, i3d=i3d, parent=parent)
super().__init__(id_=id_, shape_object=merge_group_object, i3d=i3d, parent=parent)

# Override default shape behaviour to use the merge group mesh name instead of the blender objects name
def add_shape(self):
Expand Down
4 changes: 3 additions & 1 deletion addon/i3dio/node_classes/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ def _write_user_attributes(self):
pass

def _add_reference_file(self):
if self.blender_object.i3d_reference_path == "" or not self.blender_object.i3d_reference_path.endswith('.i3d'):
if 'i3d_reference_path' not in self.blender_object.keys():
return
elif self.blender_object.i3d_reference_path == "" or not self.blender_object.i3d_reference_path.endswith('.i3d'):
return
self.logger.debug(f"Adding reference file")
file_id = self.i3d.add_file_reference(self.blender_object.i3d_reference_path)
Expand Down
2 changes: 1 addition & 1 deletion addon/i3dio/node_classes/skinned_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, id_: int, skinned_mesh_object: bpy.types.Object, i3d: I3D,
if modifier.type == 'ARMATURE':
self.armature_nodes.append(i3d.add_armature(modifier.object))
self.bone_mapping = ChainMap(*[armature.bone_mapping for armature in self.armature_nodes])
super().__init__(id_=id_, mesh_object=skinned_mesh_object, i3d=i3d, parent=parent)
super().__init__(id_=id_, shape_object=skinned_mesh_object, i3d=i3d, parent=parent)

def add_shape(self):
# Use a ChainMap to easily combine multiple bone mappings and get around any problems with multiple bones
Expand Down

0 comments on commit 4ed9d82

Please sign in to comment.