[Bf-blender-cvs] [a561eae] temp_hair_flow: Stub handling of hair edit mode switch for the undo system.

Lukas Tönne noreply at git.blender.org
Wed Jan 7 19:37:39 CET 2015


Commit: a561eae9e134a4b1a5f7e7d130b028af14cbd7ae
Author: Lukas Tönne
Date:   Tue Jan 6 16:41:39 2015 +0100
Branches: temp_hair_flow
https://developer.blender.org/rBa561eae9e134a4b1a5f7e7d130b028af14cbd7ae

Stub handling of hair edit mode switch for the undo system.

Undo is not implemented for hair edit mode yet, but this prevents
operators from reloading blend files on redo, which otherwise exits
hair edit mode without cleaning up.

===================================================================

M	source/blender/editors/util/undo.c

===================================================================

diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index fac5749..f9a5d52 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -104,6 +104,11 @@ void ED_undo_push(bContext *C, const char *str)
 
 		PE_undo_push(CTX_data_scene(C), str);
 	}
+	else if (obact && obact->mode & OB_MODE_HAIR_EDIT) {
+		if (U.undosteps == 0) return;
+
+		/* XXX TODO */
+	}
 	else if (obact && obact->mode & OB_MODE_SCULPT) {
 		/* do nothing for now */
 	}
@@ -189,6 +194,9 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
 			else
 				PE_redo(scene);
 		}
+		else if (obact && obact->mode & OB_MODE_HAIR_EDIT) {
+			/* XXX TODO */
+		}
 		else if (U.uiflag & USER_GLOBALUNDO) {
 			// note python defines not valid here anymore.
 			//#ifdef WITH_PYTHON
@@ -281,6 +289,10 @@ int ED_undo_valid(const bContext *C, const char *undoname)
 		else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
 			return PE_undo_valid(CTX_data_scene(C));
 		}
+		else if (obact && obact->mode & OB_MODE_HAIR_EDIT) {
+			/* XXX TODO */
+			return 1;
+		}
 		
 		if (U.uiflag & USER_GLOBALUNDO) {
 			return BKE_undo_valid(undoname);
@@ -441,7 +453,8 @@ enum {
 	UNDOSYSTEM_GLOBAL   = 1,
 	UNDOSYSTEM_EDITMODE = 2,
 	UNDOSYSTEM_PARTICLE = 3,
-	UNDOSYSTEM_IMAPAINT = 4
+	UNDOSYSTEM_IMAPAINT = 4,
+	UNDOSYSTEM_HAIR = 5,
 };
 
 static int get_undo_system(bContext *C)
@@ -471,6 +484,8 @@ static int get_undo_system(bContext *C)
 		if (obact) {
 			if (obact->mode & OB_MODE_PARTICLE_EDIT)
 				return UNDOSYSTEM_PARTICLE;
+			else if (obact->mode & OB_MODE_HAIR_EDIT)
+				return UNDOSYSTEM_HAIR;
 			else if (obact->mode & OB_MODE_TEXTURE_PAINT) {
 				if (!ED_undo_paint_empty(UNDO_PAINT_IMAGE))
 					return UNDOSYSTEM_IMAPAINT;




More information about the Bf-blender-cvs mailing list