[Bf-blender-cvs] [b246f814123] master: Fix T92311: Snap to faces in edit mode with x-ray enabled doesn't work

Germano Cavalcante noreply at git.blender.org
Mon Oct 18 16:41:44 CEST 2021


Commit: b246f8141236712b1a08c9a5ee2feda9bf4e2527
Author: Germano Cavalcante
Date:   Mon Oct 18 11:41:16 2021 -0300
Branches: master
https://developer.blender.org/rBb246f8141236712b1a08c9a5ee2feda9bf4e2527

Fix T92311: Snap to faces in edit mode with x-ray enabled doesn't work

The `use_occlusion_test` parameter test was accidentally removed in
{rB91c33c8b9952}

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

M	source/blender/editors/transform/transform_snap_object.c

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

diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index 17326001a99..dea8a7c6f03 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -1151,9 +1151,12 @@ static bool raycastObjects(SnapObjectContext *sctx,
                            float r_obmat[4][4],
                            ListBase *r_hit_list)
 {
-  if (v3d && (params->edit_mode_type == SNAP_GEOM_EDIT) && XRAY_FLAG_ENABLED(v3d)) {
-    /* Use of occlude geometry in editing mode disabled. */
-    return false;
+  if (params->use_occlusion_test && v3d && XRAY_FLAG_ENABLED(v3d)) {
+    /* General testing of occlusion geometry is disabled if the snap is not intended for the edit
+     * cage. */
+    if (params->edit_mode_type == SNAP_GEOM_EDIT) {
+      return false;
+    }
   }
 
   sctx->runtime.depsgraph = depsgraph;



More information about the Bf-blender-cvs mailing list