Maniphest T93858

Zstd-compressed .blend files from external tools aren't recognized
Closed, Resolved

Assigned To
Lukas Stockner (lukasstockner97)
Authored By
Raimund Klink (Raimund58)
Dec 8 2021, 11:42 AM
Tags
  • BF Blender
  • Core
  • Blender File
Subscribers
Lukas Stockner (lukasstockner97)
Philipp Oeser (lichtwerk)
Raimund Klink (Raimund58)

Description

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

Revisions and Commits

rB Blender

Event Timeline

Raimund Klink (Raimund58) created this task.Dec 8 2021, 11:42 AM
Raimund Klink (Raimund58) updated the task description.
Raimund Klink (Raimund58) added a project: Core.Dec 8 2021, 11:51 AM
Raimund Klink (Raimund58) updated the task description.Dec 8 2021, 12:10 PM
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).Dec 8 2021, 2:50 PM

Can confirm.

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Dec 8 2021, 2:50 PM
Philipp Oeser (lichtwerk) added a project: Blender File.
Philipp Oeser (lichtwerk) updated the task description.
Grische (Grische) assigned this task to Lukas Stockner (lukasstockner97).Dec 8 2021, 3:15 PM
Raimund Klink (Raimund58) removed Lukas Stockner (lukasstockner97) as the assignee of this task.Dec 8 2021, 3:22 PM
Raimund Klink (Raimund58) added a subscriber: Lukas Stockner (lukasstockner97).

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

Philipp Oeser (lichtwerk) added a comment.Dec 8 2021, 3:53 PM

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 (lukasstockner97) claimed this task.Dec 8 2021, 11:05 PM
In T93858#1268204, @Raimund Klink (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 T93858#1268251, @Philipp Oeser (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.

Lukas Stockner (lukasstockner97) renamed this task from Blender is not opening a .blend that was compressed via zstd to Zstd-compressed .blend files from external tools aren't recognized.Dec 8 2021, 11:38 PM
Lukas Stockner (lukasstockner97) closed this task as Resolved by committing rBbe2213472f82: Fix T93858: Zstd-compressed .blend files from external tools aren't recognized.Dec 8 2021, 11:42 PM
Lukas Stockner (lukasstockner97) added a commit: rBbe2213472f82: Fix T93858: Zstd-compressed .blend files from external tools aren't recognized.
Raimund Klink (Raimund58) added a comment.Dec 9 2021, 7:18 AM

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

Philipp Oeser (lichtwerk) added a commit: rB56bd7adce74d: Fix T93858: Zstd-compressed .blend files from external tools aren't recognized.Jan 11 2022, 9:00 AM