How to use the new render pass API for an external renderer?

by B.Y.O.B.   Last Updated February 13, 2018 11:15 AM

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:

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.

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:

enter image description here

Problems/Questions

  • The custom pass is always available in the image editor dropdown, even if it is not used in the current rendering
  • It seems there is no method to remove or unregister a custom pass - how does Cycles do this?
  • The custom pass does not show up in the compositor:

    enter image description here


Related Questions


Blender render passes

Updated June 27, 2015 13:06 PM

screen composition in blender

Updated January 12, 2018 13:15 PM

Blender 2.77 Motion Vectors

Updated November 04, 2016 09:06 AM

Best way to render passes off different objects?

Updated May 25, 2017 00:15 AM