refactor: remove asserts()

This commit is contained in:
Swann Martinez 2019-10-10 18:17:54 +02:00
parent d293b36f1e
commit b3ba76614a
No known key found for this signature in database
GPG Key ID: 414CCAFD8DA720E1
13 changed files with 7 additions and 19 deletions

View File

@ -46,8 +46,7 @@ class BlCamera(BlDatablock):
return dumper.dump(pointer)
def resolve(self):
assert(self.data)
self.pointer = bpy.data.cameras.get(self.data['name'])
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.cameras)
def is_valid(self):
return bpy.data.cameras.get(self.data['name'])

View File

@ -46,8 +46,7 @@ class BlCurve(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = bpy.data.curves.get(self.data['name'])
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.curves)
def is_valid(self):
return bpy.data.curves.get(self.data['name'])

View File

@ -65,8 +65,7 @@ class BlGpencil(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = bpy.data.grease_pencils.get(self.data['name'])
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.grease_pencils)
def resolve_dependencies(self):
deps = []

View File

@ -59,8 +59,7 @@ class BlImage(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = bpy.data.images.get(self.data['name'])
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.images)
def diff(self):
return False

View File

@ -18,8 +18,7 @@ class BlLibrary(BlDatablock):
return utils.dump_datablock(pointer, 1)
def resolve(self):
assert(self.data)
self.pointer = bpy.data.libraries.get(self.data['name'])
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.libraries)
# def diff(self):
# return (self.bl_diff())

View File

@ -40,7 +40,6 @@ class BlLight(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = bpy.data.lights.get(self.data['name'])
def is_valid(self):

View File

@ -127,7 +127,6 @@ class BlMaterial(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = bpy.data.materials.get(self.data['name'])
def resolve_dependencies(self):

View File

@ -155,7 +155,6 @@ class BlMesh(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.meshes)
# self.pointer = bpy.data.meshes.get(self.data['name'])

View File

@ -27,7 +27,6 @@ class BlMetaball(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = bpy.data.metaballs.get(self.data['name'])
def is_valid(self):

View File

@ -96,7 +96,6 @@ class BlObject(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.objects)
# object_name = self.data['name']
# try:

View File

@ -55,7 +55,6 @@ class BlScene(BlDatablock):
return data
def resolve(self):
assert(self.data)
scene_name = self.data['name']
self.pointer = bpy.data.scenes.get(scene_name)

View File

@ -84,8 +84,7 @@ class BlWorld(BlDatablock):
return data
def resolve(self):
assert(self.data)
self.pointer = bpy.data.worlds.get(self.data['name'])
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.worlds)
def resolve_dependencies(self):
deps = []

@ -1 +1 @@
Subproject commit 63abb5584fff5f43a313af60ce40953cae72f522
Subproject commit e5fa814ef5bc6f9a5987879e06cdd0a33f8f23d6