When attempting to link the mist pass output of a
Render Layer node to the input image content of an
Output File node, I found that no matter how I tried to connect the mist pass output, nothing would attach to it via the Python API. Manually, through the Blender GUI I could link the two fine, and get results as expected. The code to generate these nodes is as follows:
## Link shaders tl = bpy.context.scene.node_tree.links # Link raw image render layer to switch tl.new(n_image_rl.outputs, n_switch.inputs) # Link depth from raw image to depth file output tl.new(n_image_rl.outputs, n_depth_out.inputs) # Link image segment render layer tl.new(n_img_seg_rl.outputs, n_alpha.inputs) # Link field segment render layer tl.new(n_field_seg_rl.outputs, n_col_key.inputs) # Link color key node tl.new(n_col_key.outputs, n_mix.inputs) tl.new(n_col_key.outputs, n_mix.inputs) # Link mix to alpha tl.new(n_mix.outputs, n_alpha.inputs) # Link alpha to switch tl.new(n_alpha.outputs, n_switch.inputs) # Link switch to composite output tl.new(n_switch.outputs, n_comp.inputs)
This is the node linking received when the script was run, from within the
Compositing Nodes window:
Any advice on how to resolve this issue would be appreciated!