• Identifying New-Format Blender Files

    From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc,comp.graphics.animation on Sat Jan 10 02:39:39 2026
    From Newsgroup: comp.os.linux.misc

    The file(1) command has not yet been updated to correctly identify
    .blend files created with Blender v5.0 or later. Enclosed is my
    attempt at a patch to fix this. Apply this against a copy of the file magic/Magdir/blender from the libmagic source tree, and you can
    test the result without installing it with a command like

    file -m -2patched-blender-magic-file-+ -2blendfile-+

    and confirm that it correctly handles both old-format and new-format
    .blend files.

    --- blender 2022-12-22 04:58:05.000000000 +1300
    +++ blender-new 2026-01-10 15:31:35.148118366 +1300
    @@ -1,4 +1,3 @@
    -
    #------------------------------------------------------------------------------
    # $File: blender,v 1.9 2022/12/21 15:53:27 christos Exp $
    # blender: file(1) magic for Blender 3D related files
    @@ -13,13 +12,13 @@
    # http://formats.kaitai.io/blender_blend/index.html
    # Note: called "Blender 3D data" by TrID
    # and gzip compressed variant handled by ./compress
    -0 string =BLENDER Blender3D,
    +0 string =BLENDER Blender3D
    #!:mime application/octet-stream
    !:mime application/x-blender
    !:ext blend
    # no sample found with extension blender
    #!:ext blend/blender
    7 string =_ saved as 32-bits
    7 string =_ pre-v5, saved as 32-bits
    8 string =v little endian
    9 byte x with version %c.
    10 byte x \b%c
    @@ -32,7 +31,7 @@
    11 byte x \b%c
    0x40 string =GLOB \b.
    0x58 beshort x \b%.4d
    7 string =- saved as 64-bits
    7 string =- pre-v5, saved as 64-bits
    8 string =v little endian
    9 byte x with version %c.
    10 byte x \b%c
    @@ -46,5 +45,15 @@
    0x44 string =GLOB \b.
    0x60 beshort x \b%.4d

    +# Blender 5.0+
    7 string =17 v5+,
    10 byte x format version %c
    11 byte x \b%c
    13 byte x app version %c
    14 byte x \b%c
    15 byte x \b%c
    16 byte x \b%c
    +#
    +
    # Scripts that run in the embedded Python interpreter
    0 string #!BPY Blender3D BPython script

    --- Synchronet 3.21a-Linux NewsLink 1.2