[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20443] trunk/blender/source/blender/src/ imagepaint.c: Workaround for size 1 brushes not working with projection paint,

Campbell Barton ideasman42 at gmail.com
Wed May 27 04:03:26 CEST 2009


Revision: 20443
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20443
Author:   campbellbarton
Date:     2009-05-27 04:03:22 +0200 (Wed, 27 May 2009)

Log Message:
-----------
Workaround for size 1 brushes not working with projection paint,
need to investigate why this wont work but for now just clamp the value while projection painting.

Modified Paths:
--------------
    trunk/blender/source/blender/src/imagepaint.c

Modified: trunk/blender/source/blender/src/imagepaint.c
===================================================================
--- trunk/blender/source/blender/src/imagepaint.c	2009-05-27 01:29:41 UTC (rev 20442)
+++ trunk/blender/source/blender/src/imagepaint.c	2009-05-27 02:03:22 UTC (rev 20443)
@@ -4438,6 +4438,7 @@
 	BrushPainter *painter;
 	ToolSettings *settings= G.scene->toolsettings;
 	short prevmval[2], mval[2], project = 0;
+	short brush_size_orig; /* not nice hack because 1 size brushes always fail with projection paint */
 	double time;
 	float pressure;
 	int init = 1;
@@ -4472,6 +4473,8 @@
 		ps.brush = s.brush;
 		ps.tool = s.tool;
 		ps.blend = s.blend;
+		
+		brush_size_orig = ps.brush->size; /* hack, fixme */
 	}
 	
 	if(texpaint) {
@@ -4535,6 +4538,10 @@
 			persp(PERSP_WIN);
 			return;
 		}
+		
+		/* Dont allow brush size below 2 */
+		if (ps.brush->size<=1)
+			ps.brush->size = 2;
 	}
 	
 	settings->imapaint.flag |= IMAGEPAINT_DRAWING;
@@ -4613,6 +4620,7 @@
 	brush_painter_free(painter);
 
 	if (project) {
+		ps.brush->size = brush_size_orig;
 		project_paint_end(&ps);
 	}
 	





More information about the Bf-blender-cvs mailing list