Zstd-compressed .blend files from external tools aren't recognized #93858

Closed
opened 2021-12-08 11:42:34 +01:00 by Raimund Klink · 12 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.09

Blender Version
Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: blender/blender@f1cca30557
Worked:

Short description of error
Maybe you can tell me if I am doing things wrong or if I encounter a bug.
I tried to compress my .blend externally with zstd but Blender refuses to read it again. Even tho it should be supported.

The implementation here saves additional metadata into the compressed file in order to allow for efficient seeking when loading. This is standard-compliant and will be ignored by other tools that support Zstd. If the metadata is not present (e.g. because you manually compressed a .blend file with another tool), Blender will fall back to sequential reading.

D5799: Add support for Zstd compression for .blend files

Exact steps for others to reproduce the error
1: $zstd -19 my.blend
2: I rename it back from my.blend.zst to my.blend and try to open it.
3: Blender falls back to the default scene if I try to open it :(
Please note that I use WSL (Ubuntu) for the compression.

T93858_compressed_blender.blend

T93858_compressed_zstd.blend

T93858_uncompressed.blend

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.09 **Blender Version** Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `blender/blender@f1cca30557` Worked: **Short description of error** Maybe you can tell me if I am doing things wrong or if I encounter a bug. I tried to compress my .blend externally with zstd but Blender refuses to read it again. Even tho it should be supported. > The implementation here saves additional metadata into the compressed file in order to allow for efficient seeking when loading. This is standard-compliant and will be ignored by other tools that support Zstd. If the metadata is not present (e.g. because you manually compressed a .blend file with another tool), Blender will fall back to sequential reading. [D5799: Add support for Zstd compression for .blend files](https://archive.blender.org/developer/D5799) **Exact steps for others to reproduce the error** 1: $zstd -19 my.blend 2: I rename it back from my.blend.zst to my.blend and try to open it. 3: Blender falls back to the default scene if I try to open it :( Please note that I use WSL (Ubuntu) for the compression. [T93858_compressed_blender.blend](https://archive.blender.org/developer/F12710999/T93858_compressed_blender.blend) [T93858_compressed_zstd.blend](https://archive.blender.org/developer/F12711000/T93858_compressed_zstd.blend) [T93858_uncompressed.blend](https://archive.blender.org/developer/F12711001/T93858_uncompressed.blend)
Author

Added subscriber: @Raimund58

Added subscriber: @Raimund58

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk

Can confirm.

Can confirm.

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Lukas Stockner was assigned by Grische 2021-12-08 15:15:08 +01:00
Lukas Stockner was unassigned by Raimund Klink 2021-12-08 15:22:50 +01:00
Author

Added subscriber: @LukasStockner

Added subscriber: @LukasStockner
Author

Lukas is currently not active. I'm not sure if it is a good idea to assign it to him.

Lukas is currently not active. I'm not sure if it is a good idea to assign it to him.

If you compress outside of blender, the header is not kept (needs to start with "BLENDER") and this is what fails in a couple of places.

This is what is usually written at the start of a file (even if blender later uses zstd compression)

  sprintf(buf,
          "BLENDER%c%c%.3d",
          (sizeof(void *) == 8) ? '-' : '_',
          (ENDIAN_ORDER == B_ENDIAN) ? 'V' : 'v',
          BLENDER_FILE_VERSION);
If you compress outside of blender, the header is not kept (needs to start with "BLENDER") and this is what fails in a couple of places. This is what is usually written at the start of a file (even if blender later uses zstd compression) ``` sprintf(buf, "BLENDER%c%c%.3d", (sizeof(void *) == 8) ? '-' : '_', (ENDIAN_ORDER == B_ENDIAN) ? 'V' : 'v', BLENDER_FILE_VERSION); ```
Lukas Stockner self-assigned this 2021-12-08 23:05:13 +01:00

In #93858#1268204, @Raimund58 wrote:
Lukas is currently not active. I'm not sure if it is a good idea to assign it to him.

I did actually see this one, I'll have a look :)

In #93858#1268251, @lichtwerk wrote:
If you compress outside of blender, the header is not kept (needs to start with "BLENDER") and this is what fails in a couple of places.

This is what is usually written at the start of a file (even if blender later uses zstd compression)

  sprintf(buf,
          "BLENDER%c%c%.3d",
          (sizeof(void *) == 8) ? '-' : '_',
          (ENDIAN_ORDER == B_ENDIAN) ? 'V' : 'v',
          BLENDER_FILE_VERSION);

It should still work, the code is smart enough to check for the presence of that header after decompressing the start of the file.

> In #93858#1268204, @Raimund58 wrote: > Lukas is currently not active. I'm not sure if it is a good idea to assign it to him. I did actually see this one, I'll have a look :) > In #93858#1268251, @lichtwerk wrote: > If you compress outside of blender, the header is not kept (needs to start with "BLENDER") and this is what fails in a couple of places. > > This is what is usually written at the start of a file (even if blender later uses zstd compression) > > ``` > sprintf(buf, > "BLENDER%c%c%.3d", > (sizeof(void *) == 8) ? '-' : '_', > (ENDIAN_ORDER == B_ENDIAN) ? 'V' : 'v', > BLENDER_FILE_VERSION); > ``` It should still work, the code is smart enough to check for the presence of that header after decompressing the start of the file.

This issue was referenced by blender/blender@56bd7adce7

This issue was referenced by blender/blender@56bd7adce74d2601d8656decf4cccb27aee4c6e4

This issue was referenced by blender/blender@be2213472f

This issue was referenced by blender/blender@be2213472f825fab3cff61029a78954d6f079296
Lukas Stockner changed title from Blender is not opening a .blend that was compressed via zstd to Zstd-compressed .blend files from external tools aren't recognized 2021-12-08 23:38:50 +01:00

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author

Lol, there he comes out of nowhere and just fixes things :D

Lol, there he comes out of nowhere and just fixes things :D
This repo is archived. You cannot comment on issues.
No Milestone
No Assignees
4 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: archive/blender-file#93858
No description provided.