diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-20 17:29:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-20 17:29:58 +0400 |
commit | 0e3d637ad040f55412856d10197f66f166591e49 (patch) | |
tree | 1ff87859407f73a72b67834d41085eacb1c33740 /source/blender/python/intern/bpy.c | |
parent | 80bcc20835cfd328984c3fbc60774d6e6bed6482 (diff) |
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')
Diffstat (limited to 'source/blender/python/intern/bpy.c')
-rw-r--r-- | source/blender/python/intern/bpy.c | 4 |
1 files changed, 4 insertions, 0 deletions
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)); |