[Bf-blender-cvs] [2b445b8] master: Fix T46583: Sculpt symmetry don't work in clipping border view mode

Sergey Sharybin noreply at git.blender.org
Tue Feb 2 16:05:45 CET 2016


Commit: 2b445b83fe0ac8eb4ca0e8a1444bde73ff3b50b3
Author: Sergey Sharybin
Date:   Tue Feb 2 16:04:33 2016 +0100
Branches: master
https://developer.blender.org/rB2b445b83fe0ac8eb4ca0e8a1444bde73ff3b50b3

Fix T46583: Sculpt symmetry don't work in clipping border view mode

This is an attempt to solve the issue by doing clip test on the original
side of the stroke. Some extra testing is required.

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

M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 5675b2e..245724f 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -629,6 +629,7 @@ typedef struct SculptBrushTest {
 	float radius_squared;
 	float location[3];
 	float dist;
+	int mirror_symmetry_pass;
 
 	/* View3d clipping - only set rv3d for clipping */
 	RegionView3D *clip_rv3d;
@@ -642,6 +643,7 @@ static void sculpt_brush_test_init(SculptSession *ss, SculptBrushTest *test)
 	copy_v3_v3(test->location, ss->cache->location);
 	test->dist = 0.0f;   /* just for initialize */
 
+	test->mirror_symmetry_pass = ss->cache->mirror_symmetry_pass;
 
 	if (rv3d->rflag & RV3D_CLIPPING) {
 		test->clip_rv3d = rv3d;
@@ -654,7 +656,12 @@ static void sculpt_brush_test_init(SculptSession *ss, SculptBrushTest *test)
 BLI_INLINE bool sculpt_brush_test_clipping(const SculptBrushTest *test, const float co[3])
 {
 	RegionView3D *rv3d = test->clip_rv3d;
-	return (rv3d && (ED_view3d_clipping_test(rv3d, co, true)));
+	if (!rv3d) {
+		return false;
+	}
+	float symm_co[3];
+	flip_v3_v3(symm_co, co, test->mirror_symmetry_pass);
+	return ED_view3d_clipping_test(rv3d, symm_co, true);
 }
 
 static bool sculpt_brush_test(SculptBrushTest *test, const float co[3])




More information about the Bf-blender-cvs mailing list