← All ideas
  • Published 4 Mar 2019

VCS-friendly format for blender files

Currently blender files are binary files. This is a good thing for efficiency, but it makes usage with version control systems (VCS) like git difficult. I know, most of a blender file should stay binary for efficiency reasons, but at least parts of a file, that are readable (like python scripts), and a history about which binary parts of the blender document were modified would be nice. The easiest way seems to be splitting it into multiple files, one for each kind of object (probably a directory structure like there already is when appending from another file). This way at least changes to single files can be tracked and reverted, when needed, instead of just the whole file. This format may be used as an alternate format, and should probably not replace the current format. But when working on large projects, it's nice, when you can use version control properly without having to use multiple blender files manually. Most game engines also have a directory structure for assets and a textual representation for scenes. Besides this structure may also clarify, that files are not removed without the user knowing (like when you add a texture to blender and after reopening, it's gone).

100%

Development Status: Open

Upvote 7 Downvote 0
porky11
4 Mar 2019

4 Comments

jason

A long time ago, I'd written a proof-of-concept add-on that would take a .blend file and explode it into parts for more granular versioning by datablock. Any binary datablock (objects, textures, nodes) would be their own .blend file. Images would of course be separated as images. Text datablocks would be kicked to separate text files. And it was all glued together with a JSON file that described how to reassemble the exploded .blend.

I should probably get around to revisiting that add-on at some point.

2
porky11 Author

* @Jason van Gumster * Sounds interesting. Not sure if json is such a good format for that, in most cases a custom format seems better to me. (more detailed explanation in the end) But still, would be cool if you find it and get it work again :)

(about the file to glue everything together: something line based, like toml is suited for most vcs, but if the hierarchies can get too large (are not restricted), toml is not reasonable, it's not really scalable for hierarchies. If your json format may contain all kinds of hierarchies something s-expression based seems best, maybe with some automatic indentation instead of parentheses. I might want to write such a parser, when needed)

1
jason

* @porky11 * JSON worked pretty well because it's natively supported in Python and the data that was being stored was pretty lightweight overall, mostly being pointers to other files. But the whole thing was a somewhat quickly cobbled-together proof of concept by a younger version of me that knew even less Python and Blender data structuring. I'd probably approach the code side of this problem a bit differently if I were to revisit it now.

A textual format for things that are text, like object names (including names of NLA Tracks) would also make it easier to make systematic changes to naming of objects. (Using some suitable text editor with command macros / programmability, or some command-line tool.)

I assume it is common that people realise that they have been using illogical naming conventions after a few days but going back and manually change names of hundreds of objects in Blender's UI is just too painful.

Happens at least to me all the time, when I am working on a large Blender project.