[Bf-blender-cvs] [62f8d9e478b] master: Fix T87162: Measure Tool Not Working

Germano Cavalcante noreply at git.blender.org
Sat Apr 3 17:49:52 CEST 2021


Commit: 62f8d9e478b7d6c61a4a8bbd0594e29495938e61
Author: Germano Cavalcante
Date:   Sat Apr 3 12:48:46 2021 -0300
Branches: master
https://developer.blender.org/rB62f8d9e478b7d6c61a4a8bbd0594e29495938e61

Fix T87162: Measure Tool Not Working

The non-enabled gizmo was overwriting the projected coordinate value.

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

M	source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
M	source/blender/editors/space_view3d/view3d_gizmo_ruler.c

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

diff --git a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
index 1d18c82d896..2561de3aca9 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
@@ -412,6 +412,7 @@ void ED_gizmotypes_snap_3d_data_get(
     wmGizmo *gz, float r_loc[3], float r_nor[3], int r_elem_index[3], int *r_snap_elem)
 {
   SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)gz;
+  BLI_assert(snap_gizmo->is_enabled);
   if (r_loc) {
     copy_v3_v3(r_loc, snap_gizmo->loc);
   }
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index 833901b6770..e202276831c 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -389,7 +389,9 @@ static bool view3d_ruler_item_mousemove(struct Depsgraph *depsgraph,
       ED_gizmotypes_snap_3d_update(
           snap_gizmo, depsgraph, ruler_info->region, v3d, ruler_info->wm, mval_fl);
 
-      ED_gizmotypes_snap_3d_data_get(snap_gizmo, co, NULL, NULL, NULL);
+      if (ED_gizmotypes_snap_3d_is_enabled(snap_gizmo)) {
+        ED_gizmotypes_snap_3d_data_get(snap_gizmo, co, NULL, NULL, NULL);
+      }
     }
     return true;
   }



More information about the Bf-blender-cvs mailing list