[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47641] branches/soc-2012-bratwurst/source /blender/blenkernel/intern/brush.c: Texture Rake brushes

Antony Riakiotakis kalast at gmail.com
Sat Jun 9 17:32:29 CEST 2012


Revision: 47641
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47641
Author:   psy-fi
Date:     2012-06-09 15:32:24 +0000 (Sat, 09 Jun 2012)
Log Message:
-----------
Texture Rake brushes
====================
* Random angle for brushes

Modified Paths:
--------------
    branches/soc-2012-bratwurst/source/blender/blenkernel/intern/brush.c

Modified: branches/soc-2012-bratwurst/source/blender/blenkernel/intern/brush.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/blenkernel/intern/brush.c	2012-06-09 12:56:54 UTC (rev 47640)
+++ branches/soc-2012-bratwurst/source/blender/blenkernel/intern/brush.c	2012-06-09 15:32:24 UTC (rev 47641)
@@ -1127,6 +1127,11 @@
 		painter->startpaintpos[0] = pos[0];
 		painter->startpaintpos[1] = pos[1];
 
+		if(brush->flag & BRUSH_RANDOM_ROTATION)
+			painter->rotation = BLI_frand()*2*M_PI;
+		else
+			painter->rotation = brush->mtex.rot;
+
 		brush_pressure_apply(painter, brush, pressure);
 		if (painter->cache.enabled)
 			brush_painter_refresh_cache(painter, pos, use_color_correction);
@@ -1136,7 +1141,6 @@
 		painter->firsttouch = 0;
 		painter->lastpaintpos[0] = pos[0];
 		painter->lastpaintpos[1] = pos[1];
-		painter->rotation = brush->mtex.rot;
 	}
 #if 0
 	else if (painter->brush->flag & BRUSH_AIRBRUSH) {
@@ -1195,7 +1199,8 @@
 				painter->rotation = (dmousepos[1] > 0)? angle : -angle;
 				painter->rotation += brush->mtex.rot;
 			}
-		}
+		} else if(brush->flag & BRUSH_RANDOM_ROTATION)
+			painter->rotation = BLI_frand()*2*M_PI;
 
 		if (brush->flag & BRUSH_SPACE) {
 			/* do paint op over unpainted distance */




More information about the Bf-blender-cvs mailing list