diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-20 05:09:25 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-20 05:09:25 +0400 |
commit | 3718c048447a0fd596cafb4e1d619d0c8273e6f4 (patch) | |
tree | ec5ee375c40d0ce4a1f0c5504756ad7ca7032d15 /source/blender/render | |
parent | 4f6dd555b7254efe9e8aa58481469eca74768c79 (diff) |
Fix compositor rendering scenes multiple times in some cases
Issue was caused by Blender Internal changing LIB_DOIT flag
for scene when it gets updated for new frame. This leads into
conflict with flag used for tagging scenes fr render,
For now made it so nodes are being tagged instead of scene.
Only none node from those who're sharing the scene will be
tagged. And rendering scenes for node tree now checks for
node flag instead of scene's datablock one.
Ideally this tag would be replaced with scenes stored in an
array, but then it's not so clear how to check which node
to update.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index fa05f8dd18d..9930a8f7f61 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1600,6 +1600,7 @@ static void tag_scenes_for_render(Render *re) /* check for render-layers nodes using other scenes, we tag them LIB_DOIT */ for (node = re->scene->nodetree->nodes.first; node; node = node->next) { + node->flag &= ~NODE_TEST; if (node->type == CMP_NODE_R_LAYERS) { if (node->id) { if (!MAIN_VERSION_ATLEAST(re->main, 265, 5)) { @@ -1617,8 +1618,12 @@ static void tag_scenes_for_render(Render *re) } } - if (node->id != (ID *)re->scene) - node->id->flag |= LIB_DOIT; + if (node->id != (ID *)re->scene) { + if ((node->id->flag & LIB_DOIT) == 0) { + node->flag |= NODE_TEST; + node->id->flag |= LIB_DOIT; + } + } } } } @@ -1640,12 +1645,12 @@ static void ntree_render_scenes(Render *re) for (node = re->scene->nodetree->nodes.first; node; node = node->next) { if (node->type == CMP_NODE_R_LAYERS) { if (node->id && node->id != (ID *)re->scene) { - if (node->id->flag & LIB_DOIT) { + if (node->flag & NODE_TEST) { Scene *scene = (Scene *)node->id; render_scene(re, scene, cfra); restore_scene = (scene != re->scene); - node->id->flag &= ~LIB_DOIT; + node->flag &= ~NODE_TEST; nodeUpdate(re->scene->nodetree, node); } |