[Bf-blender-cvs] [091740f] master: Mesh Bisect: add header info message for modal operation

Brecht Van Lommel noreply at git.blender.org
Sat Jan 4 05:44:06 CET 2014


Commit: 091740f858c1b6d3016e38fc3186cce737d9ff2c
Author: Brecht Van Lommel
Date:   Sat Jan 4 05:41:58 2014 +0100
https://developer.blender.org/rB091740f858c1b6d3016e38fc3186cce737d9ff2c

Mesh Bisect: add header info message for modal operation

Fixes T37700

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D166

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

M	source/blender/editors/mesh/editmesh_bisect.c

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

diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c
index c3c4bda..4b52151 100644
--- a/source/blender/editors/mesh/editmesh_bisect.c
+++ b/source/blender/editors/mesh/editmesh_bisect.c
@@ -32,6 +32,9 @@
 #include "DNA_object_types.h"
 
 #include "BLI_math.h"
+#include "BLI_string.h"
+
+#include "BLF_translation.h"
 
 #include "BKE_global.h"
 #include "BKE_context.h"
@@ -147,6 +150,9 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 		G.moving = G_TRANSFORM_EDIT;
 		opdata->twtype = v3d->twtype;
 		v3d->twtype = 0;
+
+		/* initialize modal callout */
+		ED_area_headerprint(CTX_wm_area(C), IFACE_("LMB: Click and drag to draw cut line"));
 	}
 	return ret;
 }
@@ -168,6 +174,16 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event)
 
 	ret = WM_gesture_straightline_modal(C, op, event);
 
+	/* update or clear modal callout */
+	if (event->type == EVT_MODAL_MAP) {
+		if(event->val == GESTURE_MODAL_BEGIN) {
+			ED_area_headerprint(CTX_wm_area(C), IFACE_("LMB: Release to confirm cut line"));
+		}
+		else {
+			ED_area_headerprint(CTX_wm_area(C), NULL);
+		}
+	}
+
 	if (ret & (OPERATOR_FINISHED | OPERATOR_CANCELLED)) {
 		edbm_bisect_exit(C, &opdata_back);
 	}




More information about the Bf-blender-cvs mailing list