[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60436] trunk/blender/source/blender/ editors/physics/particle_edit.c: Fix #36853, Undo not working for Particles Hair - Free Edit.

Lukas Toenne lukas.toenne at googlemail.com
Mon Sep 30 11:51:25 CEST 2013


Revision: 60436
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60436
Author:   lukastoenne
Date:     2013-09-30 09:51:25 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/physics/particle_edit.c

Modified: trunk/blender/source/blender/editors/physics/particle_edit.c
===================================================================
--- trunk/blender/source/blender/editors/physics/particle_edit.c	2013-09-30 09:35:04 UTC (rev 60435)
+++ trunk/blender/source/blender/editors/physics/particle_edit.c	2013-09-30 09:51:25 UTC (rev 60436)
@@ -4421,7 +4421,7 @@
 	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 @@
 	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 @@
 	/* 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;




More information about the Bf-blender-cvs mailing list