[Bf-blender-cvs] [251c0175349] master: Fix T93477: Viewport X-Ray is influencing snapping even in material mode

Germano Cavalcante noreply at git.blender.org
Tue Nov 30 15:05:19 CET 2021


Commit: 251c0175349d5b2e2e55e7aa19a0dd41d3281931
Author: Germano Cavalcante
Date:   Tue Nov 30 10:15:25 2021 -0300
Branches: master
https://developer.blender.org/rB251c0175349d5b2e2e55e7aa19a0dd41d3281931

Fix T93477: Viewport X-Ray is influencing snapping even in material mode

The default snap behavior to perform on tools and cursors is to the
final geometry and not edited geometry.

In snapping to edited geometry, there are some specific behaviors that
are not convenient in some cases. For example the general occlusion
test of X-Ray geometries during dragdrop.

This fix also resolves a regression for tools like measure and placement
that were also ignoring the snap to face in x-ray mode.

Differential Revision: https://developer.blender.org/D13410

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

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 ac80a70011a..47e7d452585 100644
--- a/source/blender/editors/space_view3d/view3d_cursor_snap.c
+++ b/source/blender/editors/space_view3d/view3d_cursor_snap.c
@@ -94,7 +94,7 @@ typedef struct SnapCursorDataIntern {
 } SnapCursorDataIntern;
 
 static SnapCursorDataIntern g_data_intern = {
-    .state_default = {.prevpoint = NULL,
+    .state_default = {.flag = V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL,
                       .snap_elem_force = SCE_SNAP_MODE_GEOM,
                       .plane_axis = 2,
                       .color_point = {255, 255, 255, 255},



More information about the Bf-blender-cvs mailing list