Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-04 14:00:46 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-04 19:40:33 +0300
commitc43443d530bff67693dc2db4efdca6307703ce61 (patch)
tree40305a5fe154a25387c3fd3afcbfc560346bf383 /source/blender/editors/scene
parent4e2228525fc9bbcff58e315c5e3bbc193cd63a0b (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/scene')
-rw-r--r--source/blender/editors/scene/scene_edit.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c
index 0ebbd770c9f..62933178266 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -23,9 +23,11 @@
*/
#include <stdio.h>
+#include <string.h>
#include "BLI_compiler_attrs.h"
#include "BLI_listbase.h"
+#include "BLI_string.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -175,12 +177,17 @@ bool ED_scene_view_layer_delete(
BLI_remlink(&scene->view_layers, layer);
BLI_assert(BLI_listbase_is_empty(&scene->view_layers) == false);
- ED_workspace_view_layer_unset(bmain, scene, layer, scene->view_layers.first);
+ /* Remove from windows. */
+ wmWindowManager *wm = bmain->wm.first;
+ for (wmWindow *win = wm->windows.first; win; win = win->next) {
+ if (win->scene == scene && STREQ(win->view_layer_name, layer->name)) {
+ ViewLayer *first_layer = BKE_view_layer_default_view(scene);
+ STRNCPY(win->view_layer_name, first_layer->name);
+ }
+ }
BKE_view_layer_free(layer);
- BKE_workspace_view_layer_remove(bmain, layer);
-
DEG_id_tag_update(&scene->id, 0);
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_SCENE | ND_LAYER | NA_REMOVED, scene);