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
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-03-27 02:04:40 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-03-27 02:04:59 +0400
commit0adc1ba209c24a2200c2e42f75e735da0a5f9c2d (patch)
tree0135e85428acb0d680463f8f3ad29b69db6aacb1 /source/blender/makesrna
parent10e754458614638cfde0cdd0e7f9858d24a4079d (diff)
Attempt to fix T39412
do not use different stroke property names for different paint systems. This was done due to different stroke sets being supported for each system, but this lead to trouble if we changed the names (due to different stroke sets being supported) and users created custom keymaps with the old property name saved. The first part of this fix addresses master. A similar commit will be done to soc-2013-paint.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 34c44565456..67cea35b945 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -49,6 +49,13 @@ static EnumPropertyItem prop_direction_items[] = {
{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}
+};
+
EnumPropertyItem brush_sculpt_tool_items[] = {
{SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""},
{SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""},
@@ -465,6 +472,28 @@ static EnumPropertyItem *rna_Brush_direction_itemf(bContext *UNUSED(C), PointerR
}
}
+static EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C, PointerRNA *UNUSED(ptr),
+ PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+{
+ static EnumPropertyItem sculpt_stroke_method_items[] = {
+ {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
+ {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)"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ PaintMode mode = BKE_paintmode_get_active_from_context(C);
+
+ switch(mode) {
+ case PAINT_SCULPT:
+ return sculpt_stroke_method_items;
+
+ default:
+ return brush_stroke_method_items;
+ }
+}
#else
static void rna_def_brush_texture_slot(BlenderRNA *brna)
@@ -613,22 +642,6 @@ static void rna_def_brush(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- static EnumPropertyItem sculpt_stroke_method_items[] = {
- {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
- {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)"},
- {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"},
@@ -694,12 +707,7 @@ static void rna_def_brush(BlenderRNA *brna)
prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, brush_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, "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_enum_funcs(prop, NULL, NULL, "rna_Brush_stroke_itemf");
RNA_def_property_ui_text(prop, "Stroke Method", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");