Previous Thread  Next Thread

chat icon Human Readable Format

colinn

Posted: Tue Mar 27, 2012 5:13 pm
Joined: 28 Jan 2012
Posts: 10
Hi everyone.

I was doing a little poking around regarding moving away from a binary file format to an ascii file format. The motivation for this is better integration with RCS which would increase our workflow considerably. (Being able to merge blender files would be a gigantic plus)

The best approach that I can think of is using DNA / SDNA names to spit out tags for basic types and use special REF tags where needed. It would be structured something like this:

<BlenderVersion>
{
Blender-v2.61
}

<Scene> MySceneName
{
<property> gravity[3] { 0 0 0 }
...
<SceneGraph>
{
<Ref> MyObject { 1 }
}
}

<Object> MyObject
{
<uid> { 1 }
...
}

I'm not sure what to do with binary data (like textures).

I'm not that familiar with the Blender source code, but I have been able to find the code that can get the property names from SDNA stucts. I don't yet know how to get values for these property names though.

So aside from the gigantic files that this will produce, are there any other shortcomings you can think of before I fully commit to this task? Since I am not adding new information to SDNA etc this should still preserve the backwards/forwards compatibility and not require additional programming in other areas of Blender.

Thanks!
Colin
Reply with quote


ldo

Posted: Wed Mar 28, 2012 8:19 am
Joined: 07 Nov 2010
Posts: 544
Others have suggested this over the years, so youíre not the only one to think this is a good idea. Doing it for version control is definitely a good reason.

If itís any help, I wrote some Python code to read the Blender file format into Python structures here https://github.com/ldo/blendparser. I also started trying to write it back again.
Reply with quote


colinn

Posted: Wed Mar 28, 2012 2:20 pm
Joined: 28 Jan 2012
Posts: 10
Thanks for the link. I'll check it out.

It definitely is a daunting task. The solution I provided above seems good to me since it shouldn't make additional work for others. I'd just need to write a general reader/parser similar to what is there with binary data.

The only changes I can think of are:

Using unique ID refs instead of pointers
Writing reading values by name

There have got to be other things I'm not considering though, which is why I am reaching out to the community for a little mentoring.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group