diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-14 07:43:24 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-14 07:50:06 +0300 |
commit | d7dd7403a8137e1043df4443898a677291726f0e (patch) | |
tree | 9396529101a8a1e2ea7f3ff0b3db8727943c2574 /source/blender/editors | |
parent | 541ba689913e8359216a61a67a60425837af88a9 (diff) |
WM: avoid hard coded modifier key checks in object.hide_collection
These checks aren't always valid when there are multiple events
in the queue.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 82b14787d9b..0f47a692787 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -338,17 +338,12 @@ void OBJECT_OT_hide_view_set(wmOperatorType *ot) static int object_hide_collection_exec(bContext *C, wmOperator *op) { - wmWindow *win = CTX_wm_window(C); View3D *v3d = CTX_wm_view3d(C); int index = RNA_int_get(op->ptr, "collection_index"); - const bool extend = (win->eventstate->modifier & KM_SHIFT) != 0; + const bool extend = RNA_boolean_get(op->ptr, "extend"); const bool toggle = RNA_boolean_get(op->ptr, "toggle"); - if (win->eventstate->modifier & KM_ALT) { - index += 10; - } - Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); LayerCollection *lc = BKE_layer_collection_from_index(view_layer, index); @@ -467,6 +462,8 @@ void OBJECT_OT_hide_collection(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); prop = RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", "Toggle visibility"); RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); + prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend visibility"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); } /** \} */ |