From 9915fa83e1ae53991348bd20f17cb6f9f3b482fa Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Mon, 14 Oct 2019 13:40:41 +0200 Subject: [PATCH] fix: repair broken linked objects --- multi_user/bl_types/bl_datablock.py | 3 ++- multi_user/bl_types/bl_library.py | 3 --- multi_user/bl_types/bl_object.py | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/multi_user/bl_types/bl_datablock.py b/multi_user/bl_types/bl_datablock.py index 9824212..0e22e68 100644 --- a/multi_user/bl_types/bl_datablock.py +++ b/multi_user/bl_types/bl_datablock.py @@ -20,7 +20,8 @@ class BlDatablock(ReplicatedDatablock): self.load = self.load_library self.dump = self.dump_library self.diff = self.diff_library - + self.resolve_dependencies = self.resolve_dependencies_library + if self.pointer and hasattr(self.pointer, 'uuid'): self.pointer.uuid = self.uuid diff --git a/multi_user/bl_types/bl_library.py b/multi_user/bl_types/bl_library.py index 49107ab..219cbcb 100644 --- a/multi_user/bl_types/bl_library.py +++ b/multi_user/bl_types/bl_library.py @@ -20,9 +20,6 @@ class BlLibrary(BlDatablock): def resolve(self): self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.libraries) - # def diff(self): - # return (self.bl_diff()) - def is_valid(self): return bpy.data.libraries.get(self.data['name']) diff --git a/multi_user/bl_types/bl_object.py b/multi_user/bl_types/bl_object.py index d5b2100..f9c2da5 100644 --- a/multi_user/bl_types/bl_object.py +++ b/multi_user/bl_types/bl_object.py @@ -13,8 +13,10 @@ class BlObject(BlDatablock): with bpy.data.libraries.load(filepath=bpy.data.libraries[self.data['library']].filepath, link=True) as (sourceData, targetData): targetData.objects = [ name for name in sourceData.objects if name == self.data['name']] - - return targetData.objects[self.data['name']] + + instance = bpy.data.objects[self.data['name']] + instance.uuid = self.uuid + return instance # Object specific constructor... if "data" not in data: