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-05-24 18:28:35 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-05-25 12:16:58 +0300
commit03a80facfc78178632086179e36f1c67128d5c09 (patch)
tree886d3eb3a6bc5cb68aaaae07aa8e0527e4882609 /source/blender/makesdna/DNA_workspace_types.h
parent08da2826e0f29a6a43b60deb3b31dac8dba22e6d (diff)
Fix T55183, fix T55174: crashes with workspace / view layer relation.
Don't store pointers to ViewLayer in the workspace, only names. Add specific relation type since the generic mechanism makes the code hard to follow. Integrate with pointer restore for undo and library remapping code to avoid data going out of sync. Also add relation automatically if there doesn't exists one yet in BKE_workspace_view_layer_get, because in general it's really hard to ensure it will exist when making arbitrary scene changes. Differential Revision: https://developer.blender.org/D3432
Diffstat (limited to 'source/blender/makesdna/DNA_workspace_types.h')
-rw-r--r--source/blender/makesdna/DNA_workspace_types.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
index 83b6867afd3..f3e145e9b55 100644
--- a/source/blender/makesdna/DNA_workspace_types.h
+++ b/source/blender/makesdna/DNA_workspace_types.h
@@ -126,7 +126,7 @@ typedef struct WorkSpace {
/* Store for each hook (so for each window) which layout has
* been activated the last time this workspace was visible. */
ListBase hook_layout_relations DNA_PRIVATE_WORKSPACE_READ_WRITE; /* WorkSpaceDataRelation */
- ListBase scene_viewlayer_relations DNA_PRIVATE_WORKSPACE_READ_WRITE; /* WorkSpaceDataRelation */
+ ListBase scene_relations; /* WorkSpaceSceneRelation */
/* Feature tagging (use for addons) */
ListBase owner_ids DNA_PRIVATE_WORKSPACE_READ_WRITE; /* wmOwnerID */
@@ -180,13 +180,17 @@ typedef struct WorkSpaceDataRelation {
void *parent;
/* The value for this parent-data/workspace relation */
void *value;
-
- /** Use when we reference non-ID data, this allows use to look it up when linking in a workspace. */
- char value_name[64]; /* MAX_NAME. */
} WorkSpaceDataRelation;
#endif /* DNA_PRIVATE_WORKSPACE_READ_WRITE */
+typedef struct WorkSpaceSceneRelation {
+ struct WorkSpaceSceneRelation *next, *prev;
+
+ struct Scene *scene;
+ char view_layer[64]; /* MAX_NAME */
+} WorkSpaceSceneRelation;
+
/**
* Little wrapper to store data that is going to be per window, but comming from the workspace.
* It allows us to keep workspace and window data completely separate.