O'Reilly logo

Blender 2.49 Scripting by Michel J. Anders

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spring cleaning—archive unused images

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required