From 9d82a38d0a7a3894275afb08886fcb2641a13c3b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Mar 2019 15:02:39 +1100 Subject: Fix T62159: Poly build crashes w/o overlays --- source/blender/editors/mesh/editmesh_polybuild.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_polybuild.c') diff --git a/source/blender/editors/mesh/editmesh_polybuild.c b/source/blender/editors/mesh/editmesh_polybuild.c index e7e69703237..c94cc525e48 100644 --- a/source/blender/editors/mesh/editmesh_polybuild.c +++ b/source/blender/editors/mesh/editmesh_polybuild.c @@ -86,11 +86,16 @@ static void edbm_flag_disable_all_multi(ViewLayer *view_layer, View3D *v3d, cons /* When accessed as a tool, get the active edge from the preselection gizmo. */ static bool edbm_preselect_or_active( bContext *C, + const View3D *v3d, Base **r_base, BMElem **r_ele) { ARegion *ar = CTX_wm_region(C); - wmGizmoMap *gzmap = ar->gizmo_map; + const bool show_gizmo = !( + (v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL))); + + wmGizmoMap *gzmap = show_gizmo ? ar->gizmo_map : NULL; wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_mesh_preselect_elem") : NULL; if (gzgroup != NULL) { wmGizmo *gz = gzgroup->gizmos.first; @@ -115,7 +120,7 @@ static bool edbm_preselect_or_active_init_viewcontext( BMElem **r_ele) { em_setup_viewcontext(C, vc); - bool ok = edbm_preselect_or_active(C, r_base, r_ele); + bool ok = edbm_preselect_or_active(C, vc->v3d, r_base, r_ele); if (ok) { ED_view3d_viewcontext_init_object(vc, (*r_base)->object); } -- cgit v1.2.3