From 5bc71f22a24a48780fe335c557f2f9bbc690eb85 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Tue, 10 Jan 2023 15:56:17 -0300 Subject: [PATCH] Snap Gizmo: remove unused "snap_elements" This property was intended to keep the snap elements synchronized with the scene. But another solution exists. And this property is not even working correctly. --- .../gizmo_library/gizmo_types/snap3d_gizmo.c | 17 ----------------- 1 file changed, 17 deletions(-) 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 c5a542c0bf3..5cac8b93b88 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c @@ -41,17 +41,6 @@ typedef struct SnapGizmo3D { V3DSnapCursorState *snap_state; } SnapGizmo3D; -static void snap_gizmo_snap_elements_update(SnapGizmo3D *snap_gizmo) -{ - wmGizmoProperty *gz_prop_snap; - gz_prop_snap = WM_gizmo_target_property_find(&snap_gizmo->gizmo, "snap_elements"); - - if (gz_prop_snap->prop) { - V3DSnapCursorState *snap_state = snap_gizmo->snap_state; - snap_state->snap_elem_force |= RNA_property_enum_get(&gz_prop_snap->ptr, gz_prop_snap->prop); - } -} - /* -------------------------------------------------------------------- */ /** \name ED_gizmo_library specific API * \{ */ @@ -262,9 +251,6 @@ static int snap_gizmo_test_select(bContext *C, wmGizmo *gz, const int mval[2]) { SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)gz; - /* Snap Elements can change while the gizmo is active. Need to be updated somewhere. */ - snap_gizmo_snap_elements_update(snap_gizmo); - /* Snap values are updated too late at the cursor. Be sure to update ahead of time. */ int x, y; { @@ -404,9 +390,6 @@ static void GIZMO_GT_snap_3d(wmGizmoType *gzt) INT_MAX); RNA_def_property_int_array_funcs_runtime( prop, gizmo_snap_rna_snap_elem_index_get_fn, NULL, NULL); - - /* Read/Write. */ - WM_gizmotype_target_property_def(gzt, "snap_elements", PROP_ENUM, 1); } void ED_gizmotypes_snap_3d(void)