6
$\begingroup$

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.

$\endgroup$

2 Answers 2

6
$\begingroup$

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.

$\endgroup$
5
  • $\begingroup$ 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. $\endgroup$
    – ideasman42
    Commented Aug 31, 2013 at 18:54
  • $\begingroup$ The official doc of Python says 3.3 includes lzma2. But yes, it wouldn't work for linking. $\endgroup$
    – matali
    Commented Sep 1, 2013 at 9:55
  • $\begingroup$ @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 ? $\endgroup$
    – matali
    Commented Sep 1, 2013 at 10:01
  • $\begingroup$ @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). $\endgroup$
    – ideasman42
    Commented Sep 1, 2013 at 11:58
  • $\begingroup$ @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. $\endgroup$
    – matali
    Commented Sep 1, 2013 at 19:24
5
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – matali
    Commented Sep 1, 2013 at 9:54
  • 1
    $\begingroup$ 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. $\endgroup$
    – Aldrik
    Commented Sep 1, 2013 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .