Thursday, January 6, 2011

ctypes-pygtk in blender25

addon source code

The latest RPythonic can generate ctypes bindings for GTK that are also Python3 and Blender compatible. Currently Blender lacks a way to call a python function at a timed interval, this would be a show stopper for the old PyGTK bindings where gtk_main is a blocking function. Luckily ctypes releases the GIL when a C function is called, as detailed by Christopher Swenson, here, if the call is wrapped in a python thread, then gtk_main can run in its own non-blocking thread while Blender continues to update smoothly.

No comments:

Post a Comment