[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60513] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: Revert 60358, it made irregularly scaled objects behave incorrectly, checking out different approach here.

Antony Riakiotakis kalast at gmail.com
Thu Oct 3 00:18:14 CEST 2013


Revision: 60513
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60513
Author:   psy-fi
Date:     2013-10-02 22:18:14 +0000 (Wed, 02 Oct 2013)
Log Message:
-----------
Revert 60358, it made irregularly scaled objects behave incorrectly, checking out different approach here.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-10-02 19:59:55 UTC (rev 60512)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-10-02 22:18:14 UTC (rev 60513)
@@ -1791,6 +1791,7 @@
 
 	/* offset with as much as possible factored in already */
 	mul_v3_v3fl(offset, ss->cache->sculpt_normal_symm, ss->cache->radius);
+	mul_v3_v3(offset, ss->cache->scale);
 	mul_v3_fl(offset, bstrength);
 
 	/* threaded loop over nodes */
@@ -1835,6 +1836,7 @@
 
 	/* offset with as much as possible factored in already */
 	mul_v3_v3fl(offset, ss->cache->sculpt_normal_symm, ss->cache->radius);
+	mul_v3_v3(offset, ss->cache->scale);
 	mul_v3_fl(offset, bstrength);
 	
 	/* we divide out the squared alpha and multiply by the squared crease to give us the pinch strength */
@@ -2263,7 +2265,8 @@
 				if (vd.fno) copy_v3_v3(val, vd.fno);
 				else normal_short_to_float_v3(val, vd.no);
 				
-				mul_v3_v3fl(proxy[vd.i], val, fade * ss->cache->radius);
+				mul_v3_fl(val, fade * ss->cache->radius);
+				mul_v3_v3v3(proxy[vd.i], val, ss->cache->scale);
 
 				if (vd.mvert)
 					vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
@@ -2642,7 +2645,8 @@
 
 	displace = radius * offset;
 
-	mul_v3_v3fl(temp, an, displace);
+	mul_v3_v3v3(temp, an, ss->cache->scale);
+	mul_v3_fl(temp, displace);
 	add_v3_v3(fc, temp);
 
 	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
@@ -2711,7 +2715,8 @@
 
 	displace = radius * (0.25f + offset);
 
-	mul_v3_v3fl(temp, an, displace);
+	mul_v3_v3v3(temp, an, ss->cache->scale);
+	mul_v3_fl(temp, displace);
 	add_v3_v3(fc, temp);
 
 	/* add_v3_v3v3(p, ss->cache->location, an); */
@@ -2798,7 +2803,8 @@
 
 	displace = radius * (0.25f + offset);
 
-	mul_v3_v3fl(temp, sn, displace);
+	mul_v3_v3v3(temp, sn, ss->cache->scale);
+	mul_v3_fl(temp, displace);
 	add_v3_v3(fc, temp);
 
 	/* init mat */
@@ -2877,7 +2883,8 @@
 
 	displace = radius * offset;
 
-	mul_v3_v3fl(temp, an, displace);
+	mul_v3_v3v3(temp, an, ss->cache->scale);
+	mul_v3_fl(temp, displace);
 	add_v3_v3(fc, temp);
 
 	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
@@ -2940,7 +2947,8 @@
 
 	displace = -radius * offset;
 
-	mul_v3_v3fl(temp, an, displace);
+	mul_v3_v3v3(temp, an, ss->cache->scale);
+	mul_v3_fl(temp, displace);
 	add_v3_v3(fc, temp);
 
 	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)




More information about the Bf-blender-cvs mailing list