# Can I save blend files with lzma instead of gzip?

I compiled blender with Lzma on, but when I check "compress file" while saving, it currently compresses with gzip (zlib).

Is there a special compile option to change it? Or can I do a save script in python that compress/decompress to/from lzma (without writing to the HDD).

I'm working on very big files and Lzma2 (tested by compressing to .xz with linux) is between 2x and 3x smaller and not much slower because multi threaded.

The GZIP compression is currently the only compression format considered when writing or reading a .blend file. A single reference to LZMA in Blender's code is for compressing point-cache files, with accompanying caveat:

"Effective but slow compression"


... something we wouldn't consider as primary choice, for dealing with potentially large .blend files.

I think your best bet is to write export/import operators, utilizing external LZMA (de)compressor.

• Some kind of operator would only work for single blend files, you couldn't library link to them for example. so it can work but it would be limited. – ideasman42 Aug 31 '13 at 18:54
• The official doc of Python says 3.3 includes lzma2. But yes, it wouldn't work for linking. – matali Sep 1 '13 at 9:55
• @ideasman42 With the new improvements made to the sculpt system, it's not hard to have 600MB uncompressed files. One of my scultp was compressed down to 90MB from 750MB with LZMA against 250MB with Gzip and LZMA was faster with 8 threads than gzip (monothread). 4cores with HT are not that rare either amongst the community I think. LZMA is already in Blender's code, so maybe let the user decide in the options ? – matali Sep 1 '13 at 10:01
• @matali, Of course other options can always be added, good to know it can be threaded, but currently its not supported (which is the answer to your question). – ideasman42 Sep 1 '13 at 11:58
• @Ideasman42 Thanks for your answer, it was not a feature request, more a feedback on today's new use cases and the problems they bring. – matali Sep 1 '13 at 19:24

No, blend file compression is currently limited to gzip.

LZMA support is only for pointcache compression. If this is needed, I'd suggest looking into using a file-system that supports compression (such as Btrfs).

• Good solution in some time maybe, but today, it seems to be pretty unstable. I use it mainly for Hires sculpt which take lot of time. It would be rather annoying to loose many hours/days of work. – matali Sep 1 '13 at 9:54
• I've had no problems using Btrfs, if you want a less actively developed file-system see the list on wikipedia. Of course for important information making backups is a must. – Aldrik Sep 1 '13 at 14:40