From 917a972b56af103aee406dfffe1f42745b5ad360 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Sep 2021 12:49:36 +1000 Subject: UI: keep navigation gizmos visible during modal operators Hiding viewport navigation gizmos caused the UI to "flicker" unnecessarily, the axis could also be useful as a reference. Resolves T73684 --- source/blender/editors/mesh/editmesh_bevel.c | 2 +- source/blender/editors/mesh/editmesh_bisect.c | 2 +- source/blender/editors/mesh/editmesh_inset.c | 2 +- source/blender/editors/transform/transform_generics.c | 2 +- source/blender/makesdna/DNA_view3d_types.h | 8 ++++++++ 5 files changed, 12 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index 01736f2919a..cdbbdd820b7 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -310,7 +310,7 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal) if (v3d) { opdata->gizmo_flag = v3d->gizmo_flag; - v3d->gizmo_flag = V3D_GIZMO_HIDE; + v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL; } } diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c index b511a1d2c14..f525f2c2e91 100644 --- a/source/blender/editors/mesh/editmesh_bisect.c +++ b/source/blender/editors/mesh/editmesh_bisect.c @@ -182,7 +182,7 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) /* Misc other vars. */ G.moving = G_TRANSFORM_EDIT; opdata->gizmo_flag = v3d->gizmo_flag; - v3d->gizmo_flag = V3D_GIZMO_HIDE; + v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL; /* Initialize modal callout. */ ED_workspace_status_text(C, TIP_("LMB: Click and drag to draw cut line")); diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index 18f51ae9df2..159e84db4ef 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -191,7 +191,7 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal) G.moving = G_TRANSFORM_EDIT; if (v3d) { opdata->gizmo_flag = v3d->gizmo_flag; - v3d->gizmo_flag = V3D_GIZMO_HIDE; + v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL; } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 0dfb229191c..b7f579cc12f 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -252,7 +252,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve /* turn gizmo off during transform */ if (t->flag & T_MODAL) { t->gizmo_flag = v3d->gizmo_flag; - v3d->gizmo_flag = V3D_GIZMO_HIDE; + v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL; } if (t->scene->toolsettings->transform_flag & SCE_XFORM_AXIS_ALIGN) { diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 4d88f6f0c15..fbf087ca392 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -610,6 +610,14 @@ enum { V3D_GIZMO_HIDE_TOOL = (1 << 3), }; +/** + * Hide these gizmos when modal operators are active, + * the intention is to hide all gizmos except for navigation since from a user-perspective + * these are closer to UI-level interface elements. Hiding them makes the UI flicker, also, + * the 3D view-axis can be useful to see during interactions. + */ +#define V3D_GIZMO_HIDE_DEFAULT_MODAL (V3D_GIZMO_HIDE_CONTEXT | V3D_GIZMO_HIDE_TOOL) + /** #View3d.gizmo_show_object */ enum { V3D_GIZMO_SHOW_OBJECT_TRANSLATE = (1 << 0), -- cgit v1.2.3