diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-09-05 13:47:20 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-09-11 13:19:44 +0300 |
commit | 7e61e597253f3ca75f2fb86a57212ca750ffbbe8 (patch) | |
tree | 6dbe0bf05fc3380f9729bf719ed1223997d5b0e3 /source/blender/blenloader/intern/writefile.c | |
parent | d4f8bc80a4bd69707a92e7141a2fb67d3f668c58 (diff) |
Cycles: Display RenderPass in Viewport
This change allows the user to select a renderpass in the 3d viewport.
Added support for external renderers to extend the `View3DShading` struct.
This way Blender doesn't need to know the features an external render engine wants to support.
Note that the View3DShading is also available in the scene->display.shading; although this is
supported, it does not make sense for render engines to put something here as it is really
scene/workbench related.
Currently cycles assumes that it always needs to calculate the combined pass; it ignores the
`pass_flag` in KernelFilm. We could optimize this but that was not in scope of this change
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5689
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c9c3a96fb32..d698c94dbfb 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2413,6 +2413,13 @@ static void write_view_settings(WriteData *wd, ColorManagedViewSettings *view_se } } +static void write_view3dshading(WriteData *wd, View3DShading *shading) +{ + if (shading->prop) { + IDP_WriteProperty(shading->prop, wd); + } +} + static void write_paint(WriteData *wd, Paint *p) { if (p->cavity_curve) { @@ -2684,6 +2691,8 @@ static void write_scene(WriteData *wd, Scene *sce) write_lightcache(wd, sce->eevee.light_cache); } + write_view3dshading(wd, &sce->display.shading); + /* Freed on doversion. */ BLI_assert(sce->layer_properties == NULL); } @@ -2850,6 +2859,7 @@ static void write_area_regions(WriteData *wd, ScrArea *area) if (v3d->fx_settings.dof) { writestruct(wd, DATA, GPUDOFSettings, 1, v3d->fx_settings.dof); } + write_view3dshading(wd, &v3d->shading); } else if (sl->spacetype == SPACE_GRAPH) { SpaceGraph *sipo = (SpaceGraph *)sl; |