From 7e61e597253f3ca75f2fb86a57212ca750ffbbe8 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 5 Sep 2019 12:47:20 +0200 Subject: 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 --- intern/cycles/blender/blender_sync.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'intern/cycles/blender/blender_sync.cpp') diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index e50d96cf345..8b7c66363d9 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -206,7 +206,7 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render, sync_view_layer(b_v3d, b_view_layer); sync_integrator(); - sync_film(); + sync_film(b_v3d); sync_shaders(b_depsgraph, b_v3d); sync_images(); sync_curve_settings(); @@ -336,13 +336,17 @@ void BlenderSync::sync_integrator() /* Film */ -void BlenderSync::sync_film() +void BlenderSync::sync_film(BL::SpaceView3D &b_v3d) { PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); Film *film = scene->film; Film prevfilm = *film; + if (b_v3d) { + film->display_pass = update_viewport_display_passes(b_v3d, film->passes, true); + } + film->exposure = get_float(cscene, "film_exposure"); film->filter_type = (FilterType)get_enum( cscene, "pixel_filter_type", FILTER_NUM_TYPES, FILTER_BLACKMAN_HARRIS); @@ -368,8 +372,10 @@ void BlenderSync::sync_film() } } - if (film->modified(prevfilm)) + if (film->modified(prevfilm)) { film->tag_update(scene); + film->tag_passes_update(scene, prevfilm.passes, false); + } } /* Render Layer */ -- cgit v1.2.3