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:
authorJulian Eisel <julian@blender.org>2022-07-07 18:51:18 +0300
committerJulian Eisel <julian@blender.org>2022-07-07 19:08:18 +0300
commite0cc86978c0f72f57240214ccb6bc7fe71428827 (patch)
tree83e4dd74cc92adff699e2588fb28118212ec0dfd /source/blender/makesdna
parentf9a805164a944c3b5762f07e535536b9f425651f (diff)
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)
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h3
-rw-r--r--source/blender/makesdna/DNA_workspace_types.h5
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index f7aaa1186db..5e741508603 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -239,6 +239,9 @@ typedef struct wmWindow {
struct Scene *new_scene;
/** Active view layer displayed in this window. */
char view_layer_name[64];
+ /** The workspace may temporarily override the window's scene with scene pinning. This is the
+ * "overriden" or "default" scene to restore when entering a workspace with no scene pinned. */
+ struct Scene *unpinned_scene;
struct WorkSpaceInstanceHook *workspace_hook;
diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
index b8ed39bfd5d..a72689badb1 100644
--- a/source/blender/makesdna/DNA_workspace_types.h
+++ b/source/blender/makesdna/DNA_workspace_types.h
@@ -123,6 +123,10 @@ typedef struct WorkSpace {
/** List of #bToolRef */
ListBase tools;
+ /** Optional, scene to switch to when enabling this workspace (NULL to disable). Cleared on
+ * link/append. */
+ struct Scene *pin_scene;
+
char _pad[4];
int object_mode;
@@ -195,6 +199,7 @@ typedef struct WorkSpaceInstanceHook {
typedef enum eWorkSpaceFlags {
WORKSPACE_USE_FILTER_BY_ORIGIN = (1 << 1),
+ WORKSPACE_USE_PIN_SCENE = (1 << 2),
} eWorkSpaceFlags;
#ifdef __cplusplus