Fix #133638: Overlay-Next: X-Ray + Overlays

Alternative (cleaner) version of #134069.

Pull Request: https://projects.blender.org/blender/blender/pulls/134243
This commit is contained in:
Miguel Pozo
2025-02-10 10:48:59 +01:00
committed by Clément Foucault
parent 351aef120f
commit 44d5d1b0f3
3 changed files with 6 additions and 4 deletions

View File

@@ -747,7 +747,7 @@ bool Instance::object_is_rendered_transparent(const Object *object, const State
return false;
}
if (state.xray_enabled) {
if (!state.is_solid()) {
return true;
}

View File

@@ -94,8 +94,10 @@ class Paints : Overlay {
/* Support masked transparency in Workbench.
* EEVEE can't be supported since depth won't match. */
const eDrawType shading_type = eDrawType(state.v3d->shading.type);
const bool masked_transparency_support = (shading_type <= OB_SOLID) ||
BKE_scene_uses_blender_workbench(state.scene);
const bool masked_transparency_support = ((shading_type == OB_SOLID) ||
(shading_type >= OB_SOLID &&
BKE_scene_uses_blender_workbench(state.scene))) &&
!state.xray_enabled;
const bool shadeless = shading_type == OB_WIRE;
const bool draw_contours = state.overlay.wpaint_flag & V3D_OVERLAY_WPAINT_CONTOURS;

View File

@@ -50,7 +50,7 @@ class Sculpts : Overlay {
show_face_set_ = state.show_sculpt_face_sets();
show_mask_ = state.show_sculpt_mask();
enabled_ = state.is_space_v3d() && !state.xray_enabled && !res.is_selection() &&
enabled_ = state.is_space_v3d() && !state.is_wire() && !res.is_selection() &&
!state.is_depth_only_drawing &&
ELEM(state.object_mode, OB_MODE_SCULPT_CURVES, OB_MODE_SCULPT) &&
(show_curves_cage_ || show_face_set_ || show_mask_);