diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-05 07:02:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-05 07:05:00 +0300 |
commit | 9d82a38d0a7a3894275afb08886fcb2641a13c3b (patch) | |
tree | df0a007be6d8d033ca49c9393c82a8e8093ef1cb | |
parent | 21e379b7335efe340218ebfe6b576f826c990948 (diff) |
Fix T62159: Poly build crashes w/o overlays
-rw-r--r-- | source/blender/editors/mesh/editmesh_polybuild.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); } |