diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-05-23 19:40:45 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-05-23 19:42:15 +0400 |
commit | 5811076d0dd9df7f87837160c4eea168a0a1e256 (patch) | |
tree | e74710429007cd523e0cc435a89166eb7a76bf2e /source | |
parent | f8ce417eba0c4b52e00f32a4b54c195cb41ecf7f (diff) |
Fix crash rendering linked scenes in compo
Simply linking scene (lib.blend) without compo into another one (compo.blend),
using it in a compositor and rendering it would crash.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index d6b5258cf59..537714ace0b 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1806,7 +1806,8 @@ static void ntree_render_scenes(Render *re) { bNode *node; int cfra = re->scene->r.cfra; - int restore_scene = 0; + Scene *restore_scene = re->scene; + bool scene_changed = false; if (re->scene->nodetree == NULL) return; @@ -1820,18 +1821,18 @@ static void ntree_render_scenes(Render *re) if (node->flag & NODE_TEST) { Scene *scene = (Scene *)node->id; + scene_changed |= scene != restore_scene; render_scene(re, scene, cfra); - restore_scene = (scene != re->scene); node->flag &= ~NODE_TEST; - nodeUpdate(re->scene->nodetree, node); + nodeUpdate(restore_scene->nodetree, node); } } } } /* restore scene if we rendered another last */ - if (restore_scene) + if (scene_changed) BKE_scene_set_background(re->main, re->scene); } |