From 0e3d637ad040f55412856d10197f66f166591e49 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Dec 2012 13:29:58 +0000 Subject: Change region drawing callbacks to work much closer to how blender manages them internally. - yes, this does break scripts, but the api is marked experimental. ED_region_draw_cb_activate() adds a callback to a region type whereas the api made it look like the callback was being added to the region instance. Use a class method on bpy.types.Space to manage region drawing, eg. was: self._handle = context.region.callback_add(draw_callback_px, args, 'POST_PIXEL') is now: self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_PIXEL') --- source/blender/python/intern/bpy.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/python/intern/bpy.c') diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 876e2b2568f..082807c62db 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -234,6 +234,7 @@ static PyObject *bpy_import_test(const char *modname) return mod; } + /****************************************************************************** * Description: Creates the bpy module and adds it to sys.modules for importing ******************************************************************************/ @@ -293,6 +294,9 @@ void BPy_init_modules(void) PyModule_AddObject(mod, "context", (PyObject *)bpy_context_module); + /* register bpy/rna classmethod callbacks */ + BPY_rna_register_cb(); + /* utility func's that have nowhere else to go */ PyModule_AddObject(mod, meth_bpy_script_paths.ml_name, (PyObject *)PyCFunction_New(&meth_bpy_script_paths, NULL)); PyModule_AddObject(mod, meth_bpy_blend_paths.ml_name, (PyObject *)PyCFunction_New(&meth_bpy_blend_paths, NULL)); -- cgit v1.2.3