Hi! Is there a way how to extend Blender with C/C++ code, not Python? (without creating custom builds, of course) For example, if I wanted to write an exporter for third-party renderer, would it be possible to access mesh data directly from a dynamic library written in C? I’m afraid that Python is quite slow for this task…
dont assume python is slow, make sure python is slow. Bare in mind that you wont have to rewrite much if you port code from python to c, python has very minimalistic syntax but still quite similar to C and is very fast because it uses blender libraries and its own libraries both made in C.
Blender can extend with C in 2 ways, 1 ) through plugin system though that approach is rarely followed as the popularity of python is so big that people prefer making blender addons, plugins are made in C which way more difficult and the plugin system is not well documented 2) edit Blender source directly, also made in C this approach is not easy also because you have to understand the source and that requires alot of reading.
With python you got a very easy language with a well documented blender api. Python in 9/10 cases is a clear win.
Also its easy to make python as fast as C with cython .
many objects have a RNA-function called as_pointer(), which is exposed to python
help text says:
Returns the memory address which holds a pointer to blenders internal data
:return: int (memory address).
… note:: This is intended only for advanced script writers who need to
pass blender data to their own C/Python modules.
so there seems to be a way to use C modules, dunno if it refers to Blender-Plugins written in C…
Just remember that you’ll need to import the headers that contains the structs and link the libraries that contains the functions you’ll use, and this can make your script become as big as the whole Blender