Fix T78264: Auto Render stops working after rendering manually

Was caused by weird and feedback-loop based issue from a long time ago.

The auto-render was only happening for nodes which are tagged for exec.
This tag is assigned by edit operations on the tree (for example, when
adding or removing links). It is also set in the render pipeline for
nodes which are to be executed.

The issues comes from the fact that "life updates" during editing did
not clear the need_exec flag, ever. This made it so Auto Render was
working as expected. However, rendering the scene resets need_exec
flags at the end of rendering using ntreeCompositClearTags().
The actual need of such clear is not very clear, but it was making it
so Auto Render does not work after render.

To my knowledge the flag didn't really meant that the node is connected
to the output, so it couldn't have acted as attempt to ignore rendering
of an unused scene. It also should be possible to auto-render even if
node tree itself was never altered.

Long story short: lets ignore need_exec flag in auto-render check and
render scene node if the scene is used by the node.

Differential Revision: https://developer.blender.org/D8171
This commit is contained in:
Sergey Sharybin 2020-07-01 12:52:58 +02:00
parent 6a302e6845
commit 6f0aca7973
Notes: blender-bot 2023-02-14 04:39:18 +01:00
Referenced by issue #78586, In compositor image previews inside nodes don't update/refresh when they should
Referenced by issue #78264, Auto Render stops working after rendering manually
1 changed files with 5 additions and 1 deletions

View File

@ -1428,11 +1428,15 @@ int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op))
Scene *sce = CTX_data_scene(C);
bNode *node;
/* This is actually a test whether scene is used by the compositor or not.
* All the nodes are using same render result, so there is no need to do
* anything smart about check how exactly scene is used. */
for (node = sce->nodetree->nodes.first; node; node = node->next) {
if (node->id == (ID *)sce && node->need_exec) {
if (node->id == (ID *)sce) {
break;
}
}
if (node) {
ViewLayer *view_layer = BLI_findlink(&sce->view_layers, node->custom1);