diff --git a/bl_types/bl_camera.py b/bl_types/bl_camera.py index 5a4cf8d..53c2184 100644 --- a/bl_types/bl_camera.py +++ b/bl_types/bl_camera.py @@ -21,7 +21,11 @@ class BlCamera(ReplicatedDatablock): assert(pointer) return utils.dump_datablock(pointer, 1) - + + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.cameras.get(self.buffer['name']) + bl_id = "cameras" bl_class = bpy.types.Camera bl_rep_class = BlCamera diff --git a/bl_types/bl_collection.py b/bl_types/bl_collection.py index d46d0b3..eb7e7f1 100644 --- a/bl_types/bl_collection.py +++ b/bl_types/bl_collection.py @@ -46,6 +46,9 @@ class BlCollection(ReplicatedDatablock): assert(pointer) return utils.dump_datablock(pointer, 4) + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.collections.get(self.buffer['name']) bl_id = "collections" bl_class = bpy.types.Collection diff --git a/bl_types/bl_curve.py b/bl_types/bl_curve.py index f64fade..f29a6f6 100644 --- a/bl_types/bl_curve.py +++ b/bl_types/bl_curve.py @@ -36,7 +36,6 @@ class BlCurve(ReplicatedDatablock): utils.dump_anything.load( new_spline.points[point_index], data['splines'][spline]["points"][point_index]) - def dump(self, pointer=None): assert(pointer) data = utils.dump_datablock(pointer, 1) @@ -44,6 +43,10 @@ class BlCurve(ReplicatedDatablock): pointer, ['splines'], 5, data) return data + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.curves.get(self.buffer['name']) + bl_id = "curves" bl_class = bpy.types.Curve bl_rep_class = BlCurve diff --git a/bl_types/bl_gpencil.py b/bl_types/bl_gpencil.py index b55669b..4ce4952 100644 --- a/bl_types/bl_gpencil.py +++ b/bl_types/bl_gpencil.py @@ -67,6 +67,10 @@ class BlGpencil(ReplicatedDatablock): utils.dump_datablock_attibutes( pointer, ['layers'], 9, data) return data + + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.grease_pencils.get(self.buffer['name']) bl_id = "grease_pencils" bl_class = bpy.types.GreasePencil diff --git a/bl_types/bl_image.py b/bl_types/bl_image.py index f36ba49..7a4ab6c 100644 --- a/bl_types/bl_image.py +++ b/bl_types/bl_image.py @@ -44,6 +44,10 @@ class BlImage(ReplicatedDatablock): 2, data) return data + + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.images.get(self.buffer['name']) bl_id = "images" bl_class = bpy.types.Image diff --git a/bl_types/bl_light.py b/bl_types/bl_light.py index 821885f..6129a3e 100644 --- a/bl_types/bl_light.py +++ b/bl_types/bl_light.py @@ -21,7 +21,11 @@ class BlLight(ReplicatedDatablock): assert(pointer) return utils.dump_datablock(pointer, 3) - + + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.lights.get(self.buffer['name']) + bl_id = "lights" bl_class = bpy.types.Light bl_rep_class = BlLight diff --git a/bl_types/bl_material.py b/bl_types/bl_material.py index 86c7c8f..cc05a2d 100644 --- a/bl_types/bl_material.py +++ b/bl_types/bl_material.py @@ -76,6 +76,10 @@ class BlMaterial(ReplicatedDatablock): elif pointer.grease_pencil: utils.dump_datablock_attibutes(pointer, ["grease_pencil"], 3, data) return data + + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.materials.get(self.buffer['name']) bl_id = "materials" bl_class = bpy.types.Material diff --git a/bl_types/bl_mesh.py b/bl_types/bl_mesh.py index aca6ed5..28c40ea 100644 --- a/bl_types/bl_mesh.py +++ b/bl_types/bl_mesh.py @@ -158,6 +158,10 @@ class BlMesh(ReplicatedDatablock): return data + def resolve(self): + assert(self.buffer) + self.pointer = bpy.data.meshes.get(self.buffer['name']) + bl_id = "meshes" bl_class = bpy.types.Mesh bl_rep_class = BlMesh diff --git a/libs/replication b/libs/replication index dcf67a4..e10c375 160000 --- a/libs/replication +++ b/libs/replication @@ -1 +1 @@ -Subproject commit dcf67a40e32c4e7656a2cba6e4525b8113707521 +Subproject commit e10c375e3139e0d390de236d8f78cb55d14eed81 diff --git a/operators.py b/operators.py index 6164e05..bb8b971 100644 --- a/operators.py +++ b/operators.py @@ -62,10 +62,10 @@ context = None def add_datablock(datablock): global client - child=None + child=[] if hasattr(datablock,"data"): - child = add_datablock(datablock.data) + child.append(add_datablock(datablock.data)) if datablock.uuid and client.exist(datablock.uuid) : return datablock.uuid