Support Alembic files from linked library

We already supported Alembic files in the top-level blend file, but now we
also support finding Alembic files in linked-in libraries.
This commit is contained in:
Sybren A. Stüvel
2019-03-20 13:57:44 +01:00
parent c718fb3a41
commit 4964745dee
12 changed files with 42 additions and 3 deletions
+10 -1
View File
@@ -51,8 +51,17 @@ def deps(bfilepath: pathlib.Path, progress_cb: typing.Optional[progress.Callback
if progress_cb:
bi.progress_cb = progress_cb
# Remember which block usages we've reported already, without keeping the
# blocks themselves in memory.
seen_hashes = set() # type: typing.Set[int]
for block in asset_holding_blocks(bi.iter_blocks(bfile)):
yield from blocks2assets.iter_assets(block)
for block_usage in blocks2assets.iter_assets(block):
usage_hash = hash(block_usage)
if usage_hash in seen_hashes:
continue
seen_hashes.add(usage_hash)
yield block_usage
def asset_holding_blocks(blocks: typing.Iterable[blendfile.BlendFileBlock]) \