Revert "Fix #133638: Overlay Next: Some overlays not displayed in X-Ray mode"
This reverts commit f64641ad30.
This commit is contained in:
@@ -183,7 +183,7 @@ void Instance::object_sync(ObjectRef &ob_ref, Manager &manager)
|
||||
const bool in_particle_edit_mode = object_is_particle_edit_mode(ob_ref);
|
||||
const bool in_edit_paint_mode = object_is_edit_paint_mode(
|
||||
ob_ref, in_edit_mode, in_paint_mode, in_sculpt_mode);
|
||||
const bool needs_prepass = object_needs_prepass(ob_ref, in_paint_mode || in_sculpt_mode);
|
||||
const bool needs_prepass = object_needs_prepass(ob_ref, in_paint_mode);
|
||||
|
||||
OverlayLayer &layer = object_is_in_front(ob_ref.object, state) ? infront : regular;
|
||||
|
||||
@@ -715,7 +715,7 @@ bool Instance::object_is_in_front(const Object *object, const State &state)
|
||||
}
|
||||
}
|
||||
|
||||
bool Instance::object_needs_prepass(const ObjectRef &ob_ref, bool in_paint_or_sculpt_mode)
|
||||
bool Instance::object_needs_prepass(const ObjectRef &ob_ref, bool in_paint_mode)
|
||||
{
|
||||
if (resources.is_selection() && state.is_wireframe_mode && !state.is_solid()) {
|
||||
/* Selection in wireframe mode only use wires unless xray opacity is 1. */
|
||||
@@ -728,7 +728,7 @@ bool Instance::object_needs_prepass(const ObjectRef &ob_ref, bool in_paint_or_sc
|
||||
return true;
|
||||
}
|
||||
|
||||
if (in_paint_or_sculpt_mode && state.is_solid() && ob_ref.object->dt >= OB_SOLID) {
|
||||
if (in_paint_mode) {
|
||||
/* Allow paint overlays to draw with depth equal test. */
|
||||
return object_is_rendered_transparent(ob_ref.object, state);
|
||||
}
|
||||
@@ -747,7 +747,7 @@ bool Instance::object_is_rendered_transparent(const Object *object, const State
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!state.is_solid()) {
|
||||
if (state.xray_enabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,10 +94,8 @@ 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) ||
|
||||
(shading_type >= OB_SOLID &&
|
||||
BKE_scene_uses_blender_workbench(state.scene))) &&
|
||||
!state.xray_enabled;
|
||||
const bool masked_transparency_support = (shading_type <= OB_SOLID) ||
|
||||
BKE_scene_uses_blender_workbench(state.scene);
|
||||
const bool shadeless = shading_type == OB_WIRE;
|
||||
const bool draw_contours = state.overlay.wpaint_flag & V3D_OVERLAY_WPAINT_CONTOURS;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class Prepass : Overlay {
|
||||
public:
|
||||
void begin_sync(Resources &res, const State &state) final
|
||||
{
|
||||
enabled_ = state.is_space_v3d();
|
||||
enabled_ = state.is_space_v3d() && (!state.xray_enabled || res.is_selection());
|
||||
|
||||
if (!enabled_) {
|
||||
/* Not used. But release the data. */
|
||||
|
||||
@@ -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.is_wire() && !res.is_selection() &&
|
||||
enabled_ = state.is_space_v3d() && !state.xray_enabled && !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_);
|
||||
|
||||
Reference in New Issue
Block a user