I am developing an addon for an external renderer and want to register custom render passes. Last time I implemented this feature I had to resort to images because Blender only had hardcoded render passes.
Nowadays the RenderEngine class offers several methods that seem to allow the registration of custom passes:
register_pass(scene=None, srl=None, name="", channels=1, chanid="", type='VALUE')
add_pass(name, channels, chan_id, layer="")
However, I could not find any explanation or examples of how to use these methods. Looking at the Cycles source code also did not help much.
Cycles implements the
But I could not find out how or when this method is ever called. When I implement this method in my addon, it is never called.
In this implementation, it uses the
Where I currently am
I have managed to add a custom pass with the following code, which is currently executed in the constructor of my RenderEngine implementation:
self.add_pass("Samplecount", 1, "X")
It shows up in the image editor: