blender: make progress report work consistent

This commit is contained in:
2019-07-03 14:14:30 +02:00
parent 5e6f3d243b
commit 416f5aef69
2 changed files with 45 additions and 16 deletions

View File

@@ -31,7 +31,19 @@ class Library(object):
return (coord[0] * fact, coord[1] * fact)
def link_refs(self, progress_callback=None):
def link_refs(self, root, progress_callback=None):
for ref in root.references:
if isinstance(ref.structure, str):
try:
element.structure = self.structures[ref.structure]
except KeyError:
err = LinkError("dangeling sref (structure {} is not defined in library)".format(ref.structure))
err.element = root
raise err
return root
def link_all_refs(self, progress_callback=None):
class Progress(ProgressGetter):
total = 0
current = 0