diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-12 02:44:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-12 02:44:04 +0300 |
commit | 174acd9ca376a4fb0e4a50d27359ee5f8ac7f3fe (patch) | |
tree | c23b2a2a261af551b97a6787a71a79259ce0d731 | |
parent | ff108aac631f0f48e138fe4b4b850b2103cb0c57 (diff) |
Fix T59210: Measure tool crash w/o overlays/gizmos
-rw-r--r-- | source/blender/editors/space_view3d/view3d_gizmo_ruler.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index 5623681fec4..ed5a1ab7720 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -33,6 +33,7 @@ #include "BKE_context.h" #include "BKE_gpencil.h" #include "BKE_main.h" +#include "BKE_report.h" #include "BKE_object.h" #include "BKE_unit.h" @@ -1037,12 +1038,19 @@ static bool view3d_ruler_poll(bContext *C) return true; } -static int view3d_ruler_add_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) +static int view3d_ruler_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = ar->regiondata; + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) || + (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL))) + { + BKE_report(op->reports, RPT_WARNING, "Gizmos hidden in this view"); + return OPERATOR_CANCELLED; + } + wmGizmoMap *gzmap = ar->gizmo_map; wmGizmoGroup *gzgroup = WM_gizmomap_group_find(gzmap, view3d_gzgt_ruler_id); const bool use_depth = (v3d->shading.type >= OB_SOLID); |