Changing Renderlayer Compositor node Layer does not update enabled outputs until script is finished #48760

Closed
opened 2016-06-29 02:24:12 +02:00 by bassam kurdali · 9 comments
Member

System Information
GNU/Linux 64 bit (Fedora 23), Intel CPU, Nvidia GPU

Blender Version
Broken: 2.77.1 2af4c80
Worked: maybe never

Short description of error
If you add change a renderlayer node's scene layer, the enabled output sockets change to reflect the scene layer's enabled passes. But if you do this within a python script or function, this does not happen until after the script has finished running, making it extremely cumbersome to use this node in your script (scene layer passes are not 1 to 1 the same as node layer output names, e.g. Combined -> Image, Alpha, Object Index ->IndexOB etc.)

Exact steps for others to reproduce the error

  • First download bug.blend the included .blend
  • Start Blender from a terminal so you can see the script output
  • Now run the included test.py and look at the output.
  • Note that both print_enabled_sockets() commands give the same enabled sockets, even though the layer has changed

Note that the two renderlayers in the scene (A and B) have different passes

What I Expect to Happen

At least with some type of refreshing (note the overkill_update() function in the script) I would expect the output to change on the second print_enabled_sockets() command to reflect the renderlayer change.

**System Information** GNU/Linux 64 bit (Fedora 23), Intel CPU, Nvidia GPU **Blender Version** Broken: 2.77.1 2af4c80 Worked: maybe never **Short description of error** If you add change a renderlayer node's scene layer, the enabled output sockets change to reflect the scene layer's enabled passes. But if you do this within a python script or function, this does not happen until *after* the script has finished running, making it extremely cumbersome to use this node in your script (scene layer passes are not 1 to 1 the same as node layer output names, e.g. Combined -> Image, Alpha, Object Index ->IndexOB etc.) **Exact steps for others to reproduce the error** - First download [bug.blend](https://archive.blender.org/developer/F318963/bug.blend) the included .blend - Start Blender from a terminal so you can see the script output - Now run the included test.py and look at the output. - Note that both print_enabled_sockets() commands give the same enabled sockets, even though the layer has changed # Note that the two renderlayers in the scene (A and B) have different passes **What I Expect to Happen** At least with some type of refreshing (note the overkill_update() function in the script) I would expect the output to change on the second print_enabled_sockets() command to reflect the renderlayer change.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @BassamKurdali

Added subscriber: @BassamKurdali
Author
Member

bug2.blend
I added a bpy.context.scene.node_tree.update_tag()
bpy.context.scene.update()
just in case, to the overkill_update() function. Same result.

[bug2.blend](https://archive.blender.org/developer/F318967/bug2.blend) I added a bpy.context.scene.node_tree.update_tag() bpy.context.scene.update() just in case, to the overkill_update() function. Same result.

Added subscribers: @monique, @Sergey, @Jeroen-Bakker, @mont29

Added subscribers: @monique, @Sergey, @Jeroen-Bakker, @mont29

Can confirm the issue, it comes from the fact that your newly added node has no output (ED_node_tag_update_nodetree is called from RNA update callback, but does nothing in case node is not connected somehow to output - i.e. node has no effect on result). And RenderLayer node has no update() callback registered either, afaict.

Not sure how to handle this, @Jeroen-Bakker, @monique, @Sergey?

Can confirm the issue, it comes from the fact that your newly added node has no output (`ED_node_tag_update_nodetree` is called from RNA update callback, but does nothing in case node is not connected somehow to output - i.e. node has no effect on result). And RenderLayer node has no update() callback registered either, afaict. Not sure how to handle this, @Jeroen-Bakker, @monique, @Sergey?

@mont29, ED_node_tag_update_nodetree updates nodetree itself (aka, executes the tree to get new result).

The actual issue here is that currently sockets gets hidden on every redraw of compositor. This is weak, but it is how it is. Tweaking render passes forces updates of hidden sockets, so guess it'll be fine to do same for layer in Image and Scene compositor nodes.

@mont29, `ED_node_tag_update_nodetree` updates nodetree itself (aka, executes the tree to get new result). The actual issue here is that currently sockets gets hidden on _every_ _redraw_ of compositor. This is weak, but it is how it is. Tweaking render passes forces updates of hidden sockets, so guess it'll be fine to do same for layer in Image and Scene compositor nodes.

This issue was referenced by blender/blender@ae881ddf43

This issue was referenced by blender/blender@ae881ddf43af248ce4f5b69037dd340fa1db90b3

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

wow! thanks sergey and mont, that was an interesting/ difficult case!

wow! thanks sergey and mont, that was an interesting/ difficult case!
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#48760
No description provided.