From 35014aa741251e79c4cb4dffbe84580789059c5c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Nov 2010 05:11:10 +0000 Subject: [PATCH] - add python/rna function region.tag_redraw() - removed print which was before NULL check, (possible crash) - add execute hooks for the python console (not used by any scripts yet) --- release/scripts/op/console_python.py | 6 ++++++ source/blender/editors/curve/editfont.c | 2 +- source/blender/makesrna/intern/rna_screen.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py index 7a969cbe9f5..2ce6ede8f76 100644 --- a/release/scripts/op/console_python.py +++ b/release/scripts/op/console_python.py @@ -186,9 +186,15 @@ def execute(context): # restore the stdin sys.stdin = stdin_backup + + # execute any hooks + for func, args in execute.hooks: + func(*args) return {'FINISHED'} +execute.hooks = [] + def autocomplete(context): from console import intellisense diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index ed8b1dae430..19a8030c6be 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1696,7 +1696,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) cu = ob->data; font = cu->vfont; } - printf("%s\n", font->name); + path = (font && strcmp(font->name, FO_BUILTIN_NAME) != 0)? font->name: U.fontdir; if(RNA_property_is_set(op->ptr, "filepath")) diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index d6964f5d569..197a7266fea 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -176,6 +176,8 @@ static void rna_def_region(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "winy"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Height", "Region height"); + + RNA_def_function(srna, "tag_redraw", "ED_region_tag_redraw"); } static void rna_def_screen(BlenderRNA *brna)