From 9afddac7275843280cf820b665fd5a2d22e83958 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 18 Oct 2013 09:45:21 +0000 Subject: [PATCH] Fix for wrong active render layer after copying hr scene Also fix crash for files which could have been saved with wrong active render layer. --- source/blender/blenkernel/intern/scene.c | 1 + source/blender/editors/render/render_shading.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index cd8ceea0a97..2ad9080325c 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -157,6 +157,7 @@ Scene *BKE_scene_copy(Scene *sce, int type) lb = scen->r.layers; scen->r = sce->r; scen->r.layers = lb; + scen->r.actlay = 0; scen->unit = sce->unit; scen->physics_settings = sce->physics_settings; scen->gm = sce->gm; diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 553a543390f..3ef1f0db647 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -739,6 +739,10 @@ static int freestyle_active_lineset_poll(bContext *C) Scene *scene = CTX_data_scene(C); SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); + if (!srl) { + return FALSE; + } + return BKE_freestyle_lineset_get_active(&srl->freestyleConfig) != NULL; }