From 9001dd7f29a2f22534cf5549bc500422b1243c97 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Tue, 19 Oct 2021 12:55:20 -0300 Subject: View3D: Cursor Snap Refactor Make the snap system consistent with the placement tool and leak-safe. **Changes:** - Store `SnapCursorDataIntern` in a `static` variable; - Initialize (lazily) `SnapCursorDataIntern` only once (for the keymap). - Move setup members of `V3DSnapCursorData` to a new struct `V3DSnapCursorState` - Merge `ED_view3d_cursor_snap_activate_point` and `ED_view3d_cursor_snap_activate_plane` into `state = ED_view3d_cursor_snap_active()` - Merge `ED_view3d_cursor_snap_deactivate_point` and `ED_view3d_cursor_snap_deactivate_plane` into `ED_view3d_cursor_snap_deactive(state)` - Be sure to free the snap context when closing via `ED_view3d_cursor_snap_exit` - Use RNA properties callbacks to update the properties of the `"Add Primitive Object"` operator --- source/blender/windowmanager/intern/wm_init_exit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/windowmanager/intern/wm_init_exit.c') diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index d4ef14bbf5d..d0693d37ef4 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -119,6 +119,7 @@ #include "ED_space_api.h" #include "ED_undo.h" #include "ED_util.h" +#include "ED_view3d.h" #include "BLF_api.h" #include "BLT_lang.h" @@ -547,6 +548,7 @@ void WM_exit_ex(bContext *C, const bool do_python) ED_preview_free_dbase(); /* frees a Main dbase, before BKE_blender_free! */ ED_assetlist_storage_exit(); + ED_view3d_cursor_snap_exit(); if (wm) { /* Before BKE_blender_free! - since the ListBases get freed there. */ -- cgit v1.2.3