Fix #133483: Auto Depth broken when X-Ray enabled

Disable x-ray for depth only drawings.

Pull Request: https://projects.blender.org/blender/blender/pulls/133496
This commit is contained in:
Miguel Pozo
2025-01-23 17:11:54 +01:00
parent b858319dd3
commit 97b4f99aed

View File

@@ -54,10 +54,11 @@ void Instance::init()
state.use_in_front = true;
state.is_wireframe_mode = (state.v3d->shading.type == OB_WIRE);
state.hide_overlays = (state.v3d->flag2 & V3D_HIDE_OVERLAYS) != 0;
state.xray_enabled = XRAY_ACTIVE(state.v3d);
state.xray_enabled = XRAY_ACTIVE(state.v3d) && !state.is_depth_only_drawing;
state.xray_enabled_and_not_wire = state.xray_enabled && (state.v3d->shading.type > OB_WIRE);
state.xray_opacity = state.xray_enabled ? XRAY_ALPHA(state.v3d) : 1.0f;
state.xray_flag_enabled = SHADING_XRAY_FLAG_ENABLED(state.v3d->shading);
state.xray_flag_enabled = SHADING_XRAY_FLAG_ENABLED(state.v3d->shading) &&
!state.is_depth_only_drawing;
if (!state.hide_overlays) {
state.overlay = state.v3d->overlay;