Previous Thread  Next Thread

chat icon [Questions] Import/Export Plug-in Development


Posted: Thu Dec 02, 2010 5:42 pm
Joined: 02 Dec 2010
Posts: 2

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

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 Very Happy.

Thanks beforehand!
Reply with quote


Posted: Thu Dec 02, 2010 5:55 pm
Joined: 13 Oct 2002
Posts: 939
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.
Reply with quote


Posted: Thu Dec 02, 2010 8:56 pm
Joined: 05 Aug 2003
Posts: 3645
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.
Reply with quote


Posted: Fri Dec 03, 2010 5:12 am
Joined: 02 Dec 2010
Posts: 2
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! Very Happy
Reply with quote


Posted: Sat Dec 04, 2010 7:33 am
Joined: 07 Nov 2010
Posts: 544
You could subcontract the job to someone with Python experience and Blender experience.
Reply with quote

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