[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58570] branches/soc-2013-paint/source/ blender: * Rename BRUSH_RESTORE_MESH to BRUSH_DRAG_DOT.

Antony Riakiotakis kalast at gmail.com
Wed Jul 24 13:10:55 CEST 2013


Revision: 58570
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58570
Author:   psy-fi
Date:     2013-07-24 11:10:54 +0000 (Wed, 24 Jul 2013)
Log Message:
-----------
* Rename BRUSH_RESTORE_MESH to BRUSH_DRAG_DOT. Not useful to have two
names for the same thing.
* Disable pressure for anchored and drag dot strokes. On release
pressure is zero so there is no really useful input to get here from
pressure. Might be worth exploring confirmation with space or enter
here.
* Expose space attenuation property in UI for line strokes as well

Modified Paths:
--------------
    branches/soc-2013-paint/source/blender/blenkernel/intern/brush.c
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_2d.c
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_proj.c
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c

Modified: branches/soc-2013-paint/source/blender/blenkernel/intern/brush.c
===================================================================
--- branches/soc-2013-paint/source/blender/blenkernel/intern/brush.c	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/blenkernel/intern/brush.c	2013-07-24 11:10:54 UTC (rev 58570)
@@ -312,7 +312,7 @@
 	BR_TEST_FLAG(BRUSH_ADAPTIVE_SPACE);
 	BR_TEST_FLAG(BRUSH_LOCK_SIZE);
 	BR_TEST_FLAG(BRUSH_EDGE_TO_EDGE);
-	BR_TEST_FLAG(BRUSH_RESTORE_MESH);
+	BR_TEST_FLAG(BRUSH_DRAG_DOT);
 	BR_TEST_FLAG(BRUSH_INVERSE_SMOOTH_PRESSURE);
 	BR_TEST_FLAG(BRUSH_RANDOM_ROTATION);
 	BR_TEST_FLAG(BRUSH_PLANE_TRIM);
@@ -916,7 +916,7 @@
 
 	/* jitter-ed brush gives weird and unpredictable result for this
 	 * kinds of stroke, so manually disable jitter usage (sergey) */
-	use_jitter &= (brush->flag & (BRUSH_RESTORE_MESH | BRUSH_ANCHORED)) == 0;
+	use_jitter &= (brush->flag & (BRUSH_DRAG_DOT | BRUSH_ANCHORED)) == 0;
 
 	if (use_jitter) {
 		float rand_pos[2];

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c	2013-07-24 11:10:54 UTC (rev 58570)
@@ -648,7 +648,7 @@
 
 	BKE_brush_size_set(scene, brush, max_ff(1.0f, size));
 
-	if ((brush->flag & BRUSH_RESTORE_MESH) || (brush->flag & BRUSH_ANCHORED)) {
+	if ((brush->flag & BRUSH_DRAG_DOT) || (brush->flag & BRUSH_ANCHORED)) {
 		paint_stroke_restore();
 	}
 

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_2d.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-07-24 11:10:54 UTC (rev 58570)
@@ -1060,7 +1060,7 @@
 
 	/* set masking */
 	s->do_masking = ((s->brush->flag & BRUSH_AIRBRUSH) ||
-	                 (s->brush->flag & BRUSH_RESTORE_MESH) ||
+	                 (s->brush->flag & BRUSH_DRAG_DOT) ||
 	                 (s->brush->flag & BRUSH_ANCHORED) ||
 	                 (s->brush->imagepaint_tool == PAINT_TOOL_SMEAR) ||
 	                 (s->brush->mtex.tex && !ELEM3(s->brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)) ||

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_proj.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-07-24 11:10:54 UTC (rev 58570)
@@ -4355,7 +4355,7 @@
 
 		/* disable for 3d mapping also because painting on mirrored mesh can create "stripes" */
 		ps->do_masking = ((brush->flag & BRUSH_AIRBRUSH) ||
-	                      (brush->flag & BRUSH_RESTORE_MESH) ||
+	                      (brush->flag & BRUSH_DRAG_DOT) ||
 	                      (brush->flag & BRUSH_ANCHORED) ||
 		                  (brush->imagepaint_tool == PAINT_TOOL_SMEAR) ||
 		                  (brush->mtex.tex && !ELEM3(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)) ||

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c	2013-07-24 11:10:54 UTC (rev 58570)
@@ -621,7 +621,7 @@
 {
 	if (!(br->flag & BRUSH_SMOOTH_STROKE) ||
 	     (br->flag & BRUSH_ANCHORED) ||
-	     (br->flag & BRUSH_RESTORE_MESH) ||
+	     (br->flag & BRUSH_DRAG_DOT) ||
 	     (br->flag & BRUSH_LINE))
 	{
 		return false;
@@ -735,8 +735,8 @@
 	bool redraw = false;
 	float pressure;
 
-	/* see if tablet affects event. Line strokes do not support pressure */
-	pressure = (stroke->brush->flag & BRUSH_LINE) ? 1.0 : event_tablet_data(event, &stroke->pen_flip);
+	/* see if tablet affects event. Line, anchored and drag dot strokes do not support pressure */
+	pressure = (stroke->brush->flag & (BRUSH_LINE | BRUSH_ANCHORED | BRUSH_DRAG_DOT)) ? 1.0 : event_tablet_data(event, &stroke->pen_flip);
 
 	paint_stroke_add_sample(p, stroke, event->mval[0], event->mval[1], pressure);
 	paint_stroke_sample_average(stroke, &sample_average);

Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c	2013-07-24 11:10:54 UTC (rev 58570)
@@ -412,7 +412,7 @@
 	        /* Requires mesh restore, which doesn't work with
 	         * dynamic-topology */
 	        !(brush->flag & BRUSH_ANCHORED) &&
-	        !(brush->flag & BRUSH_RESTORE_MESH) &&
+	        !(brush->flag & BRUSH_DRAG_DOT) &&
         
 	        (!ELEM6(brush->sculpt_tool,
 	                /* These brushes, as currently coded, cannot
@@ -4223,7 +4223,7 @@
 	if ((brush->flag & BRUSH_ANCHORED) ||
 	    (brush->sculpt_tool == SCULPT_TOOL_GRAB &&
 	     BKE_brush_use_size_pressure(ss->cache->vc->scene, brush)) ||
-	    (brush->flag & BRUSH_RESTORE_MESH))
+	    (brush->flag & BRUSH_DRAG_DOT))
 	{
 		paint_mesh_restore_co(sd, ob);
 	}

Modified: branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h	2013-07-24 11:10:54 UTC (rev 58570)
@@ -165,7 +165,7 @@
 	BRUSH_LOCK_SIZE = (1 << 20),
 //	BRUSH_TEXTURE_OVERLAY = (1 << 21), /* obsolete, use overlay_flags |= BRUSH_OVERLAY_PRIMARY instead */
 	BRUSH_EDGE_TO_EDGE = (1 << 22),
-	BRUSH_RESTORE_MESH = (1 << 23),
+	BRUSH_DRAG_DOT = (1 << 23),
 	BRUSH_INVERSE_SMOOTH_PRESSURE = (1 << 24),
 	BRUSH_RANDOM_ROTATION = (1 << 25),
 	BRUSH_PLANE_TRIM = (1 << 26),

Modified: branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c	2013-07-24 11:10:29 UTC (rev 58569)
+++ branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c	2013-07-24 11:10:54 UTC (rev 58570)
@@ -131,7 +131,7 @@
 {
 	Brush *br = (Brush *)ptr->data;
 	return (!(br->flag & BRUSH_ANCHORED) &&
-	        !(br->flag & BRUSH_RESTORE_MESH) &&
+	        !(br->flag & BRUSH_DRAG_DOT) &&
 	        !ELEM4(br->sculpt_tool,
 	               SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
 	               SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
@@ -211,7 +211,8 @@
 {
 	Brush *br = (Brush *)ptr->data;
 	return (!(br->flag & BRUSH_ANCHORED) &&
-	        !(br->flag & BRUSH_RESTORE_MESH) &&
+	        !(br->flag & BRUSH_DRAG_DOT) &&
+	        !(br->flag & BRUSH_LINE) &&
 	        !ELEM4(br->sculpt_tool,
 	               SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
 	               SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
@@ -228,7 +229,7 @@
 static int rna_ImapaintToolCapabilities_has_space_attenuation_get(PointerRNA *ptr)
 {
 	Brush *br = (Brush *)ptr->data;
-	return ((br->flag & BRUSH_SPACE) && (br->flag & BRUSH_ACCUMULATE));
+	return ((br->flag & (BRUSH_SPACE | BRUSH_LINE)) && (br->flag & BRUSH_ACCUMULATE));
 }
 
 static int rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
@@ -275,7 +276,7 @@
 	Brush *br = (Brush *)ptr->data;
 
 	return ((br->flag & BRUSH_AIRBRUSH) ||
-	        (br->flag & BRUSH_RESTORE_MESH) ||
+	        (br->flag & BRUSH_DRAG_DOT) ||
 	        (br->flag & BRUSH_ANCHORED) ||
 	        (br->imagepaint_tool == PAINT_TOOL_SMEAR) ||
 	        (br->mtex.tex && !ELEM3(br->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D))
@@ -679,7 +680,7 @@
 	
 	static EnumPropertyItem sculpt_stroke_method_items[] = {
 		{0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
-		{BRUSH_RESTORE_MESH, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
+		{BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"},
 		{BRUSH_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"},
 		{BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"},
 		{BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", "Keep applying paint effect while holding mouse (spray)"},
@@ -1101,7 +1102,7 @@
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 
 	prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_DRAG_DOT);
 	RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 




More information about the Bf-blender-cvs mailing list