Object Mode: Make Flat object selectable in ortho view ...
... when wireframe is enabled
This commit is contained in:
parent
b62d140be9
commit
1f1d5e1dd2
Notes:
blender-bot
2023-02-14 07:39:46 +01:00
Referenced by issue #65049, rotate/pan the viewport makes blender crash (in very specific case) Referenced by issue #55242, Selecting infinitely thin objects that are perpendicular to the view is not possible (without wireframe)
|
@ -137,6 +137,24 @@ static void basic_cache_populate(void *vedata, Object *ob)
|
|||
}
|
||||
}
|
||||
|
||||
/* Make flat object selectable in ortho view if wireframe is enabled. */
|
||||
if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) ||
|
||||
(ob->dtx & OB_DRAWWIRE) ||
|
||||
(ob->dt == OB_WIRE))
|
||||
{
|
||||
int flat_axis = 0;
|
||||
bool is_flat_object_viewed_from_side = (draw_ctx->rv3d->persp == RV3D_ORTHO) &&
|
||||
DRW_object_is_flat(ob, &flat_axis) &&
|
||||
DRW_object_axis_orthogonal_to_view(ob, flat_axis);
|
||||
|
||||
if (is_flat_object_viewed_from_side) {
|
||||
/* Avoid loosing flat objects when in ortho views (see T56549) */
|
||||
struct GPUBatch *geom = DRW_cache_object_wire_outline_get(ob);
|
||||
DRW_shgroup_call_object_add(stl->g_data->depth_shgrp, geom, ob);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
|
||||
if (geom) {
|
||||
const bool do_cull = (draw_ctx->v3d && (draw_ctx->v3d->flag2 & V3D_BACKFACE_CULLING));
|
||||
|
|
Loading…
Reference in New Issue