From 7878adf49cfff6ccbb18203f21c6355a518b34db Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 10 Dec 2019 15:18:16 +0100 Subject: DrawManager: Disable Clipping in material/rendered mode Viewport: Disable Clipping For EEVEE and External Renderers Currently it is possible that, when using viewport clipping, the display and tools communicate different information to the user then the renderer does. The reason is that the renderer does not support viewport clipping. Both EEVEE and Cycles do not support it. This patch will disable the clipping in all the tools and drawing code when the viewport drawing mode is `Material Preview` or `Rendered`. This patch introduces a `RV3D_CLIPPING_ENABLED` util that checks if clipping is enabled for the given `rv3d` and `v3d`. Also in places where it was needed we added the `ViewContext` as a carrier for the `View3D` and `RegionView3D`. There are a few areas in the tooling (select, projection painting) that still needs to be tackled after this patch. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6047 --- source/blender/editors/space_view3d/view3d_view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d/view3d_view.c') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index d7f7e96ba08..8b4012d6547 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1099,7 +1099,7 @@ int view3d_opengl_select(ViewContext *vc, GPU_depth_test(true); } - if (vc->rv3d->rflag & RV3D_CLIPPING) { + if (RV3D_CLIPPING_ENABLED(vc->v3d, vc->rv3d)) { ED_view3d_clipping_set(vc->rv3d); } @@ -1167,7 +1167,7 @@ int view3d_opengl_select(ViewContext *vc, GPU_depth_test(false); } - if (vc->rv3d->rflag & RV3D_CLIPPING) { + if (RV3D_CLIPPING_ENABLED(v3d, vc->rv3d)) { ED_view3d_clipping_disable(); } -- cgit v1.2.3