Future of blendfile.py

Hi!
Not sure if this is the right place to ask this, sorry if it’s not.
I noticed blendfile.py is not included in blender 3.0 or 3.1, and also noticed it doesn’t seem to be able to read compressed blends saved in 3.0+. My addon was relying on it for some operations, so I’m wondering if I should move to a different solution or try to update it myself or is it expected for it to be updated at some point?

dont know anythign of blendfile.py but blender 3.0 compressed files cant be read in past versions because of new algorythm of compresion afaik

1 Like

Thanks! Yes, it’s surely that. I was hoping maybe blendfile could be updated to be able to read the new compression format but I think it’s probably abandoned.

Can you decompress it using the zstd command-line tool, like existing files can be decompressed with gzip?

By the way, I think there is a bug in the recognition of the zstd compression: these lines

uint32_t magic = *((uint32_t *)header);
if (magic == 0xFD2FB528) {
    return true;
}
if ((magic >> 4) == 0x184D2A5) {
    return true;
}

do not take endianness into account. Compare the gzip signature recognition just above

return header[0] == 0x1f && header[1] == 0x8b && header[2] == 0x08;

which is careful to check the byte values in the right order, regardless of endianness.

I have updated my blendhack encoder/decoder to offer zstd compression where available. This framework tries to completely decode the contents of the .blend file, which may be a bit more than you want.

1 Like