TOC:
Strengths of Python:
API 1 (Daniel Dunbar) | API 2 (Jan Walter) | API 3 (Erwin Coumans) |
---|---|---|
(+) OO like access to Blender datastructures (Meshes, etc.) | (-) Unflexible, direct access to the Blender data (low level structure is visible to the user) | (-) different way of data access (different syntax), not consistent with API1 and API2 |
(-) Little representation of the Blender Scenegraph | (+) More representation of the Blender Scenegraph | (o) no scenegraph representation |
(+) mesh data access stable | mesh data access unstable and broken | (-) different syntax |
(o) Wrapper objects are copies of or descriptor objects for the internal data. There is no synchronization happening between Blender objects and Python Objects | (o) Wrapper objects are copies of or descriptor objects for the internal data | (o) Wrapper objects are true C Objects. This is efficient in some way, but introduces nasty problems with synchronization (reference counting between Python and C objects), due to the design. |
(+) lots of functionality, future compatible from the users (python programmers) perspective | (-) future incompatible | (-) little functionality, missing error handling |
The options to improve this situation:
Option | Results |
---|---|
Redesign and rewrite the API using existing C++ classes/ Python extensions (BOOST library, CXX extensions), using the underlying data structure | (+) stable API, reusable code, (-) major increase of the binary size, (+) derivable and pickle'able structures (class emulation) |
Use current C-API code for low level access, create shadow modules/classes which live on to of the low level modules. See figure below. | (+)stable API, (-) code not really reusable for future structure changes, (+) remaining compactness of the code, (+) derivable and pickle'able structures (restricted to python classes), (-) slow and possibly memory consuming |
The second option is considered to be rather feasible at the moment. The high level Python API module functionality may gradually transferred into the C-API module if desired (for reasons of speed or little memory consumption)
Illustration of this approach:
For a summary of the currently wanted features in the toolbox, see http://www.blender.nl/people/strubi/BL/wishlist.html#toolbox
Several points would need to be thought out to design the Python Extension in order to make profit. A way of making piracy uninteresting should be found.