3D View: add back clipping border operator
authorCampbell Barton <ideasman42@gmail.com>
Mon, 21 Jan 2019 00:05:15 +0000 (11:05 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 21 Jan 2019 00:05:15 +0000 (11:05 +1100)
release/scripts/presets/keyconfig/keymap_data/blender_default.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/windowmanager/intern/wm_operators.c

index 9a16f253c12791ece8969ca871680b2d96daba8f..7525841e71b883f2b2ebab1906bbe65aa139d191 100644 (file)
@@ -1035,7 +1035,7 @@ def km_view3d(params):
          {"properties": [("mode", 'SUB')]}),
         ("view3d.select_circle", {"type": 'C', "value": 'PRESS'}, None),
         # Borders.
-        ("view3d.clip_border", {"type": 'B', "value": 'PRESS', "alt": True}, None),
+        ("view3d.clip_border", {"type": 'B', "value": 'PRESS', "alt": True}, None),
         ("view3d.zoom_border", {"type": 'B', "value": 'PRESS', "shift": True}, None),
         ("view3d.render_border", {"type": 'B', "value": 'PRESS', "ctrl": True}, None),
         ("view3d.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True}, None),
index 067309b1277f7501d750d5ca78c2f85a54a6f452..f0bbc1d39dcf843d2f7916ea116a3f4672ff50e2 100644 (file)
@@ -784,7 +784,7 @@ class VIEW3D_MT_view_borders(Menu):
 
     def draw(self, context):
         layout = self.layout
-        layout.operator("view3d.clip_border", text="Clipping Border...")
+        layout.operator("view3d.clip_border", text="Clipping Border...")
         layout.operator("view3d.render_border", text="Render Border...")
 
         layout.separator()
index 7a368d2ca027f1ce4975a98e4d370903f7f65392..1a8330acf4a405e272a3888d9b1dcbc358092414 100644 (file)
@@ -4565,9 +4565,6 @@ void ED_view3d_clipping_local(RegionView3D *rv3d, float mat[4][4])
                calc_local_clipping(rv3d->clip_local, rv3d->clipbb, mat);
 }
 
-#if 0 /* TODO Missing from 2.8 drawing code.
-       * Find a solution to support clip border then uncomment it. */
-
 static int view3d_clipping_exec(bContext *C, wmOperator *op)
 {
        ARegion *ar = CTX_wm_region(C);
@@ -4624,7 +4621,6 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
        /* properties */
        WM_operator_properties_border(ot);
 }
-#endif
 
 /** \} */
 
index dfb1f389d37cf4f97232e6097cad28ea840c4619..c84bd039012ffd3da9c968cccfce0d458c985eea 100644 (file)
@@ -97,7 +97,7 @@ void VIEW3D_OT_background_image_add(struct wmOperatorType *ot);
 void VIEW3D_OT_background_image_remove(struct wmOperatorType *ot);
 void VIEW3D_OT_view_orbit(struct wmOperatorType *ot);
 void VIEW3D_OT_view_roll(struct wmOperatorType *ot);
-// void VIEW3D_OT_clip_border(struct wmOperatorType *ot);
+void VIEW3D_OT_clip_border(struct wmOperatorType *ot);
 void VIEW3D_OT_cursor3d(struct wmOperatorType *ot);
 void VIEW3D_OT_render_border(struct wmOperatorType *ot);
 void VIEW3D_OT_clear_render_border(struct wmOperatorType *ot);
index 46a00ffeacf4a9790ad56ebec0433cf9c7ad7b41..bb064ea18a313498b588930f780dc80bd130a451 100644 (file)
@@ -192,7 +192,7 @@ void view3d_operatortypes(void)
        WM_operatortype_append(VIEW3D_OT_view_center_lock);
        WM_operatortype_append(VIEW3D_OT_select);
        WM_operatortype_append(VIEW3D_OT_select_box);
-       // WM_operatortype_append(VIEW3D_OT_clip_border);
+       WM_operatortype_append(VIEW3D_OT_clip_border);
        WM_operatortype_append(VIEW3D_OT_select_circle);
        WM_operatortype_append(VIEW3D_OT_smoothview);
        WM_operatortype_append(VIEW3D_OT_render_border);
index 23ce13722fb0716b22a7b976c15f51dd0eef84e2..0f2e6a18af404dfcf62725538625712be63cff42 100644 (file)
@@ -3310,7 +3310,7 @@ static void gesture_box_modal_keymap(wmKeyConfig *keyconf)
        WM_modalkeymap_assign(keymap, "CLIP_OT_graph_select_box");
        WM_modalkeymap_assign(keymap, "MASK_OT_select_box");
        WM_modalkeymap_assign(keymap, "VIEW2D_OT_zoom_border");
-//     WM_modalkeymap_assign(keymap, "VIEW3D_OT_clip_border"); /* TODO */
+       WM_modalkeymap_assign(keymap, "VIEW3D_OT_clip_border");
        WM_modalkeymap_assign(keymap, "VIEW3D_OT_render_border");
        WM_modalkeymap_assign(keymap, "VIEW3D_OT_select_box");
        WM_modalkeymap_assign(keymap, "VIEW3D_OT_zoom_border"); /* XXX TODO: zoom border should perhaps map rightmouse to zoom out instead of in+cancel */