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:
authorPablo Dobarro <pablodp606@gmail.com>2019-07-31 13:58:50 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-07-31 14:04:55 +0300
commit4bb9fbd3a852c24db928f393467e1eab3a71af6c (patch)
treeba244e420c7758f114a0cf62e907b0e68b000933 /source/blender/makesrna
parent03f652b2c1fc7de685185190ff95bdd240540388 (diff)
Sculpt/Paint: Brush curve presets
This patch introduces the same presets that are used for proportional editing in the brush falloff menu. The user can select any of these presets or use the regular custom falloff curve. The presets are hardcoded formulas, so the falloff curve is not used when they are active. This change improves the general feeling of the brushes and it is more convenient and simpler to use. The CUSTOM curve option should now be used in the case that an unusual deformation is needed, in other cases, the hardcoded curve presets should be the default. The smooth curve presets is a must in the grab brush, as it fixes the deformation issue with the current custom curve setting. The user may try to adjust the deformation by tweaking the curve, but it is nearly impossible to replicate this desired behavior. {F7636217} Other brushes that are included in the sculpt branch also rely on this as they need specific hardcoded falloffs to produce the desired effect. Reviewers: brecht, billreynish Reviewed By: brecht Subscribers: JulienKaspar Differential Revision: https://developer.blender.org/D5367
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index fb60f092d16..eeba7161309 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1565,6 +1565,19 @@ static void rna_def_brush(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL},
};
+ static const EnumPropertyItem brush_curve_preset_items[] = {
+ {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
+ {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
+ {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
+ {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
+ {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
+ {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""},
+ {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""},
+ {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse square", ""},
+ {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+
srna = RNA_def_struct(brna, "Brush", "ID");
RNA_def_struct_ui_text(
srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting");
@@ -1640,6 +1653,11 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mask Tool", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, brush_curve_preset_items);
+ RNA_def_property_ui_text(prop, "Curve Preset", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
/* number values */
prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);