Render passes are additional images that are created during rendering and that carry some separate additional information about the render. For example, this could be a depth map – a black and white image in which the brightness of the white color corresponds to the distance of objects from the camera. The creation of such render passes can be turned on in Blender by the user manually in the Properties area on the View Layer tab or using the Blender Python API.
All render passes are connected to the current render layer “View Layer” and are created for this layer.
Turning them on and off with the Python API is also connected to the “view_layer” object.
We can get a pointer to the current view layer by the context:
1 2 3 |
bpy.context.view_layer # bpy.data.scenes['Scene'].view_layers["ViewLayer"] |
All checkboxes for individual render passes are available via the corresponding properties of the render layer.
For example, the main render pass, which is actually used to create the final render image, is defined by the “Combined” property.
We can check whether this render pass is enabled by simply checking the value of this property.
1 2 3 |
bpy.context.view_layer.use_pass_combined # True |
The True value means that the render pass is enabled (the checkbox is checked) and will be created during rendering. The False value means that this render pass will not be created during rendering.
To enable the desired render pass, simply set the corresponding property to True.
For example, let’s enable the depth map path:
1 |
bpy.context.view_layer.use_pass_z = True |
Some render passes are only available for a specific render engine. These render passes need to be accessed by a property of that render engine.
For example, the Light – Volume render pass is available for the EEVEE render engine, so we need to enable it as follows:
1 |
bpy.context.view_layer.eevee.use_pass_volume_direct = False |
The list of properties for enabling and disabling render passes for Blender 4.4:
- Data
- Combined: use_pass_combined
- Z: use_pass_z
- Mist: use_pass_mist
- Normal: use_pass_normal
- Position: use_pass_position
- Vector: use_pass_vector
- Light
- Diffuse light: use_pass_diffuse_direct
- Diffuse color: use_pass_diffuse_color
- Specular light: use_pass_glossy_direct
- Specular color: use_pass_glossy_color
- Volume light: eevee.use_pass_volume_direct
- Other
- Emission: use_pass_emit
- Environment: use_pass_environment
- Shadow: use_pass_shadow
- Ambient occlusion: use_pass_ambient_occlusion
- Transparent: eevee.use_pass_transparent
- Cryptomatte
- Object: use_pass_cryptomatte_object
- Material: use_pass_cryptomatte_material
- Asset: use_pass_cryptomatte_asset