From 2414a5787d0c7a03e89d5087b8d4d5ae8e1d27c8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 27 May 2021 11:31:03 +0200 Subject: Refactor: Move display pass to Cycles viewport parameters Allows to centralize storage and modification checks in a single place, avoiding duplication in the synchronization code. Ideally we would somehow be able to more granularly modify Cycles side objects. Leaving this for a future decision, because it might be better to implement it as a graph on the sync side. --- intern/cycles/blender/blender_viewport.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'intern/cycles/blender/blender_viewport.h') diff --git a/intern/cycles/blender/blender_viewport.h b/intern/cycles/blender/blender_viewport.h index c588a5b8f87..0dfb3918852 100644 --- a/intern/cycles/blender/blender_viewport.h +++ b/intern/cycles/blender/blender_viewport.h @@ -37,19 +37,24 @@ class BlenderViewportParameters { float studiolight_background_alpha; ustring studiolight_path; + /* Film. */ + PassType display_pass; + BlenderViewportParameters(); explicit BlenderViewportParameters(BL::SpaceView3D &b_v3d); /* Check whether any of shading related settings are different from the given parameters. */ bool shader_modified(const BlenderViewportParameters &other) const; + /* Check whether any of film related settings are different from the given parameters. */ + bool film_modified(const BlenderViewportParameters &other) const; + + /* Check whether any of settings are different from the given parameters. */ + bool modified(const BlenderViewportParameters &other) const; + /* Returns truth when a custom shader defined by the viewport is to be used instead of the * regular background shader or scene light. */ bool use_custom_shader() const; - - /* Retrieve the render pass type that needs to be displayed on the given `SpaceView3D` - * When the `b_v3d` parameter is not given `PASS_NONE` will be returned. */ - static PassType get_render_pass(BL::SpaceView3D &b_v3d); }; PassType update_viewport_display_passes(BL::SpaceView3D &b_v3d, vector &passes); -- cgit v1.2.3