[Bf-blender-cvs] [983280b0149] master: PyAPI: remove active area test for script.python_file_run operator
Campbell Barton
noreply at git.blender.org
Tue Aug 24 06:54:44 CEST 2021
Commit: 983280b01491883982df6c599da24767ea2e6248
Author: Campbell Barton
Date: Tue Aug 24 14:53:23 2021 +1000
Branches: master
https://developer.blender.org/rB983280b01491883982df6c599da24767ea2e6248
PyAPI: remove active area test for script.python_file_run operator
There is no reason running a Python file should require an active area.
===================================================================
M source/blender/editors/space_script/script_edit.c
===================================================================
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;
More information about the Bf-blender-cvs
mailing list