diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-05-27 12:31:03 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-05-27 12:36:30 +0300 |
commit | 2414a5787d0c7a03e89d5087b8d4d5ae8e1d27c8 (patch) | |
tree | c54edae55c56d1414e0509e98f705a12778700c0 /intern/cycles/blender/blender_viewport.h | |
parent | 7b5f4c88370ed2752d398a8d8c5aca4b4435a0c9 (diff) |
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.
Diffstat (limited to 'intern/cycles/blender/blender_viewport.h')
-rw-r--r-- | intern/cycles/blender/blender_viewport.h | 13 |
1 files changed, 9 insertions, 4 deletions
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<Pass> &passes); |