loading blender files in my program

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

darweidu
Posts: 1
Joined: Thu Feb 20, 2003 3:46 am

loading blender files in my program

Postby darweidu » Thu Feb 20, 2003 3:50 am

How should I go about loading blender files in my own program?

I want to write a little model-loading program, except I can't find out how I can load the blender models. Is there a (C or c++) library I can include in my program so I can read a .BLENDER file and get at the data?

If there is no library, is there a specification for the .BLENDER file format?

stuuf133t
Posts: 7
Joined: Mon Oct 14, 2002 2:38 am

Postby stuuf133t » Sun Mar 02, 2003 12:15 am

I don't think there's a spec. I heard once that the file format is essentially a memory dump, closely related to how it stores datablocks in memory, and dependant on the particular version used. It would be nice to have some kind of, maybe, XML-based files, but they would probably just be too slow.

BloB
Posts: 6
Joined: Fri Mar 07, 2003 1:38 pm

Postby BloB » Fri Mar 07, 2003 2:28 pm

stuuf133t wrote:I heard once that the file format is essentially a memory dump, closely related to how it stores datablocks in memory, and dependant on the particular version used.


Well, now that the sources are open, anybody can look at what Blender does to load or save files. This story about memory dumps is not so bad as one would think. It's not a raw memory dump. It's just that most structure are copied directly from memory to file 'as is'. But the file also contains a special entry that gives the definitions of all structures used, so that everything can be loaded nicely anyway, even if fields are added or removed in a future release.

In v2.26, there's a nice 1000-line function that can load any blender file dating as early as v1.0 :!:

stuuf133t wrote:It would be nice to have some kind of, maybe, XML-based files, but they would probably just be too slow.


I'm currently trying to do something that could be close to that. I'm also trying to document the file format on my way (in french). If I manage to finish that and if anybody seems interested, I will share all that.
And even if the XML format is too slow and too big, it can be a 'standard intermediary format' for import/export.

BloB.

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Postby Jamesk » Fri Mar 07, 2003 3:36 pm

There is no specification. Your best bet is to get hold of eeshlo and try out his blender to python converter thingy. But everything that has to do with the .blend format is a longshot.


Return to “Coding Blender”

Who is online

Users browsing this forum: No registered users and 2 guests