feat: resolve definition for each implementation
This commit is contained in:
@ -22,6 +22,10 @@ class BlCamera(ReplicatedDatablock):
|
|||||||
|
|
||||||
return utils.dump_datablock(pointer, 1)
|
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_id = "cameras"
|
||||||
bl_class = bpy.types.Camera
|
bl_class = bpy.types.Camera
|
||||||
bl_rep_class = BlCamera
|
bl_rep_class = BlCamera
|
||||||
|
@ -46,6 +46,9 @@ class BlCollection(ReplicatedDatablock):
|
|||||||
assert(pointer)
|
assert(pointer)
|
||||||
return utils.dump_datablock(pointer, 4)
|
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_id = "collections"
|
||||||
bl_class = bpy.types.Collection
|
bl_class = bpy.types.Collection
|
||||||
|
@ -36,7 +36,6 @@ class BlCurve(ReplicatedDatablock):
|
|||||||
utils.dump_anything.load(
|
utils.dump_anything.load(
|
||||||
new_spline.points[point_index], data['splines'][spline]["points"][point_index])
|
new_spline.points[point_index], data['splines'][spline]["points"][point_index])
|
||||||
|
|
||||||
|
|
||||||
def dump(self, pointer=None):
|
def dump(self, pointer=None):
|
||||||
assert(pointer)
|
assert(pointer)
|
||||||
data = utils.dump_datablock(pointer, 1)
|
data = utils.dump_datablock(pointer, 1)
|
||||||
@ -44,6 +43,10 @@ class BlCurve(ReplicatedDatablock):
|
|||||||
pointer, ['splines'], 5, data)
|
pointer, ['splines'], 5, data)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def resolve(self):
|
||||||
|
assert(self.buffer)
|
||||||
|
self.pointer = bpy.data.curves.get(self.buffer['name'])
|
||||||
|
|
||||||
bl_id = "curves"
|
bl_id = "curves"
|
||||||
bl_class = bpy.types.Curve
|
bl_class = bpy.types.Curve
|
||||||
bl_rep_class = BlCurve
|
bl_rep_class = BlCurve
|
||||||
|
@ -68,6 +68,10 @@ class BlGpencil(ReplicatedDatablock):
|
|||||||
pointer, ['layers'], 9, data)
|
pointer, ['layers'], 9, data)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def resolve(self):
|
||||||
|
assert(self.buffer)
|
||||||
|
self.pointer = bpy.data.grease_pencils.get(self.buffer['name'])
|
||||||
|
|
||||||
bl_id = "grease_pencils"
|
bl_id = "grease_pencils"
|
||||||
bl_class = bpy.types.GreasePencil
|
bl_class = bpy.types.GreasePencil
|
||||||
bl_rep_class = BlGpencil
|
bl_rep_class = BlGpencil
|
||||||
|
@ -45,6 +45,10 @@ class BlImage(ReplicatedDatablock):
|
|||||||
data)
|
data)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def resolve(self):
|
||||||
|
assert(self.buffer)
|
||||||
|
self.pointer = bpy.data.images.get(self.buffer['name'])
|
||||||
|
|
||||||
bl_id = "images"
|
bl_id = "images"
|
||||||
bl_class = bpy.types.Image
|
bl_class = bpy.types.Image
|
||||||
bl_rep_class = BlImage
|
bl_rep_class = BlImage
|
||||||
|
@ -22,6 +22,10 @@ class BlLight(ReplicatedDatablock):
|
|||||||
|
|
||||||
return utils.dump_datablock(pointer, 3)
|
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_id = "lights"
|
||||||
bl_class = bpy.types.Light
|
bl_class = bpy.types.Light
|
||||||
bl_rep_class = BlLight
|
bl_rep_class = BlLight
|
||||||
|
@ -77,6 +77,10 @@ class BlMaterial(ReplicatedDatablock):
|
|||||||
utils.dump_datablock_attibutes(pointer, ["grease_pencil"], 3, data)
|
utils.dump_datablock_attibutes(pointer, ["grease_pencil"], 3, data)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def resolve(self):
|
||||||
|
assert(self.buffer)
|
||||||
|
self.pointer = bpy.data.materials.get(self.buffer['name'])
|
||||||
|
|
||||||
bl_id = "materials"
|
bl_id = "materials"
|
||||||
bl_class = bpy.types.Material
|
bl_class = bpy.types.Material
|
||||||
bl_rep_class = BlMaterial
|
bl_rep_class = BlMaterial
|
||||||
|
@ -158,6 +158,10 @@ class BlMesh(ReplicatedDatablock):
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def resolve(self):
|
||||||
|
assert(self.buffer)
|
||||||
|
self.pointer = bpy.data.meshes.get(self.buffer['name'])
|
||||||
|
|
||||||
bl_id = "meshes"
|
bl_id = "meshes"
|
||||||
bl_class = bpy.types.Mesh
|
bl_class = bpy.types.Mesh
|
||||||
bl_rep_class = BlMesh
|
bl_rep_class = BlMesh
|
||||||
|
Submodule libs/replication updated: dcf67a40e3...e10c375e31
@ -62,10 +62,10 @@ context = None
|
|||||||
|
|
||||||
def add_datablock(datablock):
|
def add_datablock(datablock):
|
||||||
global client
|
global client
|
||||||
child=None
|
child=[]
|
||||||
|
|
||||||
if hasattr(datablock,"data"):
|
if hasattr(datablock,"data"):
|
||||||
child = add_datablock(datablock.data)
|
child.append(add_datablock(datablock.data))
|
||||||
|
|
||||||
if datablock.uuid and client.exist(datablock.uuid) :
|
if datablock.uuid and client.exist(datablock.uuid) :
|
||||||
return datablock.uuid
|
return datablock.uuid
|
||||||
|
Reference in New Issue
Block a user