[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39134] branches/soc-2011-onion/source/ blender/editors/sculpt_paint: for testing purposes, I made it so vpaint does nothing but beep if there is an error parsing the .myp file.

Jason Wilkins Jason.A.Wilkins at gmail.com
Sun Aug 7 14:07:41 CEST 2011


Revision: 39134
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39134
Author:   jwilkins
Date:     2011-08-07 12:07:41 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
for testing purposes, I made it so vpaint does nothing but beep if there is an error parsing the .myp file.  Also adjusted size of mypaint brush, I'm still not certain how to create an intuitive connection between the cursor size and the actual size of what you see the brush do.  this problem exists in mypaint as well apparently

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_stroke.c

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp	2011-08-07 12:01:24 UTC (rev 39133)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_brushlib.cpp	2011-08-07 12:07:41 UTC (rev 39134)
@@ -650,6 +650,9 @@
 {
 	Brush *brush= new Brush();
 
+	if (strlen(filepath_in) == 0)
+		return NULL;
+
 	char filepath[240];
 	BLI_strncpy(filepath, filepath_in, sizeof(filepath));
 	BLI_path_abs(filepath, G.main->name);
@@ -661,7 +664,7 @@
 		return reinterpret_cast<BrushLibBrush *>(brush);
 	}
 	else {
-		parse_message("failed\n");
+		parse_message("failed\a\n");
 
 		delete brush;
 
@@ -870,7 +873,7 @@
 	float radius2d)
 {
 	Brush* brush= reinterpret_cast<Brush *>(brushlib_brush);
-	brush->set_base_value(BRUSH_RADIUS_LOGARITHMIC, logf(0.15f*radius2d));
+	brush->set_base_value(BRUSH_RADIUS_LOGARITHMIC, logf(0.30f*radius2d));
 }
 
 void paint_brushlib_set_color(

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_stroke.c	2011-08-07 12:01:24 UTC (rev 39133)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_stroke.c	2011-08-07 12:07:41 UTC (rev 39134)
@@ -611,28 +611,30 @@
 		stroke->restore(C);
 	}
 
-	if (stroke->params.flag & STROKE_BRUSHLIB &&
-		stroke->brushlib_surface &&
-		stroke->brushlib_brush)
-	{
-		float dtime= (stroke->current.time) - (stroke->path.time);
+	if (stroke->params.flag & STROKE_BRUSHLIB) {
+		if (stroke->brushlib_surface && stroke->brushlib_brush) {
+			float dtime= (stroke->current.time) - (stroke->path.time);
 
-		if (stroke->first_step) {
-			paint_brushlib_set_radius(stroke->brushlib_brush, stroke->params.radius2d);
-			paint_brushlib_set_color(stroke->brushlib_brush, stroke->params.rgb);
+			if (stroke->first_step) {
+				paint_brushlib_set_radius(stroke->brushlib_brush, stroke->params.radius2d);
+				paint_brushlib_set_color(stroke->brushlib_brush, stroke->params.rgb);
+			}
+
+			paint_brushlib_brush_stroke_to(
+				C,
+				stroke,
+				stroke->brushlib_brush,
+				stroke->brushlib_surface,
+				stroke->current.mouse[0],
+				stroke->current.mouse[1],
+				stroke->current.pressure,
+				stroke->current.tilt_vector[0],
+				stroke->current.tilt_vector[1],
+				dtime);
 		}
-
-		paint_brushlib_brush_stroke_to(
-			C,
-			stroke,
-			stroke->brushlib_brush,
-			stroke->brushlib_surface,
-			stroke->current.mouse[0],
-			stroke->current.mouse[1],
-			stroke->current.pressure,
-			stroke->current.tilt_vector[0],
-			stroke->current.tilt_vector[1],
-			dtime);
+		else {
+			/* ignore dab, an error must have occured */
+		}
 	}
 	else {
 		if (stroke->update_step)
@@ -813,7 +815,10 @@
 		stroke->current.time= 0;
 
 #if WITH_BRUSHLIB
-	if (!(stroke->init_brushlib) && stroke->surface_new) {
+	if ((stroke->params.flag & STROKE_BRUSHLIB) &&
+	    !(stroke->init_brushlib) &&
+	    stroke->surface_new)
+	{
 		stroke->brushlib_brush=
 			paint_brushlib_new_brush(stroke->mouse_avg[0], stroke->mouse_avg[1], stroke->params.brushlib_filepath);
 




More information about the Bf-blender-cvs mailing list