Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/src/drawtext.c')
-rw-r--r--source/blender/src/drawtext.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c
index ccb5767d7e7..bc30a52f126 100644
--- a/source/blender/src/drawtext.c
+++ b/source/blender/src/drawtext.c
@@ -2014,6 +2014,18 @@ void txt_find_panel(SpaceText *st, int again, int flags)
}
}
+static void txt_print_error(SpaceText *st, char* str)
+{
+ if (curarea->spacetype != SPACE_TEXT) return;
+ drawtextspace(curarea, st);
+ glColor3ub(128, 16, 16);
+ glRecti(22, curarea->winy-2, curarea->winx-2, curarea->winy-st->lheight-3);
+ glColor3ub(255, 32, 32);
+ glRasterPos2i(22, curarea->winy-st->lheight);
+ BMF_DrawString(spacetext_get_font(st), str);
+ curarea->win_swap= WIN_BACK_OK;
+}
+
void run_python_script(SpaceText *st)
{
char *py_filename;
@@ -2029,16 +2041,17 @@ void run_python_script(SpaceText *st)
if (!st->text) return;
if (!strcmp(py_filename, st->text->id.name+2)) {
- error_pyscript( );
+ //error_pyscript( );
if (lineno >= 0) {
txt_move_toline(text, lineno-1, 0);
txt_sel_line(text);
pop_space_text(st);
- }
+ }
+ txt_print_error(st, BPY_Err_getMessage());
} else {
error("Error in other (possibly external) file, "\
"check console");
- }
+ }
}
}
@@ -2862,7 +2875,6 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case PKEY:
if (G.qual == LR_ALTKEY) {
run_python_script(st);
- do_draw= 1;
}
break; /* BREAK P */
case QKEY: