C-Python Support finally lands


I cannot fathom the reason this is just now landing, but glad it is. Let’s hope its rages like wild fire and the add-on owners adapt to it and speed up Blender overall.

Does this means closed source 3rd party integrations are now possible?

Has it been added to master, or is it just a patch?

Tensor flow ftw.

I guess I don’t see how this changes anything on the user side. Any current python can load a c-extension already. This patch just allows the c-extension of python to be built in the blender build system? Without further research I can’t see how this would allow the c-extension to access anything in blender directly.

And certainly no this would not mean addons can be closed source at all.

It didn’t land, the patch has been sitting there since September of last year, it just got updated to remove some msvc flags when building on linux. (don’t get me wrong i like this one, and hope it lands sooner than later, but for now it’s just a patch) also it’s just a patch that adds some tooling for any bundled addons to use, this changes nothing to the c-python support. 3rd party addons always had the option to ship an c-extention module.

Hi guys… what would this patch allow if implemented for the end user?

Seems that … nothing. Finally. Nothing changes. Some things might continue being faster in some addons by some parts of a second it seems. Or did I missunderstand something here?

Right now things like parsing .obj files are all done in python, and while it works, it’s not super fast. Some things are just easier/faster to do in C/C++ code. This patch adds some tooling to the build system, so any bundled add-on that wants to transfer some of its functionality to C/C++ code can do so by creating c-extention module with relative ease, that’ll be build and installed to the right place during the blender build process. It’ll make no difference to end users, long term they might notice that some addons got a little (or a lot) faster when the authors start making use of it.

can’t we compile cpytbon libs now as addons?

if you compile it into a build of blender, yes.

Like i said, this patch adds nothing you can’t already do. It just makes it a little easier/nicer for the bundled addons to do so.

Cpython is just the orginal python language as it was developed.

Doesnt change a lot from user perspective (i higly doubt it would be faster), ea suporting phyphy or Cython could incerase speed 15 to 45 times in some scenario’s.

I don’t understand why there is this idea around that one cannot write closed source addons for Blender. Maybe I am missing something. Please correct me if I am wrong, but one cannot write addons for Blender that use Blender’s API and are closed source, but any separate part of an addon that does not use any of Blender’s code can be whatever you wish, can it not? So it has always been possible to just pass data to whatever you want for processing and then get the result back. Well, obviously some things are not as fast, but it seems to work with no problems at all with a bunch of renderers like Octane, V-ray, Thea… What’s wrong with that?

Whilst some people try to argue against it, this is indeed possible. There are some “clean room” considerations that need to be taken into account to prevent legal issues, but on can write and distribute Blender script addons that rely on closed source add-ons (scripted or native) provided their interface is appropriately licenced. The key is that you cannot distribute them together nor can the closed source code contain or rely on the GPL interface.

I talked about this with Campbell a year or so ago. Namely the creation of a BSD/MIT licensed generic interface that would enable proprietary plugin development and what that would entail. Unfortunately, my life became very complicated and time-poor soon afterward. I haven’t had a chance to implement anything worth releasing on that front.

@MartinZ It only works well with render engines, with interactive plugins like to modeling or similar it don’t works well.

It will be the biggest thing in Blender since 2.5.

I don’t what you need, but ask about it.

I would not rush with strong generalizations about what it works for or doesn’t. It would be impossible to think of all possible functions for an addon. It can be used for a lot of things - decimation, automatic retopology, photogrammetry, UV packing, unwrapping and so on. I just think it is incorrect to say that one cannot create closed source addons. It is possible with some limitations in some cases.

I don’t know, the last month we had a similar argument about this topic and some people find problems for that, if I remember correctly. everyone have a different interpretation of the GPL terms.

One user told, for example, that GPL only is apply with Blender, but not with differents plugins which are distributed separately

It’s true, you can distribute your add-on separately under your own terms but once a user installs it the GPL infects, thus the user can share the code under the terms of the GPL. This however does not invalidate the value offered by the author selling the add-on since as a user buying it you also get some support and can(usually) expect to see the add-on maintained and updated for new versions of blender. Something that tends to be an issue with the bundled scripts since they rely on volunteer efforts for maintenance.