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 <eiseljulian@gmail.com>2017-12-01 17:47:24 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-12-01 18:15:30 +0300
commite8c15e0ed15f8369d0d0f706b4953fb64e357902 (patch)
tree0eb072454c535b438caf8eed3033d27b3c17e99b /source/blender/blenkernel/BKE_workspace.h
parent983b1a34783e9600731b973ba52ecc8924bff169 (diff)
Workspaces: Store an active view-layer per scene
Instead of storing a single active view-layer in the workspace, one is stored for each scene the workspace showed before. With this, some things become possible: * Multiple windows in the same workspace but showing different scenes. * Toggling back and forth scene keeps same active view-layer for each scene. * Activating workspace which didn't show current scene before, the current view-layer is kept. A necessary evil for this is that accessing view-layer and object mode from .py can't be done via workspace directly anymore. It has to be done through the window, so RNA can use the correct scene. So instead of `workspace.view_layer`, it's `window.view_layer` now (same with mode) even though it's still workspace data. Fixes T53432.
Diffstat (limited to 'source/blender/blenkernel/BKE_workspace.h')
-rw-r--r--source/blender/blenkernel/BKE_workspace.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_workspace.h b/source/blender/blenkernel/BKE_workspace.h
index f295af3150a..9f989f7ae8f 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -32,6 +32,7 @@ struct EvaluationContext;
struct Main;
struct Scene;
struct TransformOrientation;
+struct ViewLayer;
/**
* Plan is to store the object-mode per workspace, not per object anymore.
@@ -62,10 +63,17 @@ void BKE_workspace_layout_remove(
struct Main *bmain,
struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL();
+void BKE_workspace_relations_free(
+ ListBase *relation_list);
+
/* -------------------------------------------------------------------- */
/* General Utils */
+void BKE_workspace_view_layer_remove_references(
+ const struct Main *bmain,
+ const struct ViewLayer *view_layer) ATTR_NONNULL();
+
void BKE_workspace_transform_orientation_remove(
struct WorkSpace *workspace, struct TransformOrientation *orientation) ATTR_NONNULL();
struct TransformOrientation *BKE_workspace_transform_orientation_find(
@@ -98,14 +106,24 @@ void BKE_workspace_active_layout_set(struct WorkSpaceInstanceHook *h
struct bScreen *BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS;
void BKE_workspace_active_screen_set(
struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace, struct bScreen *screen) SETTER_ATTRS;
-enum eObjectMode BKE_workspace_object_mode_get(const struct WorkSpace *workspace) GETTER_ATTRS;
#ifdef USE_WORKSPACE_MODE
-void BKE_workspace_object_mode_set(struct WorkSpace *workspace, const enum eObjectMode mode) SETTER_ATTRS;
+enum eObjectMode BKE_workspace_object_mode_get(
+ const struct WorkSpace *workspace,
+ const struct Scene *scene) GETTER_ATTRS;
+void BKE_workspace_object_mode_set(
+ struct WorkSpace *workspace,
+ struct Scene *scene,
+ const enum eObjectMode mode) SETTER_ATTRS;
#endif
-struct Base *BKE_workspace_active_base_get(const struct WorkSpace *workspace);
+struct Base *BKE_workspace_active_base_get(const struct WorkSpace *workspace, const struct Scene *scene);
struct ListBase *BKE_workspace_transform_orientations_get(struct WorkSpace *workspace) GETTER_ATTRS;
-struct ViewLayer *BKE_workspace_view_layer_get(const struct WorkSpace *workspace) GETTER_ATTRS;
-void BKE_workspace_view_layer_set(struct WorkSpace *workspace, struct ViewLayer *layer) SETTER_ATTRS;
+struct ViewLayer *BKE_workspace_view_layer_get(
+ const struct WorkSpace *workspace,
+ const struct Scene *scene) GETTER_ATTRS;
+void BKE_workspace_view_layer_set(
+ struct WorkSpace *workspace,
+ struct ViewLayer *layer,
+ struct Scene *scene) SETTER_ATTRS;
struct ListBase *BKE_workspace_layouts_get(struct WorkSpace *workspace) GETTER_ATTRS;
const char *BKE_workspace_layout_name_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS;