diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-04 14:00:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-04 19:40:33 +0300 |
commit | c43443d530bff67693dc2db4efdca6307703ce61 (patch) | |
tree | 40305a5fe154a25387c3fd3afcbfc560346bf383 /source/blender/makesrna | |
parent | 4e2228525fc9bbcff58e315c5e3bbc193cd63a0b (diff) |
Workspaces: store view layer per main window, instead of per workspace.
It was a bit odd that the scene was stored per window but not the view
layer. The reasoning was that you would use different view layers for
different tasks. This is still possible, but it's more predictable to
switch them both explicitly, and with child window support manually
syncing the view layers between multiple windows is no longer needed
as often.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 26c281ad9e1..0a8ea99b8fb 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -148,8 +148,7 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain, Scene *s Object *obedit = NULL; { - WorkSpace *workspace = WM_window_get_active_workspace(win); - ViewLayer *view_layer = BKE_workspace_view_layer_get(workspace, scene); + ViewLayer *view_layer = WM_window_get_active_view_layer(win); obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); } diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 569bc20d435..7dc8ab54800 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -773,8 +773,8 @@ static void rna_workspace_screen_update(bContext *C, PointerRNA *ptr) static PointerRNA rna_Window_view_layer_get(PointerRNA *ptr) { wmWindow *win = ptr->data; - Scene *scene; - ViewLayer *view_layer = WM_window_get_active_view_layer_ex(win, &scene); + Scene *scene = WM_window_get_active_scene(win);; + ViewLayer *view_layer = WM_window_get_active_view_layer(win); PointerRNA scene_ptr; RNA_id_pointer_create(&scene->id, &scene_ptr); @@ -784,10 +784,9 @@ static PointerRNA rna_Window_view_layer_get(PointerRNA *ptr) static void rna_Window_view_layer_set(PointerRNA *ptr, PointerRNA value) { wmWindow *win = ptr->data; - Scene *scene = WM_window_get_active_scene(win); - WorkSpace *workspace = WM_window_get_active_workspace(win); + ViewLayer *view_layer = value.data; - BKE_workspace_view_layer_set(workspace, value.data, scene); + WM_window_set_active_view_layer(win, view_layer); } static PointerRNA rna_KeyMapItem_properties_get(PointerRNA *ptr) |