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:
authorCampbell Barton <ideasman42@gmail.com>2019-06-24 14:41:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-06-24 14:41:17 +0300
commit1c94030238bb37918c4cd3256e0acb0b7099579d (patch)
tree1fc2001961dbf62dbdecfc7453ce9bc562a35295 /source/blender/windowmanager
parent037956f13fc947c9f08302634a64449ec9ba590e (diff)
Fix T65824: Span property ignored in mesh.fill_grid
The fix for T60777 caused this operator not to work from Python. Add a repeat_last flag for operator execution.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c28
2 files changed, 14 insertions, 16 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 5ed1be81bff..61b3b8aa2a2 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -391,7 +391,7 @@ int WM_operator_call_ex(struct bContext *C, struct wmOperator *op, const bool st
int WM_operator_call(struct bContext *C, struct wmOperator *op);
int WM_operator_call_notest(struct bContext *C, struct wmOperator *op);
int WM_operator_repeat(struct bContext *C, struct wmOperator *op);
-int WM_operator_repeat_interactive(struct bContext *C, struct wmOperator *op);
+int WM_operator_repeat_last(struct bContext *C, struct wmOperator *op);
bool WM_operator_repeat_check(const struct bContext *C, struct wmOperator *op);
bool WM_operator_is_repeat(const struct bContext *C, const struct wmOperator *op);
int WM_operator_name_call_ptr(struct bContext *C,
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index a95ccd65dff..24040568b7b 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1033,11 +1033,7 @@ static void wm_operator_finished(bContext *C, wmOperator *op, const bool repeat,
}
/* if repeat is true, it doesn't register again, nor does it free */
-static int wm_operator_exec(bContext *C,
- wmOperator *op,
- const bool repeat,
- const bool use_repeat_op_flag,
- const bool store)
+static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, const bool store)
{
wmWindowManager *wm = CTX_wm_manager(C);
int retval = OPERATOR_CANCELLED;
@@ -1057,14 +1053,8 @@ static int wm_operator_exec(bContext *C,
wm->op_undo_depth++;
}
- if (repeat && use_repeat_op_flag) {
- op->flag |= OP_IS_REPEAT;
- }
retval = op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval);
- if (repeat && use_repeat_op_flag) {
- op->flag &= ~OP_IS_REPEAT;
- }
if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) {
wm->op_undo_depth--;
@@ -1114,7 +1104,7 @@ static int wm_operator_exec_notest(bContext *C, wmOperator *op)
* warning: do not use this within an operator to call its self! [#29537] */
int WM_operator_call_ex(bContext *C, wmOperator *op, const bool store)
{
- return wm_operator_exec(C, op, false, false, store);
+ return wm_operator_exec(C, op, false, store);
}
int WM_operator_call(bContext *C, wmOperator *op)
@@ -1137,11 +1127,19 @@ int WM_operator_call_notest(bContext *C, wmOperator *op)
*/
int WM_operator_repeat(bContext *C, wmOperator *op)
{
- return wm_operator_exec(C, op, true, true, true);
+ const int op_flag = OP_IS_REPEAT;
+ op->flag |= op_flag;
+ const int ret = wm_operator_exec(C, op, true, true);
+ op->flag &= ~op_flag;
+ return ret;
}
-int WM_operator_repeat_interactive(bContext *C, wmOperator *op)
+int WM_operator_repeat_last(bContext *C, wmOperator *op)
{
- return wm_operator_exec(C, op, true, false, true);
+ const int op_flag = OP_IS_REPEAT_LAST;
+ op->flag |= op_flag;
+ const int ret = wm_operator_exec(C, op, true, true);
+ op->flag &= ~op_flag;
+ return ret;
}
/**
* \return true if #WM_operator_repeat can run