[Bf-blender-cvs] [917a972b56a] master: UI: keep navigation gizmos visible during modal operators

Campbell Barton noreply at git.blender.org
Tue Sep 14 04:53:56 CEST 2021


Commit: 917a972b56af103aee406dfffe1f42745b5ad360
Author: Campbell Barton
Date:   Tue Sep 14 12:49:36 2021 +1000
Branches: master
https://developer.blender.org/rB917a972b56af103aee406dfffe1f42745b5ad360

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

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

M	source/blender/editors/mesh/editmesh_bevel.c
M	source/blender/editors/mesh/editmesh_bisect.c
M	source/blender/editors/mesh/editmesh_inset.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/makesdna/DNA_view3d_types.h

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

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),



More information about the Bf-blender-cvs mailing list