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/modifiers/intern/MOD_dynamicpaint.c | 2 +- source/blender/modifiers/intern/MOD_smoke.c | 2 +- source/blender/modifiers/intern/MOD_softbody.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index b1fe3535154..ade416f39eb 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -119,7 +119,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /* dont apply dynamic paint on orco dm stack */ if (!(flag & MOD_APPLY_ORCO)) { - return dynamicPaint_Modifier_do(pmd, md->scene, BKE_scene_layer_context_active(md->scene), ob, dm); + return dynamicPaint_Modifier_do(pmd, md->scene, BKE_scene_layer_context_active_PLACEHOLDER(md->scene), ob, dm); } return dm; } diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c index a11b0f887ea..1b9e06bf0dc 100644 --- a/source/blender/modifiers/intern/MOD_smoke.c +++ b/source/blender/modifiers/intern/MOD_smoke.c @@ -109,7 +109,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (flag & MOD_APPLY_ORCO) return dm; - return smokeModifier_do(smd, md->scene, BKE_scene_layer_context_active(md->scene), ob, dm); + return smokeModifier_do(smd, md->scene, BKE_scene_layer_context_active_PLACEHOLDER(md->scene), ob, dm); } static bool dependsOnTime(ModifierData *UNUSED(md)) diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c index 5468b8a61f0..780a55aa631 100644 --- a/source/blender/modifiers/intern/MOD_softbody.c +++ b/source/blender/modifiers/intern/MOD_softbody.c @@ -54,7 +54,7 @@ static void deformVerts(ModifierData *md, Object *ob, int numVerts, ModifierApplyFlag UNUSED(flag)) { - sbObjectStep(md->scene, BKE_scene_layer_context_active(md->scene), ob, (float)md->scene->r.cfra, vertexCos, numVerts); + sbObjectStep(md->scene, BKE_scene_layer_context_active_PLACEHOLDER(md->scene), ob, (float)md->scene->r.cfra, vertexCos, numVerts); } static bool dependsOnTime(ModifierData *UNUSED(md)) -- cgit v1.2.3