From 983280b01491883982df6c599da24767ea2e6248 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 24 Aug 2021 14:53:23 +1000 Subject: PyAPI: remove active area test for script.python_file_run operator There is no reason running a Python file should require an active area. --- source/blender/editors/space_script/script_edit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 0a8700f8180..13adf6bfc2d 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -52,7 +52,9 @@ static int run_pyfile_exec(bContext *C, wmOperator *op) #ifdef WITH_PYTHON if (BPY_run_filepath(C, path, op->reports)) { ARegion *region = CTX_wm_region(C); - ED_region_tag_redraw(region); + if (region != NULL) { + ED_region_tag_redraw(region); + } return OPERATOR_FINISHED; } #else @@ -70,7 +72,6 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot) /* api callbacks */ ot->exec = run_pyfile_exec; - ot->poll = ED_operator_areaactive; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; -- cgit v1.2.3