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.
This commit is contained in:
parent
4f6dd555b7
commit
3718c04844
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue