Tool System: add a mode option to 3D view circle select
authorCampbell Barton <ideasman42@gmail.com>
Fri, 1 Mar 2019 12:18:34 +0000 (23:18 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 1 Mar 2019 12:21:24 +0000 (23:21 +1100)
Support only basic operations: new/add/subtract.

release/scripts/presets/keyconfig/keymap_data/blender_default.py
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
source/blender/editors/space_view3d/view3d_select.c

index c88aff33fd35315aded466eb00e43586c433d68f..05a6a5fa7c79869f832ac2292c2e36e108549994 100644 (file)
@@ -5223,8 +5223,10 @@ def km_3d_view_tool_select_circle(params):
         {"items": [
             ("view3d.select_circle", {"type": params.tool_mouse, "value": 'PRESS'},
              {"properties": [("wait_for_input", False)]}),
+            ("view3d.select_circle", {"type": params.tool_mouse, "value": 'PRESS', "shift": True},
+             {"properties": [("wait_for_input", False), ("mode", 'ADD')]}),
             ("view3d.select_circle", {"type": params.tool_mouse, "value": 'PRESS', "ctrl": True},
-             {"properties": [("wait_for_input", False), ("deselect", True)]}),
+             {"properties": [("wait_for_input", False), ("mode", 'SUB')]}),
         ]},
     )
 
index 35d6ee5a8bcc83a47619f0f6b29644103754f89e..4dfaa598c2ea1340b798d091fafd3c5d5c60fd20 100644 (file)
@@ -342,6 +342,7 @@ class _defs_view3d_select:
     def circle():
         def draw_settings(context, layout, tool):
             props = tool.operator_properties("view3d.select_circle")
+            layout.prop(props, "mode", expand=True)
             layout.prop(props, "radius")
 
         def draw_cursor(context, tool, xy):
index 70ff606500714d43967eac4d70f2fbdb7226d4b8..bf30f90392973051712019503ae4347de207f055 100644 (file)
@@ -3353,8 +3353,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
        ViewContext vc;
        const bool is_first = (op->customdata && (((wmGesture *)op->customdata)->is_active_prev == false));
        const int radius = RNA_int_get(op->ptr, "radius");
-       const bool select = !RNA_boolean_get(op->ptr, "deselect");
-       eSelectOp sel_op = select ? SEL_OP_ADD : SEL_OP_SUB;
+       eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
        const int mval[2] = {RNA_int_get(op->ptr, "x"),
                             RNA_int_get(op->ptr, "y")};
 
@@ -3436,7 +3435,8 @@ void VIEW3D_OT_select_circle(wmOperatorType *ot)
        ot->flag = OPTYPE_UNDO;
 
        /* properties */
-       WM_operator_properties_gesture_circle_select(ot);
+       WM_operator_properties_gesture_circle(ot);
+       WM_operator_properties_select_operation_simple(ot);
 }
 
 /** \} */