diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-07 09:47:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-07 09:47:40 +0300 |
commit | 612936954ac67cacee8d13f48ed1bd8b5ff386c7 (patch) | |
tree | 9e11f25bccc124d85405edc8c2aa06f02895be6b /source/blender | |
parent | 1e57d8c4e7c37b09b761a538d408056f512afd0b (diff) |
minor internal python api change - pass the context rather then getting from BPy_GetContext() again.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/BPY_extern.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index 323682b99aa..98e160525f8 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -100,7 +100,7 @@ extern "C" { int BPY_run_python_script( struct bContext *C, const char *filename, struct Text *text, struct ReportList *reports ); // 2.5 working int BPY_run_script_space_draw(const struct bContext *C, struct SpaceScript * sc); // 2.5 working // int BPY_run_script_space_listener(struct bContext *C, struct SpaceScript * sc, struct ARegion *ar, struct wmNotifier *wmn); // 2.5 working - void BPY_update_modules( void ); // XXX - annoying, need this for pointers that get out of date + void BPY_update_modules(struct bContext *C); // XXX - annoying, need this for pointers that get out of date // int BPY_context_get(struct bContext *C, const char *member, struct bContextDataResult *result); // diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 3a049e89031..7b31f77a0c9 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -88,7 +88,7 @@ void bpy_context_set(bContext *C, PyGILState_STATE *gilstate) fprintf(stderr, "ERROR: Python context called with a NULL Context. this should not happen!\n"); } - BPY_update_modules(); /* can give really bad results if this isnt here */ + BPY_update_modules(C); /* can give really bad results if this isnt here */ #ifdef TIME_PY_RUN if(bpy_timer_count==0) { @@ -136,7 +136,7 @@ void BPY_free_compiled_text( struct Text *text ) } } -void BPY_update_modules( void ) +void BPY_update_modules(bContext *C) { #if 0 // slow, this runs all the time poll, draw etc 100's of time a sec. PyObject *mod= PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0); @@ -146,7 +146,7 @@ void BPY_update_modules( void ) /* refreshes the main struct */ BPY_update_rna_module(); - bpy_context_module->ptr.data= (void *)BPy_GetContext(); + bpy_context_module->ptr.data= (void *)C; } /* must be called before Py_Initialize */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index b95dc520526..ee393c5fe15 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -5122,7 +5122,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun return 0; } -extern void BPY_update_modules( void ); //XXX temp solution +extern void BPY_update_modules(bContext *C); //XXX temp solution /* TODO - multiple return values like with rna functions */ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) |