‘The mystery of the blend’ – the Blender file-format explained

dna_500 Today a document completely describing the internal .blend file format surfaced. It’s written by Jeroen Bakker, a former demo coder and it caused a bit of a stir in some chatboxes. This document is the first time someone collected the entire structure of a .blend file and the ‘Blender DNA’. Until now the documentation for it was shattered around in many places, mostly as comments in the code

Jeroen writes:

I’m working on a product what integrates Blender in a render pipeline by using the Blender command line and blend-files (.blend). The command line is not a problem as it is commonly used, but using blend-files outside Blender is difficult, because it is not that well documented. On the Internet, I’ve only found some clues about it on the Blender architecture pages [ref: http://www.blender.org/development/architecture/]. These were not sufficient. To really understand the file format I had to go through Blender’s source code. In this article I will describe the blend-file-format with a request to tool-makers to support blend-file.

First I’ll describe how Blender works with blend-files. You’ll notice why the blend-file-format is not that well documented, as from Blender’s perspective this is not needed. We look at the global file-structure of a blend-file (the file-header and file-blocks). After this is explained, we go deeper to the core of the blend-file, the DNA-structures. They hold the blue-prints of the blend-file and the key asset of understanding blend-files. When that’s done we can use these DNA-structures to read information from elsewhere in the blend-file.

In this article we’ll be using the default blend-file from Blender 2.48, with the goal to read the output resolution from the Scene. The article is written to be programming language independent and I’ve setup a web-site for support.

Links

Twitter



Please support us

  • http://jesterking.myopenid.com/ Nathan Letwory

    Very cool documentation, well executed and detailed. More of this!

    /Nathan

  • Agile

    @ Bart “formed demo coder” or “former”?

    Demoscene is one of European achievements!

  • Agile

    It is well demanded resource, I too searched for documentation on blender files.

  • http://makesweet.com Paul

    Nice! At the moment, when I need to automate extracting information from blend files, I work through Blender’s python API, because I’m daunted by the file format. With this as a guide, I can imagine cutting out the middle man. Thanks Jeroen!

  • marijn

    the article was also in “BlenderArt Magazine Issue #21, Look What I Can DO!”.

  • Jeroen Bakker

    HI, thank you all for your remarks! Hope it’s helpful.

  • Felix

    yeah, and nw for the first time, .blend compatibility might be broken with 2.5 :’(

    oh well, one can always run 2.49 and 2.50. :)

  • gokudomatic

    I’m impressed that the blender programmers could maintain so long the project without a clear written spec of the file format. What would happen if one of them get shot by a truck? or worse, get hired by an ultra-proprietary company (where even his soul won’t rest in peace)?

  • http://home.deds.nl/~mp/ ysvry

    intresting work thx.

  • http://dithi.es DiThi

    The formant hasn’t been documented apart from blender’s source code because the usual way of dealing with those files is using blender with a script which exports the data to a different format. If you want to do a program which manupulates .blend files, I think using blender as a batch tool is the easiest way.

  • http://muchappreciated!! pima

    many thanks !!

  • Santiago Andrade

    Can you update this documentation to 2.54 blend file?