[Bf-blender-cvs] [f190f2d267d] master: Revert fixes

Germano Cavalcante noreply at git.blender.org
Thu Nov 18 18:20:05 CET 2021


Commit: f190f2d267df46d25d74009a3c14ac10753d57ca
Author: Germano Cavalcante
Date:   Thu Nov 18 14:19:59 2021 -0300
Branches: master
https://developer.blender.org/rBf190f2d267df46d25d74009a3c14ac10753d57ca

Revert fixes

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

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform.h
M	source/blender/editors/transform/transform_convert_node.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_input.c
M	source/blender/editors/transform/transform_ops.c
M	source/blender/editors/transform/transform_snap.c
M	source/blender/editors/transform/transform_snap.h
M	source/blender/editors/transform/transform_snap_object.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_operator_utils.c
M	source/blender/windowmanager/wm_event_system.h

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

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index a7e33c83403..dbc93cb6caa 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -5606,7 +5606,6 @@ def km_transform_modal_map(_params):
         ("AUTOCONSTRAINPLANE", {"type": 'MIDDLEMOUSE', "value": 'ANY', "shift": True}, None),
         ("PRECISION", {"type": 'LEFT_SHIFT', "value": 'ANY', "any": True}, None),
         ("PRECISION", {"type": 'RIGHT_SHIFT', "value": 'ANY', "any": True}, None),
-        ("EDIT_SNAP_SOURCE", {"type": 'B', "value": 'PRESS'}, None),
     ])
 
     return keymap
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index dd4e0afc869..37cd554e872 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -3997,7 +3997,6 @@ def km_transform_modal_map(_params):
         ("AUTOCONSTRAINPLANE", {"type": 'MIDDLEMOUSE', "value": 'ANY', "shift": True}, None),
         ("PRECISION", {"type": 'LEFT_SHIFT', "value": 'ANY', "any": True}, None),
         ("PRECISION", {"type": 'RIGHT_SHIFT', "value": 'ANY', "any": True}, None),
-        ("EDIT_SNAP_SOURCE", {"type": 'B', "value": 'PRESS'}, None),
     ])
 
     return keymap
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 93f01cbe139..5032256e4d1 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2292,16 +2292,8 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
                 ({"property": "use_sculpt_tools_tilt"}, "T82877"),
                 ({"property": "use_extended_asset_browser"}, ("project/view/130/", "Project Page")),
                 ({"property": "use_override_templates"}, ("T73318", "Milestone 4")),
-                ({"property": "use_navigate_while_transform"}, ("T73993", "Milestone 2")),
             ),
         )
-        experimental = context.preferences.experimental
-
-        if experimental.use_navigate_while_transform:
-            split = self.layout.split(factor=0.66)
-            row = split.split()
-            row.operator("transform.modalkeymap_update")
-            row.operator("transform.modalkeymap_restore")
 
 
 class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel):
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 51167b327d6..ae4c3f02c46 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -108,6 +108,9 @@ void setTransformViewMatrices(TransInfo *t)
     unit_m4(t->persinv);
     t->persp = RV3D_ORTHO;
   }
+
+  calculateCenter2D(t);
+  calculateCenterLocal(t, t->center_global);
 }
 
 void setTransformViewAspect(TransInfo *t, float r_aspect[3])
@@ -575,21 +578,6 @@ static void viewRedrawPost(bContext *C, TransInfo *t)
 static bool transform_modal_item_poll(const wmOperator *op, int value)
 {
   const TransInfo *t = op->customdata;
-  if (t->modifiers & MOD_EDIT_SNAP_SOURCE) {
-    if (value == TFM_MODAL_EDIT_SNAP_SOURCE) {
-      return true;
-    }
-    else if (!ELEM(value,
-                   TFM_MODAL_CANCEL,
-                   TFM_MODAL_CONFIRM,
-                   TFM_MODAL_SNAP_INV_ON,
-                   TFM_MODAL_SNAP_INV_OFF,
-                   TFM_MODAL_ADD_SNAP,
-                   TFM_MODAL_REMOVE_SNAP)) {
-      return false;
-    }
-  }
-
   switch (value) {
     case TFM_MODAL_CANCEL: {
       /* TODO: Canceling with LMB is not possible when the operator is activated
@@ -605,13 +593,6 @@ static bool transform_modal_item_poll(const wmOperator *op, int value)
       }
       break;
     }
-    case TFM_MODAL_SNAP_INV_ON:
-    case TFM_MODAL_SNAP_INV_OFF: {
-      if (t->modifiers & MOD_SNAP_TEMP) {
-        return false;
-      }
-      break;
-    }
     case TFM_MODAL_ADD_SNAP:
     case TFM_MODAL_REMOVE_SNAP: {
       if (t->spacetype != SPACE_VIEW3D) {
@@ -683,19 +664,6 @@ static bool transform_modal_item_poll(const wmOperator *op, int value)
       }
       break;
     }
-    case TFM_MODAL_EDIT_SNAP_SOURCE: {
-      if (t->spacetype != SPACE_VIEW3D) {
-        return false;
-      }
-      if (t->flag & T_RELEASE_CONFIRM) {
-        return false;
-      }
-      if (!ELEM(t->mode, TFM_TRANSLATION, TFM_ROTATION, TFM_RESIZE)) {
-        /* More modes can be added over time if this feature proves useful for them. */
-        return false;
-      }
-      break;
-    }
   }
   return true;
 }
@@ -746,7 +714,6 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf)
       {TFM_MODAL_AUTOCONSTRAINT, "AUTOCONSTRAIN", 0, "Automatic Constraint", ""},
       {TFM_MODAL_AUTOCONSTRAINTPLANE, "AUTOCONSTRAINPLANE", 0, "Automatic Constraint Plane", ""},
       {TFM_MODAL_PRECISION, "PRECISION", 0, "Precision Mode", ""},
-      {TFM_MODAL_EDIT_SNAP_SOURCE, "EDIT_SNAP_SOURCE", 0, "Snap Source Toggle", ""},
       {0, NULL, 0, NULL, NULL},
   };
 
@@ -899,6 +866,8 @@ int transformEvent(TransInfo *t, const wmEvent *event)
       t->con.mode |= CON_SELECT;
     }
 
+    copy_v2_v2_int(t->mval, event->mval);
+
     /* Use this for soft redraw. Might cause flicker in object mode */
     // t->redraw |= TREDRAW_SOFT;
     t->redraw |= TREDRAW_HARD;
@@ -922,12 +891,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
         handled = true;
         break;
       case TFM_MODAL_CONFIRM:
-        if (t->modifiers & MOD_EDIT_SNAP_SOURCE) {
-          tranform_snap_source_mod_confirm(t);
-        }
-        else {
-          t->state = TRANS_CONFIRM;
-        }
+        t->state = TRANS_CONFIRM;
         handled = true;
         break;
       case TFM_MODAL_TRANSLATE:
@@ -1192,9 +1156,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
           t->redraw |= TREDRAW_HARD;
         }
         break;
-      case TFM_MODAL_EDIT_SNAP_SOURCE:
-        tranform_snap_source_mod_toggle(t);
-        break;
       /* Those two are only handled in transform's own handler, see T44634! */
       case TFM_MODAL_EDGESLIDE_UP:
       case TFM_MODAL_EDGESLIDE_DOWN:
@@ -1571,7 +1532,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
 
   if (t->flag & T_MODAL) {
     /* do we check for parameter? */
-    if (transformModeUseSnap(t) && !(t->modifiers & MOD_SNAP_TEMP)) {
+    if (transformModeUseSnap(t)) {
       if (!(t->modifiers & MOD_SNAP) != !(ts->snap_flag & SCE_SNAP)) {
         if (t->modifiers & MOD_SNAP) {
           ts->snap_flag |= SCE_SNAP;
@@ -1959,17 +1920,14 @@ void transformApply(bContext *C, TransInfo *t)
 
   if ((t->redraw & TREDRAW_HARD) || (t->draw_handle_apply == NULL && (t->redraw & TREDRAW_SOFT))) {
     selectConstraint(t);
-    if (t->modifiers & MOD_EDIT_SNAP_SOURCE) {
-      tranform_snap_source_mod_update(t);
-    }
-    else if (t->transform) {
+    if (t->transform) {
       t->transform(t, t->mval); /* calls recalcData() */
+      viewRedrawForce(C, t);
     }
+    t->redraw = TREDRAW_NOTHING;
   }
-
-  if (t->redraw & (TREDRAW_HARD | TREDRAW_SOFT)) {
+  else if (t->redraw & TREDRAW_SOFT) {
     viewRedrawForce(C, t);
-    t->redraw = TREDRAW_NOTHING;
   }
 
   /* If auto confirm is on, break after one pass */
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 9046f1970a3..d78cd13f8b8 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -155,9 +155,6 @@ typedef enum {
 
   /** No cursor wrapping on region bounds */
   T_NO_CURSOR_WRAP = 1 << 23,
-
-  /** To indicate that V3D matrices have changed due to navigation. */
-  T_VIEW_DIRTY = 1 << 24,
 } eTFlag;
 
 /** #TransInfo.modifiers */
@@ -166,9 +163,7 @@ typedef enum {
   MOD_PRECISION = 1 << 1,
   MOD_SNAP = 1 << 2,
   MOD_SNAP_INVERT = 1 << 3,
-  MOD_SNAP_TEMP = 1 << 4,
-  MOD_CONSTRAINT_SELECT_PLANE = 1 << 5,
-  MOD_EDIT_SNAP_SOURCE = 1 << 6,
+  MOD_CONSTRAINT_SELECT_PLANE = 1 << 4,
 } eTModifier;
 
 /** #TransSnap.status */
@@ -299,8 +294,6 @@ enum {
   TFM_MODAL_AUTOCONSTRAINTPLANE = 29,
 
   TFM_MODAL_PRECISION = 30,
-
-  TFM_MODAL_EDIT_SNAP_SOURCE = 31,
 };
 
 /** \} */
@@ -768,8 +761,6 @@ void applyMouseInput(struct TransInfo *t,
                      struct MouseInput *mi,
                      const int mval[2],
                      float output[3]);
-void transform_input_reset(MouseInput *mi, const int mval[2]);
-void transform_input_update(TransInfo *t, const float fac);
 
 void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]);
 void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2]);
@@ -802,7 +793,6 @@ void calculateCenter2D(TransInfo *t);
 void calculateCenterLocal(TransInfo *t, const float center_global[3]);
 
 void calculateCenter(TransInfo *t);
-void tranformViewUpdate(TransInfo *t);
 
 /* API functions for getting center points */
 void calculateCenterBound(TransInfo *t, float r_center[3]);
diff --git a/source/blender/editors/transform/transform_convert_node.c b/source/blender/editors/transform/transform_convert_node.c
index 10c0ee48749..da11666d445 100644
--- a/source/blender/editors/transform/transform_convert_node.c
+++ b/source/blender/editors/transform/transform_convert_node.c
@@ -164,7 +164,6 @@ void createTransNodeData(TransInfo *t)
 void flushTransNodes(TransInfo *t)
 {
   const float dpi_fac = UI_DPI_FAC;
-  float offset[2] = {0.0f, 0.0f};
 
   View2DEdgePanData *customdata = (View2DEdgePanData *)t->custom.type.data;
 
@@ -178,16 +177,14 @@ void flushTransNodes(TransInfo *t)
           t->region->winrct.xmin + t->mval[0],
           t->region->winrct.ymin + t->mval[1],
       };
-      const rctf rect = t->region->v2d.cur;
       UI_view2d_edge_pan_apply(t->context, customdata, xy);
-      if (!BLI_rctf_compare(&rect, &t->region->v2d.cur, FLT_EPSILON)) {
-        /* Additional offset due to chang

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list