[Bf-blender-cvs] [4c8b93c5c2d] blender-v3.0-release: Fix T93732: Snap Cursor not working after changing Add Object settings

Germano Cavalcante noreply at git.blender.org
Mon Jan 10 17:04:40 CET 2022


Commit: 4c8b93c5c2d9f9e1a0b9b5378858b66b427dee2e
Author: Germano Cavalcante
Date:   Sun Dec 5 22:39:04 2021 -0300
Branches: blender-v3.0-release
https://developer.blender.org/rB4c8b93c5c2d9f9e1a0b9b5378858b66b427dee2e

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 f2b4d30aac5..569aa542487 100644
--- a/source/blender/editors/space_view3d/view3d_cursor_snap.c
+++ b/source/blender/editors/space_view3d/view3d_cursor_snap.c
@@ -922,6 +922,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