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
14 Comments
Very cool documentation, well executed and detailed. More of this!
/Nathan
@ Bart "formed demo coder" or "former"?
Demoscene is one of European achievements!
It is well demanded resource, I too searched for documentation on blender files.
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!
the article was also in "BlenderArt Magazine Issue #21, Look What I Can DO!".
HI, thank you all for your remarks! Hope it's helpful.
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. :)
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)?
intresting work thx.
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.
many thanks !!
Can you update this documentation to 2.54 blend file?
the links seem broken, ais there any other links that I can refer to?
You can use the Wayback Machine / Internet Archive. However, I have backed the whole thing up here and converted it to Markdown:
https://github.com/fschutt/mystery-of-the-blend-backup
Click on the READMEs for the tables / description. Some of the formatting may have gone lost.