From 169b4e81186279e4ce28ed935b69b811175a2e50 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Mon, 30 Sep 2013 09:51:25 +0000 Subject: Fix #36853, Undo not working for Particles Hair - Free Edit. Resetting the particle system without losing edit undo is not so easy. Just added a confirm message for now to warn user about loss of particle edit undo. --- source/blender/editors/physics/particle_edit.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/physics') diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 1a561efd217..b0e19d04e35 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4421,7 +4421,7 @@ static int clear_edited_exec(bContext *C, wmOperator *UNUSED(op)) ParticleSystem *psys = psys_get_current(ob); if (psys->edit) { - if (psys->edit->edited || 1) { // XXX okee("Lose changes done in particle mode?")) + if (psys->edit->edited || 1) { PE_free_ptcache_edit(psys->edit); psys->edit = NULL; @@ -4447,6 +4447,11 @@ static int clear_edited_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } +static int clear_edited_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) +{ + return WM_operator_confirm_message(C, op, "Lose changes done in particle mode? (no undo)"); +} + void PARTICLE_OT_edited_clear(wmOperatorType *ot) { /* identifiers */ @@ -4457,6 +4462,7 @@ void PARTICLE_OT_edited_clear(wmOperatorType *ot) /* api callbacks */ ot->exec = clear_edited_exec; ot->poll = particle_edit_toggle_poll; + ot->invoke = clear_edited_invoke; /* flags */ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; -- cgit v1.2.3