Docmentation about Blender's C API?

Hi everyone,

A friend and me are devote Perl fanatics but we’d like to be able to write scripts for Blender without resorting to write python :-p

So, my friend, who also knows his way very well around C, thought it would be cool to use blender’s C API to write a nice Perl API for perlheads to work with.

I looked around in the developer docs on the blender Wiki and couldn’t find the C API docs.

Anybody know where it might be hiding, if anywhere?


To answer your Q: blender doesn’t have a clearly defined C api, there is RNA - check on bpy_rna.c, but the python/C api we have calls all sorts of blender C functions.

To answer the question you didnt ask - since you talk of adding a new language - blender wont accept more scripting languages. we have enough work on our hands supporting python, so while one day in the future we may move away from python, this would be a big step. In the short term new languages wont be accepted in trunk. Ofcourse your free to add support for perl on github or so.

This issue came up on the mailing list - since RNA is a generic API it might not be so hard to add perl, lua, lisp etc. – but the support for each language just adds an annoying amount of overhead - and we would end up with some languages being poorly supported.

The python and C/C++ apis are generated by makesrna and you could get it to generate perl bindings (I made it generate cython bindings as a test) but It’s highly doubtful that they would ever make it into trunk considering that blender does its scripting through an embedded python interpreter so you would also have to embed perl too.

Be a lot easier to just learn python.

Oh, and BTW, the C/C++ api is read-only and isn’t really meant to be used by mere humans and/or anyone who’s name isn’t ‘Brecht’.


Campbell beat me to it…