Normalize unused paths in packed linked blends

This commit is contained in:
2026-09-10 15:36:30 +02:00
parent 89bcad5cdc
commit 8bc8165642
3 changed files with 126 additions and 2 deletions
+12
View File
@@ -68,6 +68,18 @@ def deps(
yield block_usage
def local_deps(bfilepath: pathlib.Path) -> typing.Iterator[result.BlockUsage]:
"""Report assets from every local block, without following libraries.
This is used for path-only normalization of linked blend files that are
copied whole into a pack. Unlike :func:`deps`, it deliberately inspects
unused datablocks too, but does not recursively collect their assets.
"""
bfile = blendfile.open_cached(bfilepath)
for block in asset_holding_blocks(bfile.blocks):
yield from blocks2assets.iter_assets(block)
def asset_holding_blocks(
blocks: typing.Iterable[blendfile.BlendFileBlock],
) -> typing.Iterator[blendfile.BlendFileBlock]: