Page MenuHome

External Render Engines and storing 3D View dependent data
Closed, ResolvedPublic


With the new design of the preview shading modes T68312: LookDev & Eevee Preview external render-engines can have viewport specific settings. For example when implementing T69476: Eevee: Option to Display Render Passes in the 3D Viewport a user might want to work in a configuration where multiple render layers are shown at the same time.

Displaying Diffuse Color pass and Diffuse Direct pass in different viewport.

Currently the implementation is very limited as Blender has a fixed list of common render passes and stores the selection inside View3DShading. The external render engine can act upon this.

There are several ways I came up with to make this more flexible. They will be explained here. The goal of this design is to find a solution for this kind of features.
Personally I would go for the Custom Properties as it gives more freedom to the add-on developers, but just want to be sure that there are no other options or ideas that you have in mind, that I am not aware of. Or that this proposal is a road we don't want to take due to reasons

Register Viewport Passes
When the render engine is registered it will register a list of viewport passes.
The issue with this is that it is really a point solution for this specific problem; It reduces the potential flexibility that render-engines might want to have.

Space level Custom Properties
Another solution would be to allow Custom properties on space level. This way render engines (but also other add-ons) can extend the viewport data model and we don't need to keep track of all the different options inside blender RNA. We could limit it to SpaceView3D only when it only has potential in the 3d viewport.



Event Timeline

Jeroen Bakker (jbakker) triaged this task as Normal priority.

I think this should be custom properties for View3DShading, using RNA_def_struct_idprops_func.

I would not add a generic viewport passes system, just leave it to the renderer to define this themselves.