It looks like you're using an ad blocker! I really need the income to keep this site running.
If you enjoy BlenderNation and you think it’s a valuable resource to the Blender community, please take a moment to read how you can support BlenderNation.

'The mystery of the blend' - the Blender file-format explained

14

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

About Author

Bart Veldhuizen

I have a LONG history with Blender – I wrote some of the earliest Blender tutorials, worked for Not a Number and helped run the crowdfunding campaign that open sourced Blender (the first one on the internet!). I founded BlenderNation in 2006 and have been editing it every single day since then ;-)

14 Comments

  1. 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!

  2. 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. :)

  3. gokudomatic on

    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)?

  4. 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.

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.