In Blender 2.8 +, how do I limit the (animation / multi-frame) render to only one pass (e.g. only z-pass or only Mist pass)?
I figured out a simple way to do use the compositor programmatically to isolate the mist pass in the renderers (Inspired by this answer).
import bpy

# (perhaps) more code here

# perhaps defined in some function or method
node_tree = bpy.context.scene.node_tree
render_layers_node = node_tree.nodes.get(&quot;Render Layers&quot;)
composite_node = node_tree.nodes.get(&quot;Composite&quot;)
links = node_tree.links
links.clear()
links.new(render_layers_node.outputs[&quot;Mist&quot;], composite_node.inputs[&quot;Image&quot;])

# (perhaps) more code here

bops.render.render(animation=True)
```