[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58501] branches/soc-2013-paint: * RNA properties for line stroke
Antony Riakiotakis
kalast at gmail.com
Mon Jul 22 16:39:23 CEST 2013
Revision: 58501
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58501
Author: psy-fi
Date: 2013-07-22 14:39:22 +0000 (Mon, 22 Jul 2013)
Log Message:
-----------
* RNA properties for line stroke
* Airbrush is not applied on mousemove anymore, only on timer.
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/makesdna/DNA_brush_types.h
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-07-22 14:39:15 UTC (rev 58500)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-07-22 14:39:22 UTC (rev 58501)
@@ -861,9 +861,13 @@
if brush.use_space:
col.separator()
row = col.row(align=True)
- row.active = brush.use_space
row.prop(brush, "spacing", text="Spacing")
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
+
+ if brush.use_line:
+ col.separator()
+ row = col.row(align=True)
+ row.prop(brush, "spacing", text="Spacing")
col = layout.column()
col.separator()
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-07-22 14:39:15 UTC (rev 58500)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-07-22 14:39:22 UTC (rev 58501)
@@ -892,10 +892,14 @@
if brush.use_space:
col.separator()
row = col.row(align=True)
- row.active = brush.use_space
row.prop(brush, "spacing", text="Spacing")
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
+ if brush.use_line:
+ col.separator()
+ row = col.row(align=True)
+ row.prop(brush, "spacing", text="Spacing")
+
if context.sculpt_object:
if brush.sculpt_capabilities.has_jitter:
col.separator()
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-22 14:39:15 UTC (rev 58500)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_stroke.c 2013-07-22 14:39:22 UTC (rev 58501)
@@ -785,8 +785,11 @@
stroke_done(C, op);
return OPERATOR_FINISHED;
}
- else if (first_modal || (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) ||
- (event->type == TIMER && (event->customdata == stroke->timer)) )
+ else if (first_modal ||
+ /* regular dabs */
+ (!(stroke->brush->flag & BRUSH_AIRBRUSH) && (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE))) ||
+ /* airbrush */
+ ((stroke->brush->flag & BRUSH_AIRBRUSH) && event->type == TIMER && event->customdata == stroke->timer))
{
if (paint_smooth_stroke(stroke, mouse, &pressure, &sample_average, mode)) {
if (stroke->stroke_started) {
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-22 14:39:15 UTC (rev 58500)
+++ branches/soc-2013-paint/source/blender/makesdna/DNA_brush_types.h 2013-07-22 14:39:22 UTC (rev 58501)
@@ -171,7 +171,7 @@
BRUSH_PLANE_TRIM = (1 << 26),
BRUSH_FRONTFACE = (1 << 27),
BRUSH_CUSTOM_ICON = (1 << 28),
- //BRUSH_INVERTED = (1 << 29), /* Unused now, free for something new */
+ BRUSH_LINE = (1 << 29),
BRUSH_ABSOLUTE_JITTER = (1 << 30)
} BrushFlags;
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-22 14:39:15 UTC (rev 58500)
+++ branches/soc-2013-paint/source/blender/makesrna/intern/rna_brush.c 2013-07-22 14:39:22 UTC (rev 58501)
@@ -683,6 +683,7 @@
{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)"},
+ {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
{0, NULL, 0, NULL, NULL}
};
@@ -690,6 +691,7 @@
{0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
{BRUSH_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"},
{BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", "Keep applying paint effect while holding mouse (spray)"},
+ {BRUSH_LINE, "LINE", 0, "Line", "Draw a line with dabs separated according to spacing"},
{0, NULL, 0, NULL, NULL}
};
@@ -1053,6 +1055,11 @@
RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LINE);
+ 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_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