1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/// 7-byte ASCII prefix identifying every uncompressed Blender `.blend` file.
pub const BLEND_MAGIC: & = b"BLENDER";
/// Classic Blender 2.x-4.x `.blend` file header length in bytes.
pub const BLEND_CLASSIC_HEADER_BYTES: usize = 12;
/// Blender 5.0+ large `.blend` file header length in bytes (`BLENDER17-01v0500`).
pub const BLEND_LARGE_HEADER_BYTES: usize = 17;
/// Blender 5.0+ `LargeBHead8` file block header size in bytes (`code`, `sdna_nr`, `old`, `len`, `nr`).
pub const BLEND_LARGE_BHEAD_BYTES: usize = 32;
/// Classic 64-bit `BHead8` file block header size in bytes.
pub const BLEND_CLASSIC_BHEAD8_BYTES: usize = 24;
/// Classic 32-bit `BHead4` file block header size in bytes.
pub const BLEND_CLASSIC_BHEAD4_BYTES: usize = 20;
/// Gzip container two-byte signature (`0x1F 0x8B`).
pub const BLEND_GZIP_MAGIC: = ;
/// Zstandard container four-byte signature (`0x28 0xB5 0x2F 0xFD`).
pub const BLEND_ZSTD_MAGIC: = ;
/// Four-byte `DNA1` file-block code carrying Blender SDNA schema definitions.
pub const BLEND_CODE_DNA1: = *b"DNA1";
/// Four-byte `ENDB` file-block code terminating a `.blend` stream.
pub const BLEND_CODE_ENDB: = *b"ENDB";
/// Four-byte `SDNA` magic starting the payload of a `DNA1` block.
pub const BLEND_SDNA_MAGIC: = *b"SDNA";
/// Four-byte `NAME` subsection tag inside `DNA1`.
pub const BLEND_SDNA_NAME: = *b"NAME";
/// Four-byte `TYPE` subsection tag inside `DNA1`.
pub const BLEND_SDNA_TYPE: = *b"TYPE";
/// Four-byte `TLEN` subsection tag inside `DNA1`.
pub const BLEND_SDNA_TLEN: = *b"TLEN";
/// Four-byte `STRC` subsection tag inside `DNA1`.
pub const BLEND_SDNA_STRC: = *b"STRC";
/// Field prefix matched inside SDNA `ID` struct to dynamically resolve `ID.name` byte offset.
pub const BLEND_SDNA_FIELD_NAME_PREFIX: &str = "name[";
/// Maximum safety cap on `.blend` blocks walked in a single inspection pass.
pub const BLEND_MAX_BLOCK_COUNT: usize = 2_000_000;
/// Default byte offset of `ID.name` in 64-bit Blender structs when `DNA1` omits `ID` (`next*8 + prev*8`).
pub const BLEND_DEFAULT_ID_NAME_OFFSET_64: usize = 16;
/// Default byte offset of `ID.name` in 32-bit Blender structs when `DNA1` omits `ID` (`next*4 + prev*4`).
pub const BLEND_DEFAULT_ID_NAME_OFFSET_32: usize = 8;
/// Error returned when a `.blend` input buffer is shorter than the minimum header length.
pub const ERR_BLEND_TOO_SHORT: &str = "blend: file shorter than BLENDER header";
/// Error returned when the decompressed `.blend` payload does not start with `BLENDER`.
pub const ERR_BLEND_BAD_MAGIC: &str = "blend: invalid BLENDER magic signature";
/// Error returned when a `.blend` file is compressed with Zstandard (unsupported without external zstd codec).
pub const ERR_BLEND_ZSTD_UNSUPPORTED: &str = "blend: zstd-compressed .blend detected; re-save uncompressed or gzip-compressed or export via Blender CLI";
/// Error returned when the `.blend` header pointer/endianness/version bytes are invalid.
pub const ERR_BLEND_MALFORMED_HEADER: &str = "blend: malformed header metadata fields";
/// Warning recorded when a `.blend` stream terminates before encountering an `ENDB` block.
pub const WARN_BLEND_MISSING_ENDB: &str = "blend: stream ended before ENDB terminator block";
/// Warning recorded when a `BHead` block payload length exceeds remaining buffer bytes.
pub const WARN_BLEND_TRUNCATED_BLOCK: &str = "blend: truncated block payload encountered";
/// Warning recorded when a `DNA1` schema block is missing or truncated.
pub const WARN_BLEND_DNA_INCOMPLETE: &str = "blend: DNA1 SDNA schema missing or incomplete";