Fix T51455: Render Layers in compositor from a different scene not working

The code only updated nodes in the nodetree of the scene to which the render layer belongs. Therefore, when using scene B in the compositor setup of scene A, A's node wouldn't be updated.
With this fix, the update function loops over all scenes and checks them for relevant nodes.
This commit is contained in:
Lukas Stockner 2017-05-10 22:39:43 +02:00
parent 42c346028f
commit b82954f6f4
Notes: blender-bot 2023-02-14 07:45:38 +01:00
Referenced by issue #51455, Render Layers in compositor from a different scene not working
1 changed files with 8 additions and 2 deletions

View File

@ -783,7 +783,13 @@ void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, s
return;
}
if (scene->nodetree) {
ntreeCompositRegisterPass(scene->nodetree, scene, srl, name, type);
/* Register the pass in all scenes that have a render layer node for this layer.
* Since multiple scenes can be used in the compositor, the code must loop over all scenes
* and check whether their nodetree has a node that needs to be updated. */
Scene *sce;
for (sce = G.main->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree) {
ntreeCompositRegisterPass(sce->nodetree, scene, srl, name, type);
}
}
}