[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60515] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: real fix for #36695, scale brush stroke with maximum scale component,

Antony Riakiotakis kalast at gmail.com
Thu Oct 3 00:46:26 CEST 2013


Revision: 60515
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60515
Author:   psy-fi
Date:     2013-10-02 22:46:26 +0000 (Wed, 02 Oct 2013)
Log Message:
-----------
real fix for #36695, scale brush stroke with maximum scale component,
except layer brush where the previous algorithm is used.

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 22:18:23 UTC (rev 60514)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-10-02 22:46:26 UTC (rev 60515)
@@ -3801,10 +3801,24 @@
 	ss->cache = cache;
 
 	/* Set scaling adjustment */
-	cache->scale[0] = 1.0f / ob->size[0];
-	cache->scale[1] = 1.0f / ob->size[1];
-	cache->scale[2] = 1.0f / ob->size[2];
 
+	if (brush->sculpt_tool == SCULPT_TOOL_LAYER) {
+		cache->scale[0] = 1.0f / ob->size[0];
+		cache->scale[1] = 1.0f / ob->size[1];
+		cache->scale[2] = 1.0f / ob->size[2];
+	}
+	else {
+		float max_scale = 0.0f;
+
+		for (i = 0; i < 3; i ++) {
+			if (fabs(ob->size[i]) > max_scale)
+				max_scale = fabs(ob->size[i]);
+		}
+
+		cache->scale[0] = max_scale / ob->size[0];
+		cache->scale[1] = max_scale / ob->size[1];
+		cache->scale[2] = max_scale / ob->size[2];
+	}
 	cache->plane_trim_squared = brush->plane_trim * brush->plane_trim;
 
 	cache->flag = 0;




More information about the Bf-blender-cvs mailing list