I want to change the value of "Pass" type inside the "UV/Image Editor" area as shown on image. enter image description here The default "Pass" value is "Combined" and I want to change the value to other available types with python script.

I was able to manipulate "Layer" type using


but i'm not able to find mentioned "Pass" value in the python API.

Thank you for your answers and time!

  • $\begingroup$ I cannot get anything even from --debug-all $\endgroup$ – rob Jan 4 at 10:00
  • 2
    $\begingroup$ Seems like this is not exposed to Python API. What are you trying to do? Maybe there are workarounds or other methods to do it. $\endgroup$ – Martin Z Jan 16 at 14:25
  • $\begingroup$ First of all, thank you for your reply! I am trying to run blender from a terminal in background mode (.blend file is not specified in advance or stored on disk - i create it on the fly), and than I change render to LuxCore in that script. I want to also be able to automatically change the "Pass" value, since I only need to render one AOV that is offered by BlendLuxCore API. Do you maybe have an idea, how to resolve that? $\endgroup$ – pro Jan 16 at 14:32
  • 1
    $\begingroup$ Appears to be multilayer_pass as index but read only. $\endgroup$ – Ratt Jan 16 at 14:47
  • $\begingroup$ hi Ratt - is it possible to modify the code and recompile somehow to be able to modify the value? otherwise i am generally speaking not sure if it makes sense to be read only if the value is accessible via GUI? $\endgroup$ – pro Jan 16 at 14:55

With the help of @B.Y.O.B. I realized that it's not possible to change "pass" setting, because LuxCore (and also Cycles) processes all selected passess (AOVs) while rendering, so there is no point in changing that variable with python (therefore it's not exposed to the API).

Anyway, my final goal was to output only certain pass (in my case "Irradiance"), which I achieved with standard way for manipulating render output - Compositor Node Editor. I used File Output node as shown on my code example:

import bpy

bpy.context.area.type = 'NODE_EDITOR'

bpy.context.space_data.tree_type = 'CompositorNodeTree'
bpy.context.scene.use_nodes = True

C = bpy.context
node_tree = C.scene.node_tree

render_layers = node_tree.nodes.get(Render Layers)

# This command creates File Output node
output_file_node = node_tree.nodes.get(File Output)
output_file_node.base_path = "save path"

# Link Render Layers to File Output node.
irradiance_output = render_layers.outputs.get(IRRADIANCE)
link = node_tree.links.new(irradiance_output, output_file_node.inputs[0])

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.