diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-27 16:07:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-27 16:08:49 +0300 |
commit | 3cc4070a30ea2f4eb9de4b4679a29e6aa9807dbb (patch) | |
tree | 0619ec0b47d4af90f15dce9314c8f40519d8fd0a /source/blender/makesrna/intern/rna_wm.c | |
parent | 12c8fef8c7259bfdae367900f5a85f9b42e8d541 (diff) |
Fix T54179: Assert changing layers in 2nd window
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index dca4fa3822d..e827a099f5b 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -785,11 +785,10 @@ static void rna_Window_view_layer_update(struct bContext *C, PointerRNA *ptr) Scene *scene = WM_window_get_active_scene(win); WorkSpace *workspace = WM_window_get_active_workspace(win); ViewLayer *view_layer = BKE_workspace_view_layer_get(workspace, scene); - Object *obedit = CTX_data_edit_object(C); - + Object *obact = OBACT(view_layer); eObjectMode object_mode = workspace->object_mode; - if (obedit) { - ED_object_editmode_exit(C, EM_FREEDATA); + if (obact && (object_mode & OB_MODE_EDIT)) { + ED_object_editmode_exit_ex(NULL, workspace, scene, obact, EM_FREEDATA); } workspace->object_mode = object_mode; ED_object_base_activate(C, view_layer->basact); |