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>2020-05-13 16:04:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-13 16:14:01 +0300
commit5159b8e1eadb3803064a97874f7ebc059ce2be32 (patch)
tree101bf4a553a7da3a2f0979db9416635d132f706e /source/blender/editors/sculpt_paint/paint_vertex.c
parent54ea3562406c633dc69f59697cca3cd1cded3bcd (diff)
Fix extra undo step when switching object modes
Changing between modes would always add a user visible undo step that set object mode. Avoid storing this extra undo step on object mode switching.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index d050a39ce68..296b2bae510 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1450,8 +1450,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-/* for switching to/from mode */
-static bool paint_poll_test(bContext *C)
+static bool paint_mode_toggle_poll_test(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob == NULL || ob->type != OB_MESH) {
@@ -1460,9 +1459,6 @@ static bool paint_poll_test(bContext *C)
if (!ob->data || ID_IS_LINKED(ob->data)) {
return 0;
}
- if (CTX_data_edit_object(C)) {
- return 0;
- }
return 1;
}
@@ -1476,7 +1472,7 @@ void PAINT_OT_weight_paint_toggle(wmOperatorType *ot)
/* api callbacks */
ot->exec = wpaint_mode_toggle_exec;
- ot->poll = paint_poll_test;
+ ot->poll = paint_mode_toggle_poll_test;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -2683,7 +2679,7 @@ void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot)
/* api callbacks */
ot->exec = vpaint_mode_toggle_exec;
- ot->poll = paint_poll_test;
+ ot->poll = paint_mode_toggle_poll_test;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;