[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58816] branches/soc-2013-paint: * Show spacing in UI for polylines

Antony Riakiotakis kalast at gmail.com
Fri Aug 2 02:53:46 CEST 2013


Revision: 58816
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58816
Author:   psy-fi
Date:     2013-08-02 00:53:45 +0000 (Fri, 02 Aug 2013)
Log Message:
-----------
* Show spacing in UI for polylines
* On Confirm, last line point is dangling, don't use for polyline.

Modified Paths:
--------------
    branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
    branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c

Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py	2013-08-02 00:26:10 UTC (rev 58815)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py	2013-08-02 00:53:45 UTC (rev 58816)
@@ -871,7 +871,7 @@
             row.prop(brush, "spacing", text="Spacing")
             row.prop(brush, "use_pressure_spacing", toggle=True, text="")
             
-        if brush.use_line:
+        if brush.use_line or brush.use_polyline:
             col.separator()
             row = col.row(align=True)
             row.prop(brush, "spacing", text="Spacing")

Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-08-02 00:26:10 UTC (rev 58815)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-08-02 00:53:45 UTC (rev 58816)
@@ -900,7 +900,7 @@
             row.prop(brush, "spacing", text="Spacing")
             row.prop(brush, "use_pressure_spacing", toggle=True, text="")
 
-        if brush.use_line:
+        if brush.use_line or brush.use_polyline:
             col.separator()
             row = col.row(align=True)
             row.prop(brush, "spacing", text="Spacing")

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-08-02 00:26:10 UTC (rev 58815)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c	2013-08-02 00:53:45 UTC (rev 58816)
@@ -768,11 +768,19 @@
 	if (stroke->stroke_started && (br->flag & (BRUSH_LINE | BRUSH_POLYLINE))) {
 		LinePoint *p = stroke->line.first;
 
+		/* last line point in polyline is dangling so remove */
+		if (br->flag & BRUSH_POLYLINE) {
+			LinePoint *plast = stroke->line.last;
+			BLI_remlink(&stroke->line, stroke->line.last);
+			MEM_freeN(plast);
+		}
+
 		stroke->ups->overlap_factor = paint_stroke_integrate_overlap(br, br->spacing);
 
-		paint_brush_stroke_add_step(C, op, p->pos, 1.0);
+		if (p->next)
+			paint_brush_stroke_add_step(C, op, p->pos, 1.0);
 
-		for (; p; p = p->next) {
+		for (p = p->next; p; p = p->next) {
 			paint_space_stroke(C, op, p->pos, 1.0);
 		}
 	}

Modified: branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c	2013-08-02 00:26:10 UTC (rev 58815)
+++ branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c	2013-08-02 00:53:45 UTC (rev 58816)
@@ -1086,6 +1086,11 @@
 	RNA_def_property_ui_text(prop, "Line", "Draw a line with dabs separated according to spacing");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 
+	prop = RNA_def_property(srna, "use_polyline", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_POLYLINE);
+	RNA_def_property_ui_text(prop, "Polyline", "Draw a series of lines with dabs separated according to spacing");
+	RNA_def_property_update(prop, 0, "rna_Brush_update");
+
 	prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
 	RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");




More information about the Bf-blender-cvs mailing list