diff options
Diffstat (limited to 'source/blender/editors/space_script')
-rw-r--r-- | source/blender/editors/space_script/space_script.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index 52ef016497d..8fedcd8761f 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -60,6 +60,10 @@ #include "script_intern.h" // own include + +//static script_run_python(char *funcname, ) + + /* ******************** default callbacks for script space ***************** */ static SpaceLink *script_new(const bContext *C) @@ -139,7 +143,7 @@ static void script_main_area_init(wmWindowManager *wm, ARegion *ar) static void script_main_area_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ - // SpaceScript *sscript= (SpaceScript*)CTX_wm_space_data(C); + SpaceScript *sscript= (SpaceScript*)CTX_wm_space_data(C); View2D *v2d= &ar->v2d; float col[3]; @@ -151,7 +155,12 @@ static void script_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_ortho(C, v2d); /* data... */ + // BPY_run_python_script(C, "/root/blender-svn/blender25/test.py"); + if (sscript->script) { + //BPY_run_python_script_space(scpt->script.filename); + BPY_run_script_space_draw(C, sscript); + } /* reset view matrix */ UI_view2d_view_restore(C); @@ -190,6 +199,8 @@ static void script_header_area_draw(const bContext *C, ARegion *ar) static void script_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ + // XXX - Todo, need the ScriptSpace accessible to get the python script to run. + // BPY_run_script_space_listener() } /* only called once, from space/spacetypes.c */ @@ -213,7 +224,7 @@ void ED_spacetype_script(void) art->init= script_main_area_init; art->draw= script_main_area_draw; art->listener= script_main_area_listener; - art->keymapflag= ED_KEYMAP_VIEW2D; + art->keymapflag= ED_KEYMAP_VIEW2D| ED_KEYMAP_UI|ED_KEYMAP_FRAMES; // XXX need to further test this ED_KEYMAP_UI is needed for button interaction BLI_addhead(&st->regiontypes, art); |