refactor: remove dependencies

This commit is contained in:
Swann
2019-12-10 22:07:46 +01:00
parent a8d97aa43b
commit ea3c9d701b
3 changed files with 5 additions and 21 deletions

View File

@ -20,15 +20,6 @@ def load_constraints(target, data):
utils.dump_anything.load(
target_constraint, data[constraint])
def get_collection_deps(local_id, collection):
deps = []
for item in collection:
attributes = dir(item)
for attr in attributes:
attr_ref = getattr(item, attr)
if attr_ref and isinstance(attr_ref, bpy.types.Object) and attr_ref.uuid != local_id:
deps.append(attr_ref)
return deps
class BlObject(BlDatablock):
def construct(self, data):
@ -270,15 +261,6 @@ class BlObject(BlDatablock):
if self.is_library:
deps.append(self.pointer.library)
if hasattr(self.pointer, 'modifiers'):
deps.extend(get_collection_deps(self.uuid, self.pointer.modifiers))
if hasattr(self.pointer,'constraints'):
deps.extend(get_collection_deps(self.uuid, self.pointer.constraints))
if hasattr(self.pointer,'pose') and self.pointer.pose:
for b in self.pointer.pose.bones:
deps.extend(get_collection_deps(self.uuid, b.constraints))
if self.pointer.instance_type == 'COLLECTION':
# TODO: uuid based

View File

@ -61,8 +61,10 @@ class BlScene(BlDatablock):
def resolve(self):
scene_name = self.data['name']
self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.scenes)
if not self.pointer:
self.pointer = bpy.data.scenes.get(scene_name)
# self.pointer = utils.find_from_attr('uuid', self.uuid, bpy.data.objects)
def resolve_dependencies(self):
deps = []