We need a replacement for BAM, as it's bloated (webserver, just to name one thing) and written in an overly complex way. In this ticket I propose BAT 🦇, the Blender Asset Tracer.
- Layered structure, so that tracing dependencies, copying files, rewriting links, and changing variations (which are all done in a single function in BAM) should be in separate bits of code. The caller should be able to use just one of those.
- Callable from Python. The current BAM Pack functionality is hard to call directly from Python, so in the Blender Cloud add-on I actually call the CLI interface as a subprocess.
- Use pathlib.Path to represent paths, rather than byte strings.
- CLI entry points only as callables defined as entry points in setup.py, no directy executing of Python scripts. Current BAM has a mixture of a top-level Python file, files in subpackages that can be run as CLI when they are executed directly, and __main__.py files that allow python -m bam.pack.
- Unit tested using py.test, rather than hand-writing a custom test runner.
- Trace & report dependencies: for each dependency, report which datablock in which file requires it.
- Generator-based approach. This makes it possible to report dependencies without having to maintain an in-memory list of all of them.
- Filter reported dependencies: for example, skip Alembic files that are on /shared.
- "Action Collector", which collects descriptions of copy actions that should be performed on assets:
- While tracing the dependencies we can store the copy-actions ("copy file A to location B and update reverse dependencies").
- When tracing is done, the Action Collector can go over the assets to be copied, and either point you to the original asset (if it doesn't require rewriting) or a temporary copy (if it did require rewriting).
- It's up to the caller of the Action Collector to determine what should happen with those files (copy to a directory on the local filesystem, upload to S3 storage, FTP somewhere, etc.)
- Data obtained by the Tracer might be shared with the Action Collector (uncompressed blend files, data block information of the blend file, etc.) to prevent analyzing the same blend file multiple times.
maintained or added
- BAT🦇 Pack: copying a blend file with all of its dependencies to another location. Paths to dependencies are updated to point to the correct location. This is a core feature of BAM that's used a lot, and thus will be implemented in BAT too.
- List dependencies: similar as creating the BAT Pack, but without copying of files.
- Path remapping. For those who don't know this part of BAM, it's where you say "remap start", then move some assets around, then say "remap end", and BAM will detect which assets moved where, and update any blend file that refers to it. Apparently this has saved a few productions in the past ;-)
removed (until proven necessary)
- The entire webservice part, both client and server.
- SVN support. At the Blender Animation Studio we do use SVN, but as a tool next to BAM. BAM is never used to directly create SVN checkouts. We want to add SVN support to Flamenco at some point so that we can create render jobs with SVN checkouts, but I don't think this belongs in BAT.
- Overrides. At this moment we don't use them at the BAM level. I think an override / asset switching system would be nice, but (at least from what I understand of the functionality) would make more sense inside Blender itself so that the artists see what they're doing.