[Bf-blender-cvs] [64ee6f4e9f3] blender2.8: Fix error when snapping with occlusion.

Germano noreply at git.blender.org
Fri May 25 23:43:55 CEST 2018


Commit: 64ee6f4e9f31d991ee83c77c428736b9c4e81b59
Author: Germano
Date:   Fri May 25 18:43:38 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB64ee6f4e9f31d991ee83c77c428736b9c4e81b59

Fix error when snapping with occlusion.

Face normal may be facing the wrong side.

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

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 2b95c0fcc41..29497fe801c 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -2513,6 +2513,10 @@ static short transform_snap_context_project_view3d_mixed_impl(
 			/* Compute the new clip_pane but do not add it yet. */
 			float new_clipplane[4];
 			plane_from_point_normal_v3(new_clipplane, loc, no);
+			if (dot_v3v3(snapdata.clip_plane[0], new_clipplane) > 0.0f) {
+				/* The plane is facing the wrong direction. */
+				negate_v4(new_clipplane);
+			}
 
 			/* Try to snap only to the polygon. */
 			elem = snap_mesh_polygon(



More information about the Bf-blender-cvs mailing list