[Questions] Import/Export Plug-in Development

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Posts: 2
Joined: Thu Dec 02, 2010 5:20 pm

[Questions] Import/Export Plug-in Development

Postby Conoktra » Thu Dec 02, 2010 5:42 pm


First of all I would like to say that Blender is truly amazing.... a jewel of the open source world! You guys/gals are doing a great job :).

I am posting here because a project I am working on (Galactic Vice) requires me to write a plug-in that is capable of importing/exporting to/from Blender; models from a custom format.

Taking a look at various export scripts included with Blender it seems as if Blender uses Python as the quick-n-easy interface for doing importing/exporting. I was wondering if it is possible to develop C/C++ equivalents of these scripts. If not, is it possible to develop them in a language other than Python, say PHP/Perl/Lua? (references/links to tutorials and/or manuals would be great)

Python is quite an interesting language that I plan to learn someday, but if anything learning a new language takes time -- something that nobody ever has enough of :wink:.

I would highly appreciate any documentation/guides/pointers for developing import/export plug-ins using C, Perl, etc, that you could give me :D.

Thanks beforehand!

Posts: 941
Joined: Sun Oct 13, 2002 7:37 pm
Location: University of Minnesota (USA)

Postby SirDude » Thu Dec 02, 2010 5:55 pm

It's possible to do it in c/c++ however you'd have to go through the headache of
distributing your own version of blender with the modified code
and or getting your code accepted into the main branch which might
be more work than your looking for.

I'm no fan of python, having said that if I were writing an importer/exporter
I'd do it in python. The API is python based and best bet is looking at the other
importers/exporters as examples. Other languages aren't really an option.

The other option is you could write a script to convert your data to a known
file format.that blender supports: collada, obj, dfx...
Then your free to use whatever language you want.

Posts: 3646
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Postby stiv » Thu Dec 02, 2010 8:56 pm

I'm no fan of python

Blasphemy! But other than that, everything SirDude said is spot on. The original point of having a scripting API was to enable creating importers and exporters.

As for using other scripting languages like lua, you will need to embed the interpreter as well as writing the interfaces to Blender's internal data structs and functions. No small task.

Considering that python is an easy language to learn - anyone with a bit of experience in any language can pick up to be useful in an hour or two - do your plug-in in python first and then port it to C/C++ later if you still feel the need.

Posts: 2
Joined: Thu Dec 02, 2010 5:20 pm

Postby Conoktra » Fri Dec 03, 2010 5:12 am

Ahh, that's too bad... I figured there might be an API similar to how Gimp does plug-ins. Currently for Galactic Vice we just export everything as key-framed OBJ models, then batch-convert them into an animated model format that fits out needs.

Looks like I just need to find time to learn the basics of Python. Are there any good references to Blender's Python API that could get me going in the right direction?

Thanks too both of you for the help! :D

Posts: 544
Joined: Sun Nov 07, 2010 11:30 pm
Location: Hamilton, New Zealand

Postby ldo » Sat Dec 04, 2010 7:33 am

You could subcontract the job to someone with Python experience and Blender experience.

Return to “Coding Blender”

Who is online

Users browsing this forum: No registered users and 0 guests