refactor: cleanup
This commit is contained in:
@ -38,12 +38,10 @@ class BlCollection(BlDatablock):
|
|||||||
name for name in sourceData.collections if name == self.data['name']]
|
name for name in sourceData.collections if name == self.data['name']]
|
||||||
|
|
||||||
instance = bpy.data.collections[self.data['name']]
|
instance = bpy.data.collections[self.data['name']]
|
||||||
instance.uuid = self.uuid
|
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
instance = bpy.data.collections.new(data["name"])
|
instance = bpy.data.collections.new(data["name"])
|
||||||
instance.uuid = self.uuid
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
def _load_implementation(self, data, target):
|
def _load_implementation(self, data, target):
|
||||||
@ -80,7 +78,7 @@ class BlCollection(BlDatablock):
|
|||||||
collection_objects = []
|
collection_objects = []
|
||||||
for object in pointer.objects:
|
for object in pointer.objects:
|
||||||
if object not in collection_objects:
|
if object not in collection_objects:
|
||||||
collection_objects.append(object.uuid)
|
collection_objects.append(object.name)
|
||||||
|
|
||||||
data['objects'] = collection_objects
|
data['objects'] = collection_objects
|
||||||
|
|
||||||
@ -88,7 +86,7 @@ class BlCollection(BlDatablock):
|
|||||||
collection_children = []
|
collection_children = []
|
||||||
for child in pointer.children:
|
for child in pointer.children:
|
||||||
if child not in collection_children:
|
if child not in collection_children:
|
||||||
collection_children.append(child.uuid)
|
collection_children.append(child.name)
|
||||||
|
|
||||||
data['children'] = collection_children
|
data['children'] = collection_children
|
||||||
|
|
||||||
|
@ -33,15 +33,15 @@ class BlLattice(BlDatablock):
|
|||||||
bl_automatic_push = True
|
bl_automatic_push = True
|
||||||
bl_icon = 'LATTICE_DATA'
|
bl_icon = 'LATTICE_DATA'
|
||||||
|
|
||||||
|
def _construct(self, data):
|
||||||
|
return bpy.data.lattices.new(data["name"])
|
||||||
|
|
||||||
def _load_implementation(self, data, target):
|
def _load_implementation(self, data, target):
|
||||||
loader = Loader()
|
loader = Loader()
|
||||||
loader.load(target, data)
|
loader.load(target, data)
|
||||||
|
|
||||||
np_load_collection(data['points'], target.points, POINT)
|
np_load_collection(data['points'], target.points, POINT)
|
||||||
|
|
||||||
def _construct(self, data):
|
|
||||||
return bpy.data.lattices.new(data["name"])
|
|
||||||
|
|
||||||
def _dump_implementation(self, data, pointer=None):
|
def _dump_implementation(self, data, pointer=None):
|
||||||
assert(pointer)
|
assert(pointer)
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ class BlScene(BlDatablock):
|
|||||||
|
|
||||||
def _construct(self, data):
|
def _construct(self, data):
|
||||||
instance = bpy.data.scenes.new(data["name"])
|
instance = bpy.data.scenes.new(data["name"])
|
||||||
instance.uuid = self.uuid
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
def _load_implementation(self, data, target):
|
def _load_implementation(self, data, target):
|
||||||
|
Reference in New Issue
Block a user