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-03 16:34:26 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-04 19:40:33 +0300
commit4e2228525fc9bbcff58e315c5e3bbc193cd63a0b (patch)
tree20138d75e3185172eabe84a31ee49b6ec990fcfc /source/blender/editors/scene/scene_edit.c
parent2bef8ca1b8e0e51f1e09216d2a42f7fc0b7d723a (diff)
Workspaces: add main and child windows.
* Main windows show a topbar and statusbar, and select a workspace and scene. They are created with Window > New Main Window. * Child windows do not show a topbar or statusbar. These follow the workspace and scene of their parent main window. Created with Window > New Window or View > Duplicate Area into New Window. * The purpose of this change is to support multi monitor setups where you just want to put more editors on the other monitors. Without multiple topbars and statusbars, working within a single workspace and scene. Creating multiple main windows is intended to be a concious choice to do different tasks in different workspaces and scenes. * Note these changes do not currently affect how the operating system treats the windows. * When changing the workspace, the layout in all child windows changes. This makes sense if we consider child windows to be just a way to extend the main window across more monitors. In some case it may be useful to keep the same layout though, we can add an option for this depending on user feedback.
Diffstat (limited to 'source/blender/editors/scene/scene_edit.c')
-rw-r--r--source/blender/editors/scene/scene_edit.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c
index 677fc0a068e..0ebbd770c9f 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -80,7 +80,7 @@ Scene *ED_scene_add(Main *bmain, bContext *C, wmWindow *win, eSceneCopyMethod me
}
}
- WM_window_change_active_scene(bmain, C, win, scene_new);
+ WM_window_set_active_scene(bmain, C, win, scene_new);
WM_event_add_notifier(C, NC_SCENE | ND_SCENEBROWSE, scene_new);
@@ -102,7 +102,7 @@ bool ED_scene_delete(bContext *C, Main *bmain, wmWindow *win, Scene *scene)
else
return false;
- WM_window_change_active_scene(bmain, C, win, scene_new);
+ WM_window_set_active_scene(bmain, C, win, scene_new);
BKE_libblock_remap(bmain, scene, scene_new, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_NEVER_NULL_USAGE);
@@ -114,43 +114,17 @@ bool ED_scene_delete(bContext *C, Main *bmain, wmWindow *win, Scene *scene)
return true;
}
-static ViewLayer *scene_change_get_new_view_layer(const WorkSpace *workspace, const Scene *scene_new)
+/* Depsgraph updates after scene becomes active in a window. */
+void ED_scene_change_update(Main *bmain, Scene *scene, ViewLayer *layer)
{
- ViewLayer *layer_new = BKE_workspace_view_layer_exists(workspace, scene_new);
- return layer_new ? layer_new : BKE_view_layer_default_view(scene_new);
-}
+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, layer, true);
-void ED_scene_change_update(
- Main *bmain, bContext *C,
- wmWindow *win, const bScreen *screen, Scene *UNUSED(scene_old), Scene *scene_new)
-{
- WorkSpace *workspace = CTX_wm_workspace(C);
- ViewLayer *layer_new = scene_change_get_new_view_layer(workspace, scene_new);
- Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene_new, layer_new, true);
- Object *obact_new = OBACT(layer_new);
- UNUSED_VARS(obact_new);
-
-#if 0
- /* mode syncing */
- eObjectMode object_mode_old = workspace->object_mode;
- ViewLayer *layer_old = BKE_view_layer_from_workspace_get(scene_old, workspace);
- Object *obact_old = OBACT(layer_old);
- UNUSED_VARS(obact_old, object_mode_old);
-#endif
-
- win->scene = scene_new;
- CTX_data_scene_set(C, scene_new);
- BKE_workspace_view_layer_set(workspace, layer_new, scene_new);
- BKE_scene_set_background(bmain, scene_new);
- DEG_graph_relations_update(depsgraph, bmain, scene_new, layer_new);
+ BKE_scene_set_background(bmain, scene);
+ DEG_graph_relations_update(depsgraph, bmain, scene, layer);
DEG_on_visible_update(bmain, false);
- ED_screen_update_after_scene_change(screen, scene_new, layer_new);
ED_render_engine_changed(bmain);
ED_update_for_newframe(bmain, depsgraph);
-
- /* complete redraw */
- WM_event_add_notifier(C, NC_WINDOW, NULL);
}
static bool view_layer_remove_poll(