[Bf-blender-cvs] [174acd9ca37] blender2.8: Fix T59210: Measure tool crash w/o overlays/gizmos

Campbell Barton noreply at git.blender.org
Wed Dec 12 00:44:42 CET 2018


Commit: 174acd9ca376a4fb0e4a50d27359ee5f8ac7f3fe
Author: Campbell Barton
Date:   Wed Dec 12 10:44:04 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB174acd9ca376a4fb0e4a50d27359ee5f8ac7f3fe

Fix T59210: Measure tool crash w/o overlays/gizmos

===================================================================

M	source/blender/editors/space_view3d/view3d_gizmo_ruler.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list