Mesh Bisect: add header info message for modal operation
Fixes T37700 Reviewed By: brecht Differential Revision: https://developer.blender.org/D166
This commit is contained in:
parent
e505203e8d
commit
091740f858
Notes:
blender-bot
2023-02-14 11:31:05 +01:00
Referenced by issue #37700, Modal options: Mesh Bisect
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue