Allow aborting a pack operation.
For this to work well I also had to remove the sorting of blocks in trace.deps(). The sorting caused the first `yield` to be executed only after each blend file was opened, which means that the consuming for-loop takes a long time to hit its first iteration. As a result, it would respond slowly to abort requests. By not sorting the first `yield` is much sooner, resolving this issue.
This commit is contained in:
@@ -32,10 +32,7 @@ def deps(bfilepath: pathlib.Path, progress_cb: typing.Optional[progress.Callback
|
||||
if progress_cb:
|
||||
bi.progress_cb = progress_cb
|
||||
|
||||
ahb = asset_holding_blocks(bi.iter_blocks(bfile))
|
||||
# Sort the asset-holding blocks so that we can iterate over them
|
||||
# in disk order, which is slightly faster than random order.
|
||||
for block in sorted(ahb):
|
||||
for block in asset_holding_blocks(bi.iter_blocks(bfile)):
|
||||
yield from blocks2assets.iter_assets(block)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user