[Bf-blender-cvs] [520f08aa56f] blender-v2.83-release: Fix T77241: NDOF navigation doesn't work with the knife tool

Campbell Barton noreply at git.blender.org
Mon Jun 1 08:26:43 CEST 2020


Commit: 520f08aa56fcea1111ac8a6660cb0b428164d508
Author: Campbell Barton
Date:   Mon Jun 1 16:21:30 2020 +1000
Branches: blender-v2.83-release
https://developer.blender.org/rB520f08aa56fcea1111ac8a6660cb0b428164d508

Fix T77241: NDOF navigation doesn't work with the knife tool

Also allow NDOF with loop-cut.

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

M	source/blender/editors/mesh/editmesh_knife.c
M	source/blender/editors/mesh/editmesh_loopcut.c

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

diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index f94cd778e13..5f5599b53df 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2998,6 +2998,7 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event)
       case MOUSEROTATE:
       case WHEELUPMOUSE:
       case WHEELDOWNMOUSE:
+      case NDOF_MOTION:
         return OPERATOR_PASS_THROUGH;
       case MOUSEMOVE: /* mouse moved somewhere to select another loop */
         if (kcd->mode != MODE_PANNING) {
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 37bacb4af55..08bbe9ae0e7 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -514,6 +514,10 @@ static int loopcut_finish(RingSelOpData *lcd, bContext *C, wmOperator *op)
 
 static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
 {
+  if (event->type == NDOF_MOTION) {
+    return OPERATOR_PASS_THROUGH;
+  }
+
   RingSelOpData *lcd = op->customdata;
   float cuts = lcd->cuts;
   float smoothness = lcd->smoothness;
@@ -605,7 +609,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
         }
         handled = true;
         break;
-      case MOUSEMOVE: /* mouse moved somewhere to select another loop */
+      case MOUSEMOVE: {
+        /* mouse moved somewhere to select another loop */
 
         /* This is normally disabled for all modal operators.
          * This is an exception since mouse movement doesn't relate to numeric input.
@@ -614,14 +619,16 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
 #if 0
         if (!has_numinput)
 #endif
-      {
-        lcd->vc.mval[0] = event->mval[0];
-        lcd->vc.mval[1] = event->mval[1];
-        loopcut_mouse_move(lcd, (int)lcd->cuts);
+        {
+          lcd->vc.mval[0] = event->mval[0];
+          lcd->vc.mval[1] = event->mval[1];
+          loopcut_mouse_move(lcd, (int)lcd->cuts);
 
-        ED_region_tag_redraw(lcd->region);
-        handled = true;
-      } break;
+          ED_region_tag_redraw(lcd->region);
+          handled = true;
+        }
+        break;
+      }
     }
 
     /* Modal numinput inactive, try to handle numeric inputs last... */



More information about the Bf-blender-cvs mailing list