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
This commit is contained in:
Harley Acheson
2024-06-03 19:17:21 +02:00
committed by Harley Acheson
parent 059c74dc98
commit 10071caea8
2 changed files with 10 additions and 3 deletions

View File

@@ -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()

View File

@@ -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<RegionView3D *>(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) {