Can't use extra outputs of Render Layers node via Python API #71779

Closed
opened 2019-11-22 14:07:23 +01:00 by SagRU · 4 comments

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: Intel(R) HD Graphics 530 Intel 4.5.0 - Build 25.20.100.6373

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: blender/blender@26bd5ebd42
Worked: (optional)

Short description of error
In Compositor It's impossible to use extra outputs of Render Layers node via Python API.

Exact steps for others to reproduce the error
Sample code:

bpy.context.scene.view_layers['View Layer'].cycles.denoising_store_passes = True
bpy.context.scene.use_nodes = True
node_tree = bpy.context.scene.node_tree
target_nodes = node_tree.nodes
links = node_tree.links
for node in target_nodes:
    target_nodes.remove(node)
image_node = target_nodes.new(type='CompositorNodeRLayers')
denoiser_node = target_nodes.new(type='CompositorNodeDenoise')
image_to_denoiser_link_1 = links.new(image_node.outputs[0], denoiser_node.inputs[0])
image_to_denoiser_link_2 = links.new(image_node.outputs[4], denoiser_node.inputs[1])
image_to_denoiser_link_3 = links.new(image_node.outputs[5], denoiser_node.inputs[2])

Last two lines of code produce no result.

image.png

**System Information** Operating system: Windows-10-10.0.17763 64 Bits Graphics card: Intel(R) HD Graphics 530 Intel 4.5.0 - Build 25.20.100.6373 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: `blender/blender@26bd5ebd42` Worked: (optional) **Short description of error** In Compositor It's impossible to use extra outputs of Render Layers node via Python API. **Exact steps for others to reproduce the error** Sample code: ``` bpy.context.scene.view_layers['View Layer'].cycles.denoising_store_passes = True bpy.context.scene.use_nodes = True node_tree = bpy.context.scene.node_tree target_nodes = node_tree.nodes links = node_tree.links for node in target_nodes: target_nodes.remove(node) image_node = target_nodes.new(type='CompositorNodeRLayers') denoiser_node = target_nodes.new(type='CompositorNodeDenoise') image_to_denoiser_link_1 = links.new(image_node.outputs[0], denoiser_node.inputs[0]) image_to_denoiser_link_2 = links.new(image_node.outputs[4], denoiser_node.inputs[1]) image_to_denoiser_link_3 = links.new(image_node.outputs[5], denoiser_node.inputs[2]) ``` Last two lines of code produce no result. ![image.png](https://archive.blender.org/developer/F8155204/image.png)
Author

Added subscriber: @WannaBe

Added subscriber: @WannaBe
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Jacques Lucke self-assigned this 2020-01-08 13:35:50 +01:00
Member

This currently works "as designed". Fortunately, it is not true that you cannot create these links currently. The issue is that your socket indices are wrong. The Render Layers node has a bunch of output sockets that are disabled currently (39 in my case). Currently, the "Denoising Normal" socket is actually at index 32. I recommend you just use the names of the sockets instead of their indices.

image_node.outputs["Denoising Normal"]

This currently works "as designed". Fortunately, it is not true that you cannot create these links currently. The issue is that your socket indices are wrong. The Render Layers node has a bunch of output sockets that are disabled currently (39 in my case). Currently, the "Denoising Normal" socket is actually at index 32. I recommend you just use the names of the sockets instead of their indices. `image_node.outputs["Denoising Normal"]`
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#71779
No description provided.