Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2013-03-30 15:40:09 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-03-30 15:40:09 +0400
commitae1028df73dc4280b033a6c3230dbb9402b15a2f (patch)
treea26e8041370d56cee12d50b1fb30196273de0ed2 /source
parentcd6d337d410fcef8d9ea9a06ae4f6cffc2942b84 (diff)
Tidy up stroke options and make them sexy, aka the paint option
sculptification commit. We have a drop menu to select the stroke mode now. Jitter controls appear under stroke panel under all modes (As they should! They stroke control options). Also enable jittering for all modes. I really fail to see why not.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c12
-rw-r--r--source/blender/makesrna/intern/rna_brush.c15
2 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 83b144e314e..d5ece4830af 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -278,9 +278,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve
paint_brush_update(C, brush, mode, stroke, mouse_in, pressure);
- /* TODO: as sculpt and other paint modes are unified, this
- * separation will go away */
- if (paint_supports_jitter(mode)) {
+ {
float delta[2];
float factor = stroke->zoom_2d;
@@ -298,9 +296,6 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve
add_v2_v2v2(mouse_out, mouse_in, delta);
}
}
- else {
- copy_v2_v2(mouse_out, mouse_in);
- }
/* TODO: can remove the if statement once all modes have this */
if (stroke->get_location)
@@ -525,11 +520,6 @@ bool paint_supports_dynamic_tex_coords(Brush *br, PaintMode mode)
return true;
}
-bool paint_supports_jitter(PaintMode mode)
-{
- return ELEM3(mode, PAINT_SCULPT, PAINT_TEXTURE_PROJECTIVE, PAINT_TEXTURE_2D);
-}
-
#define PAINT_STROKE_MODAL_CANCEL 1
/* called in paint_ops.c, on each regeneration of keymaps */
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index de68c4d19d9..a1e057aed69 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -551,7 +551,7 @@ static void rna_def_brush(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- static EnumPropertyItem brush_stroke_method_items[] = {
+ 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_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"},
@@ -560,6 +560,13 @@ static void rna_def_brush(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
+ static EnumPropertyItem brush_stroke_method_items[] = {
+ {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)"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
static EnumPropertyItem texture_angle_source_items[] = {
{0, "USER", 0, "User", "Rotate the brush texture by given angle"},
{BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"},
@@ -628,6 +635,12 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stroke Method", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ prop = RNA_def_property(srna, "sculpt_stroke_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, sculpt_stroke_method_items);
+ RNA_def_property_ui_text(prop, "Stroke Method", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
prop = RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, texture_angle_source_items);