From 2983195af4dfd7d3d7b55d55afe88bb52602a8b7 Mon Sep 17 00:00:00 2001 From: Swann Date: Tue, 26 Jan 2021 15:40:00 +0100 Subject: [PATCH] fix: objects parenting error --- multi_user/bl_types/bl_object.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/multi_user/bl_types/bl_object.py b/multi_user/bl_types/bl_object.py index 408c538..f37d86c 100644 --- a/multi_user/bl_types/bl_object.py +++ b/multi_user/bl_types/bl_object.py @@ -235,6 +235,9 @@ class BlObject(BlDatablock): and 'cycles_visibility' in data: loader.load(target.cycles_visibility, data['cycles_visibility']) + if 'parent' in data: + target.parent = bpy.data.objects[data['parent']] + def _dump_implementation(self, data, instance=None): assert(instance) @@ -251,7 +254,6 @@ class BlObject(BlDatablock): "rotation_mode", "parent", "data", - "children", "library", "empty_display_type", "empty_display_size", @@ -370,13 +372,6 @@ class BlObject(BlDatablock): bone_groups[group.name] = dumper.dump(group) data['pose']['bone_groups'] = bone_groups - # CHILDS - if len(instance.children) > 0: - childs = [] - for child in instance.children: - childs.append(child.name) - - data["children"] = childs # VERTEx GROUP if len(instance.vertex_groups) > 0: @@ -459,8 +454,8 @@ class BlObject(BlDatablock): # Avoid Empty case if self.instance.data: deps.append(self.instance.data) - if len(self.instance.children) > 0: - deps.extend(list(self.instance.children)) + if self.instance.parent : + deps.append(self.instance.parent) if self.is_library: deps.append(self.instance.library)