Pack: always pack files, explode directories to a list of files

When an asset is represented as directory in Blender (for example fluid
simulation caches), that directory is traced and each file is considered
an asset.

This makes it considerably easier for Shaman clients, as they need to
compute the SHA256 checksum of each file. The logic to transform a
directory path to a list of the contained files is now in BAT itself.
This commit is contained in:
Sybren A. Stüvel
2023-11-02 14:53:52 +01:00
parent f9bc6f2d08
commit 606377180c
3 changed files with 32 additions and 4 deletions
+4 -1
View File
@@ -56,7 +56,10 @@ def expand_sequence(path: pathlib.Path) -> typing.Iterator[pathlib.Path]:
raise DoesNotExist(path)
if path.is_dir():
yield path
# Explode directory paths into separate files.
for subpath in path.rglob("*"):
if subpath.is_file():
yield subpath
return
log.debug("expanding file sequence %s", path)