diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-18 21:40:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-18 21:43:26 +0300 |
commit | 0d8b92267d804e4ad8199e77c8a19a6d90d49dac (patch) | |
tree | b02b2e6b52c1b61efc5030bb3d5674fadbfeffff /source/blender/editors/space_outliner | |
parent | 9fb59244466aa07c9addaf17bdb65192682bde87 (diff) |
Object Mode: make mode locking optional
Design from T55246 is kept while allowing 2.7x behavior.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index f2ba00190e0..6a6a392e4a6 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -255,22 +255,22 @@ static eOLDrawState tree_element_set_active_object( /* find associated base in current scene */ base = BKE_view_layer_base_find(view_layer, ob); -#ifdef USE_OBJECT_MODE_STRICT - if (base != NULL) { - Object *obact = OBACT(view_layer); - const eObjectMode object_mode = obact ? obact->mode : OB_MODE_OBJECT; - if (base && !BKE_object_is_mode_compat(base->object, object_mode)) { - if (object_mode == OB_MODE_OBJECT) { - struct Main *bmain = CTX_data_main(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); - ED_object_mode_generic_exit(bmain, depsgraph, scene, base->object); - } - if (!BKE_object_is_mode_compat(base->object, object_mode)) { - base = NULL; + if (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) { + if (base != NULL) { + Object *obact = OBACT(view_layer); + const eObjectMode object_mode = obact ? obact->mode : OB_MODE_OBJECT; + if (base && !BKE_object_is_mode_compat(base->object, object_mode)) { + if (object_mode == OB_MODE_OBJECT) { + struct Main *bmain = CTX_data_main(C); + Depsgraph *depsgraph = CTX_data_depsgraph(C); + ED_object_mode_generic_exit(bmain, depsgraph, scene, base->object); + } + if (!BKE_object_is_mode_compat(base->object, object_mode)) { + base = NULL; + } } } } -#endif if (base) { if (set == OL_SETSEL_EXTEND) { @@ -282,13 +282,11 @@ static eOLDrawState tree_element_set_active_object( } else { /* deleselect all */ -#ifdef USE_OBJECT_MODE_STRICT + /* Only in object mode so we can switch the active object, * keeping all objects in the current 'mode' selected, useful for multi-pose/edit mode. * This keeps the convention that all objects in the current mode are also selected. see T55246. */ - if (ob->mode == OB_MODE_OBJECT) -#endif - { + if ((scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) ? (ob->mode == OB_MODE_OBJECT) : true) { BKE_view_layer_base_deselect_all(view_layer); } ED_object_base_select(base, BA_SELECT); |