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/editors/space_buttons/buttons_texture.c | |
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/editors/space_buttons/buttons_texture.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_texture.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 5feb74edef7..66684de18ac 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -49,6 +49,7 @@ #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_linestyle_types.h" +#include "DNA_windowmanager_types.h" #include "BKE_context.h" #include "BKE_layer.h" @@ -72,6 +73,8 @@ #include "ED_node.h" #include "ED_screen.h" +#include "WM_api.h" + #include "../interface/interface_intern.h" #include "buttons_intern.h" // own include @@ -176,8 +179,10 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext * const ID_Type id_type = pinid != NULL ? GS(pinid->name) : -1; if (!pinid || id_type == ID_SCE) { - WorkSpace *workspace = CTX_wm_workspace(C); - ViewLayer *view_layer = BKE_workspace_view_layer_get(workspace, scene); + wmWindow *win = CTX_wm_window(C); + ViewLayer *view_layer = (win->scene == scene) ? + WM_window_get_active_view_layer(win) : + BKE_view_layer_default_view(scene); brush = BKE_paint_brush(BKE_paint_get_active_from_context(C)); linestyle = BKE_linestyle_active_from_view_layer(view_layer); |