After a while, any long-running project gathers a lot of cruft. For example, texture images that were tried once but were discarded in favor of better ones. This script will help us retain a bit of order by finding all files in a selected directory that are not referenced by our
.blend file and packing them into a ZIP archiveï»¿.
We will take care not to move any
.blend files to the ZIP archive (after all, those we normally want to be able to render) nor the ZIP archive itself (to prevent endless recursion). Any file that we archive we subsequently try to remove, and if removing a file leaves an empty directory, we remove that directory as well unless it is the directory our
.blend file resides in.
The file ...