From e0cc86978c0f72f57240214ccb6bc7fe71428827 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 7 Jul 2022 17:51:18 +0200 Subject: Workspaces: Option to pin scene to a workspace Adds a "Pin Scene" option to the workspace. When activated, the workspace will remember the scene that was last activated in it, so that when switching back to this workspace, the same scene will be reactivated. This is important for a VSE workflow, so that users can switch between different workspaces displaying a scene and thus a timeline for a specific task. The option can be found in the Properties, Workspace tab. D11890 additionally adds an icon for this to the scene switcher in the topbar. The workspace data contains a pointer to the scene which is a UI to scene data relation. When appending a workspace, the pointer is cleared. Differential Revision: https://developer.blender.org/D9140 Reviewed by: Brecht Van Lommel, Bastien Montagne (no final accept, but was fine with the general design earlier) --- source/blender/blenloader/intern/readfile.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 973965ada50..f0d390677bb 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2732,6 +2732,8 @@ void blo_lib_link_restore(Main *oldmain, LISTBASE_FOREACH (WorkSpaceLayout *, layout, &workspace->layouts) { lib_link_workspace_layout_restore(id_map, newmain, layout); } + workspace->pin_scene = restore_pointer_by_name( + id_map, (ID *)workspace->pin_scene, USER_IGNORE); } LISTBASE_FOREACH (wmWindow *, win, &curwm->windows) { @@ -2745,6 +2747,7 @@ void blo_lib_link_restore(Main *oldmain, if (win->scene == NULL) { win->scene = curscene; } + win->unpinned_scene = restore_pointer_by_name(id_map, (ID *)win->unpinned_scene, USER_IGNORE); if (BKE_view_layer_find(win->scene, win->view_layer_name) == NULL) { STRNCPY(win->view_layer_name, cur_view_layer->name); } -- cgit v1.2.3