diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 14 |
2 files changed, 4 insertions, 13 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 78163fa4e1d..e8da5118532 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -523,6 +523,9 @@ static int editmode_toggle_poll(bContext *C) /* covers proxies too */ if(ELEM(NULL, ob, ob->data) || ((ID *)ob->data)->lib) return 0; + + if (ob && (ob->restrictflag & OB_RESTRICT_VIEW)) + return 0; return ob && (ob->type == OB_MESH || ob->type == OB_ARMATURE || ob->type == OB_FONT || ob->type == OB_MBALL || diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 799a4200ecf..a443539eace 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -2496,19 +2496,7 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene); } else if(ELEM5(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) { - Object *obedit= CTX_data_edit_object(C); - if(obedit) - ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO); - else { - Object *ob= CTX_data_active_object(C); - - /* Don't allow edit mode if the object is hide! - * check the bug #22153 and #21609 - */ - if (ob && (!(ob->restrictflag & OB_RESTRICT_VIEW))) - ED_object_enter_editmode(C, EM_WAITCURSOR); - // XXX extern_set_butspace(F9KEY, 0); - } + WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL); } else { // rest of types tree_element_active(C, scene, soops, te, 1); } |