Fix T77424 Overlay: Editmode: Issue with multi edit and in-front option
This is a nice addition to the refactor. Now any combination of in-front / not in-front will work in non x-ray edit mode.
This commit is contained in:
parent
f21cdf0d12
commit
54b3168c4a
Notes:
blender-bot
2023-02-13 22:20:49 +01:00
Referenced by issue #77424, Editmode overlay [wireframe, vertices etc] completely covered by geometry in multiple selection objects in edit mode with 'In Front' option enabled
|
@ -75,8 +75,6 @@ void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
|
|||
bool show_face_dots = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_FACE_DOT) != 0 ||
|
||||
pd->edit_mesh.do_zbufclip;
|
||||
|
||||
pd->edit_mesh.ghost_ob = 0;
|
||||
pd->edit_mesh.edit_ob = 0;
|
||||
pd->edit_mesh.do_faces = true;
|
||||
pd->edit_mesh.do_edges = true;
|
||||
|
||||
|
@ -312,9 +310,6 @@ void OVERLAY_edit_mesh_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
overlay_edit_mesh_add_ob_to_pass(pd, ob, do_in_front);
|
||||
}
|
||||
|
||||
pd->edit_mesh.ghost_ob += (ob->dtx & OB_DRAW_IN_FRONT) ? 1 : 0;
|
||||
pd->edit_mesh.edit_ob += 1;
|
||||
|
||||
if (DRW_state_show_text() && (pd->edit_mesh.flag & OVERLAY_EDIT_TEXT)) {
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
DRW_text_edit_mesh_measure_stats(draw_ctx->region, draw_ctx->v3d, ob, &draw_ctx->scene->unit);
|
||||
|
@ -375,18 +370,11 @@ void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata)
|
|||
DRW_draw_pass(psl->edit_mesh_verts_ps[NOT_IN_FRONT]);
|
||||
}
|
||||
else {
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
View3D *v3d = draw_ctx->v3d;
|
||||
|
||||
DRW_draw_pass(psl->edit_mesh_normals_ps);
|
||||
overlay_edit_mesh_draw_components(psl, pd, false);
|
||||
|
||||
if (!DRW_state_is_depth() && v3d->shading.type == OB_SOLID && pd->edit_mesh.ghost_ob == 1 &&
|
||||
pd->edit_mesh.edit_ob == 1) {
|
||||
/* In the case of single ghost object edit (common case for retopology):
|
||||
* we clear the depth buffer so that only the depth of the retopo mesh
|
||||
* is occluding the edit cage. */
|
||||
GPU_framebuffer_clear_depth(fbl->overlay_default_fb, 1.0f);
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_in_front_fb);
|
||||
}
|
||||
|
||||
if (!DRW_pass_is_empty(psl->edit_mesh_depth_ps[IN_FRONT])) {
|
||||
|
|
|
@ -306,8 +306,6 @@ typedef struct OVERLAY_PrivateData {
|
|||
float overlay_color[4];
|
||||
} edit_text;
|
||||
struct {
|
||||
int ghost_ob;
|
||||
int edit_ob;
|
||||
bool do_zbufclip;
|
||||
bool do_faces;
|
||||
bool do_edges;
|
||||
|
|
Loading…
Reference in New Issue