From b48694639af41518a0e8c73da20121eda1685765 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 14 Jul 2017 11:16:25 +0200 Subject: Workspace: Fix crash on preview, and sanitize placeholder functions This commit effectively makes workspace switching useless as far as the active scene layer goes. The functions from the scene layer API to get the correct scene layer from "context" were a placeholder to be addressed by the workspace commit. When workspace was merged, however G.main was used as a replacement to pass the correct argument for the functions. As it turned out (surprise!) this leads to crash on render preview. We need to get rid of: * BKE_scene_layer_context_active_ex_PLACEHOLDER * BKE_scene_layer_context_active_PLACEHOLDER And either use SceneLayer explicitly or replace it by: * BKE_scene_layer_from_workspace_get --- source/blender/blenkernel/intern/blendfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/blendfile.c') diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 53f2462ee98..5f88c4aec0e 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -193,7 +193,7 @@ static void setup_app_data( } if (cur_render_layer == NULL) { /* fallback to scene layer */ - cur_render_layer = BKE_scene_layer_render_active(curscene); + cur_render_layer = BKE_scene_layer_from_scene_get(curscene); } if (track_undo_scene) { @@ -335,7 +335,8 @@ static void setup_app_data( if (mode == LOAD_UI_OFF && BLI_listbase_is_empty(&G.main->wm)) { /* XXX prevent crash in pdInitEffectors called through DEG_scene_relations_rebuild (see T51794). - * Can be removed once BKE_scene_layer_context_active_ex gets workspace passed. */ + * Can be removed once BKE_scene_layer_context_active_ex_PLACEHOLDER gets + * replaced by BKE_scene_layer_from_workspace_get. */ BLI_addhead(&G.main->wm, CTX_wm_manager(C)); BKE_scene_set_background(G.main, curscene); BLI_listbase_clear(&G.main->wm); -- cgit v1.2.3