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

Blender DNA, RNA and extreme backward compatibility

Here's an interesting look into both Blender's past and it's future: In an excerpt from a discussion on IRC, Ton Roosendaal explains about Blender's existing DNA and upcoming RNA structures. DNA powers an often overlooked Blender feature - it's amazing backward compatibility. Thanks to DNA you can read Blender files back to version 1.00!

Ton writes:

Q: do DNA and RNA actually stand for anything?

They're analog to the biological meaning. Blender DNA is as old as Blender, it's a long string with encoded types for the entire internal structure of Blender's data, saved in every .blend, and in every Blender binary. With this DNA it can read older or even newer files. Blender is even "aware" of its own data types, i.e. you can give it a pointer, and Blender can find the item named "vertex" in it. This makes .blend files still readable, even when saved in 1.00 (try this example - an original Roosendaal).

Q: .. and RNA?

That's a 2.50 feature, a system to wrap DNA into a nice API to read/set Blender data and properties. It actually means "messenger DNA", which is not totally correct, because RNA makes DNA in cells.
Our RNA can auto-generate a Python data-access API, and will allow feature "everything animatable", auto-button-list-view of data and it will even handle dependencies in future.

A lot of educated engineers hated this DNA, thats why all rumour in past to replace it with XML. :) There are still people who think XML is superior... the funny thing is that Google, for all internal development, replaced XML for a similar DNA system! You drop human readability of files, but have the same flexibility, and lots of lots more speed. Afaik, Blender is the first public app doing this.

28 Comments

  1. ("There are still people who think XML is superior… the funny thing is that Google, for all internal development, replaced XML for a similar DNA system! You drop human readability of files, but have the same flexibility, and lots of lots more speed. Afaik, Blender is the first public app doing this.")

    Ton , thank you!
    really
    Thank you for being on the bleeding edge of software engineering. That's why Blender is the only open source software that I think has a bright future.

  2. I am really looking forward to "everything animateable" :) Like being able to animate the stretchyness of an IK chain on and off. Blender frigging rocks, i love it!

  3. The KoesWous Logo loads fine here.
    I love Blender's backward compatibility.
    RNA would make it even better. It's a relief that this RNA isn't used to build DNA.
    If that would happen Blender's system would report this:
    If you're happy and you know it, syntax error!
    Syntax Error

    Viruses use RNA to screw with our cells. :( I hate viruses. I'll beat the crap out of HIV if it tries to get close to me.

  4. Sounds very interesting, is there any development documentation available on that, or does one have to dig through the sources for conceptual details ?

  5. @Bozo: There is no development documentation (that I'm aware of). There is a nice abstract documentation that gives some insight to the concept: http://www.blender.org/development/architecture/ But developer documentation is best found looking through the code, or bugging devs on IRC.

    RNA has a wee bit of API documentation:

    http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA
    http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATasks
    http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataAPI

  6. I'm really interested in this DNA approach to programming. I think it's ingenious and i would like to learn more about it. I've been searching google and its tough to find anything relating to it. Mostly what i find is about programming actually DNA to do computing, not programming that mimics DNA. I think its always smart to use nature as a template to work from because most of the work has been done for you. I would love it Bart or Ton if you can post anything more about this.

  7. Hey there - I've always thought that the DNA was one of blender's strengths! XML is awful if you want to load files quickly!!

    Here's an idea though - sometimes forwards compatibility gets slightly broken between releases, although backwards compatibility gets patched. How about if Blender went one step further? How about if it could read an external file for the forwards compatibility patching code (maybe a dynamic library that comes packaged or built with the program) - that way, when a new feature in blender breaks forwards compatibility, somebody could write code to read it back into the previous version of blender as nicely as possible, so getting an old blender version to read a newer file correctly would be as simple as replacing the old external file with the latest one and running through the patching code to the required level each time a file was loaded with a DNA saved by a newer version of Blender than the version reading the file!! If the library with the code was stored user-wide (e.g. under ~/.blender in linux), then each new version of blender could replace the file automatically with a newer one when run for the first time, thereby causing all older versions of blender installed on the same system to read the newer files correctly using the new patching code.

    My idea reminds me a bit of the import __future__ statements in python. Of course, getting developers to maintain the code properly could be an issue, though it might be reasonable to assume that if something breaks backwards compatibility, it must also break forwards compatibility, or am i wrong?

    Just an idea.
    ~epat. :P

  8. I am looking forward to 2.50 and RNA.

    Glad there is no XML, it is an annoyance at the best of times.

    Also hope the X64 version of 2.50 comes out at the same time as the X32 version.

    Keep up the good work, it is much appreciated by me.

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.

Share this story: