[Bf-blender-cvs] [3d8dea9ff92] master: Fix T93732: Snap Cursor not working after changing Add Object settings

Germano Cavalcante noreply at git.blender.org
Mon Dec 6 03:41:05 CET 2021


Commit: 3d8dea9ff92d242174613063527f4add98688bac
Author: Germano Cavalcante
Date:   Sun Dec 5 22:39:04 2021 -0300
Branches: master
https://developer.blender.org/rB3d8dea9ff92d242174613063527f4add98688bac

Fix T93732: Snap Cursor not working after changing Add Object settings

`g_data_intern.state_default.gzgrp_type` is a very specific member and
cannot be set to default.

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

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

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

diff --git a/source/blender/editors/space_view3d/view3d_cursor_snap.c b/source/blender/editors/space_view3d/view3d_cursor_snap.c
index 47e7d452585..af3425111a3 100644
--- a/source/blender/editors/space_view3d/view3d_cursor_snap.c
+++ b/source/blender/editors/space_view3d/view3d_cursor_snap.c
@@ -919,6 +919,14 @@ static void v3d_cursor_snap_free(void)
 void ED_view3d_cursor_snap_state_default_set(V3DSnapCursorState *state)
 {
   g_data_intern.state_default = *state;
+
+  /* These values are temporarily set by the tool.
+   * They are not convenient as default values.
+   * So reset to null. */
+  g_data_intern.state_default.gzgrp_type = NULL;
+  g_data_intern.state_default.prevpoint = NULL;
+  g_data_intern.state_default.draw_plane = false;
+  g_data_intern.state_default.draw_box = false;
 }
 
 V3DSnapCursorState *ED_view3d_cursor_snap_active(void)



More information about the Bf-blender-cvs mailing list