From 10071caea8e8779b260d353d0d43b49ffbdaa50a Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Mon, 3 Jun 2024 19:17:21 +0200 Subject: [PATCH] UI: Show Passepartout When All Overlays Off Bring back old behavior where passepartout is shown when all overlays are disabled. Move the passepartout option to the sidebar. Pull Request: https://projects.blender.org/blender/blender/pulls/122577 --- scripts/startup/bl_ui/space_view3d.py | 6 ++++-- source/blender/editors/space_view3d/view3d_draw.cc | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index adbe91d86c3..aa701ae4fdb 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -6584,6 +6584,10 @@ class VIEW3D_PT_view3d_properties(Panel): sub.enabled = view.use_local_camera sub.prop(view, "camera", text="") + sub = col.row() + sub.active = view.region_3d.view_perspective == 'CAMERA' + sub.prop(view.overlay, "show_camera_passepartout", text="Passepartout") + layout.separator() col = layout.column(align=True) @@ -7260,8 +7264,6 @@ class VIEW3D_PT_overlay_guides(Panel): sub = split.column() sub.prop(overlay, "show_cursor", text="3D Cursor") sub.prop(overlay, "show_annotation", text="Annotations") - if view.region_3d.view_perspective == 'CAMERA': - sub.prop(overlay, "show_camera_passepartout", text="Passepartout") if shading.type == 'MATERIAL': row = col.row() diff --git a/source/blender/editors/space_view3d/view3d_draw.cc b/source/blender/editors/space_view3d/view3d_draw.cc index 3141a45ac57..009d4dfdd2c 100644 --- a/source/blender/editors/space_view3d/view3d_draw.cc +++ b/source/blender/editors/space_view3d/view3d_draw.cc @@ -615,6 +615,11 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region, immUnbindProgram(); } + /* When overlays are disabled, only show camera outline & passepartout. */ + if (v3d->flag2 & V3D_HIDE_OVERLAYS || !(v3d->flag2 & V3D_SHOW_CAMERA_GUIDES)) { + return; + } + /* And now, the dashed lines! */ immBindBuiltinProgram(GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR); @@ -1134,7 +1139,7 @@ static void view3d_draw_border(const bContext *C, ARegion *region) RegionView3D *rv3d = static_cast(region->regiondata); View3D *v3d = CTX_wm_view3d(C); - if (rv3d->persp == RV3D_CAMOB && !(v3d->flag2 & V3D_HIDE_OVERLAYS)) { + if (rv3d->persp == RV3D_CAMOB) { drawviewborder(scene, depsgraph, region, v3d); } else if (v3d->flag2 & V3D_RENDER_BORDER) {