diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-24 18:28:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-25 12:16:58 +0300 |
commit | 03a80facfc78178632086179e36f1c67128d5c09 (patch) | |
tree | 886d3eb3a6bc5cb68aaaae07aa8e0527e4882609 /source/blender/editors/screen/workspace_edit.c | |
parent | 08da2826e0f29a6a43b60deb3b31dac8dba22e6d (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/editors/screen/workspace_edit.c')
-rw-r--r-- | source/blender/editors/screen/workspace_edit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index a054949df22..d54996bad59 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -110,7 +110,7 @@ static void workspace_change_update_view_layer( WorkSpace *workspace_new, const WorkSpace *workspace_old, Scene *scene) { - if (!BKE_workspace_view_layer_get(workspace_new, scene)) { + if (!BKE_workspace_view_layer_exists(workspace_new, scene)) { BKE_workspace_view_layer_set(workspace_new, BKE_workspace_view_layer_get(workspace_old, scene), scene); } } @@ -199,7 +199,7 @@ bool ED_workspace_change( screen_change_update(C, win, screen_new); workspace_change_update(workspace_new, workspace_old, C, wm); - BLI_assert(BKE_workspace_view_layer_get(workspace_new, CTX_data_scene(C)) != NULL); + BLI_assert(BKE_workspace_view_layer_exists(workspace_new, CTX_data_scene(C)) != NULL); BLI_assert(CTX_wm_workspace(C) == workspace_new); WM_toolsystem_unlink_all(C, workspace_old); |