[Bf-blender-cvs] [b5d22f77e7c] soc-2019-outliner: Outliner: Cleanup range and box select
Nathan Craddock
noreply at git.blender.org
Fri Jun 7 06:56:19 CEST 2019
Commit: b5d22f77e7cac3a07e50379aec06ef36d3df60b9
Author: Nathan Craddock
Date: Thu Jun 6 22:25:05 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBb5d22f77e7cac3a07e50379aec06ef36d3df60b9
Outliner: Cleanup range and box select
Cleanup properties, keymap, code styling, and descriptions
===================================================================
M release/scripts/presets/keyconfig/keymap_data/blender_default.py
M source/blender/editors/space_outliner/outliner_select.c
===================================================================
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 742917d2724..3443ef90365 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -689,17 +689,17 @@ def km_outliner(params):
("outliner.highlight_update", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None),
("outliner.item_rename", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK'},
- {"properties": [("extend", False), ("range", False), ("recursive", False),
+ {"properties": [("extend", False), ("recursive", False),
("deselect_all", not params.legacy)]}),
("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True},
- {"properties": [("extend", True), ("range", False), ("recursive", False)]}),
+ {"properties": [("extend", True), ("recursive", False)]}),
("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True},
{"properties": [("extend", False), ("range", True), ("recursive", False)]}),
("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "alt": True},
- {"properties": [("extend", False), ("range", False), ("recursive", True)]}),
+ {"properties": [("extend", False), ("recursive", True)]}),
("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True, "alt": True},
- {"properties": [("extend", True), ("range", False), ("recursive", True)]}),
- ("outliner.select_box", {"type": 'B', "value": 'PRESS'}, {"properties": [("tweak", False)]}),
+ {"properties": [("extend", True), ("recursive", True)]}),
+ ("outliner.select_box", {"type": 'B', "value": 'PRESS'}, None),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, {"properties": [("tweak", True)]}),
("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'UP')]}),
("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'DOWN')]}),
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index ed35f2a6d1e..8e0a52c032e 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1318,7 +1318,7 @@ void outliner_item_do_activate_from_tree_element(
static int outliner_item_do_activate_from_cursor(bContext *C,
const int mval[2],
const bool extend,
- const bool range,
+ const bool use_range,
const bool recursive,
const bool deselect_all)
{
@@ -1354,7 +1354,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
TreeElement *activate_te = outliner_find_item_at_x_in_row(soops, te, view_mval[0]);
TreeStoreElem *activate_tselem = TREESTORE(activate_te);
- if (range) {
+ if (use_range) {
do_outliner_range_select(soops, activate_te);
}
else {
@@ -1383,11 +1383,11 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
static int outliner_item_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
const bool extend = RNA_boolean_get(op->ptr, "extend");
- const bool range = RNA_boolean_get(op->ptr, "range");
+ const bool use_range = RNA_boolean_get(op->ptr, "range");
const bool recursive = RNA_boolean_get(op->ptr, "recursive");
const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
return outliner_item_do_activate_from_cursor(
- C, event->mval, extend, range, recursive, deselect_all);
+ C, event->mval, extend, use_range, recursive, deselect_all);
}
void OUTLINER_OT_item_activate(wmOperatorType *ot)
@@ -1402,7 +1402,9 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
PropertyRNA *prop;
RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection for activation");
- RNA_def_boolean(ot->srna, "range", false, "Range", "Select a range from active element");
+ prop = RNA_def_boolean(ot->srna, "range", false, "Range", "Select a range from active element");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
RNA_def_boolean(ot->srna, "recursive", false, "Recursive", "Select Objects and their children");
prop = RNA_def_boolean(ot->srna,
"deselect_all",
@@ -1514,8 +1516,12 @@ void OUTLINER_OT_select_box(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(
- ot->srna, "tweak", true, "Tweak", "Click and drag from the gutter for box selection");
+ PropertyRNA *prop;
+
+ prop = RNA_def_boolean(
+ ot->srna, "tweak", false, "Tweak", "Tweak gesture from empty space for box selection");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
WM_operator_properties_gesture_box(ot);
WM_operator_properties_select_operation_simple(ot);
}
More information about the Bf-blender-cvs
mailing list