diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-14 23:52:01 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-14 23:54:19 +0300 |
commit | 6b024c7e1aebe8b0a76316ceef3139827cd3cb9f (patch) | |
tree | b508a849330046d22e3dbb77cefcaa48fe88b876 | |
parent | 54f1375e298696b81aea86862ae634eaa8c97464 (diff) |
GP: Improve errase panel and toolbars
Some names were not clear enough and some parameters were missing.
4 files changed, 18 insertions, 11 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 4d7e1d47a59..382944de456 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1239,8 +1239,13 @@ class _defs_gpencil_paint: gp_settings = brush.gpencil_settings if gp_settings.gpencil_brush_type == 'ERASE': - row = layout.row() + row = layout.row(align=True) row.prop(brush, "size", text="Radius") + row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE') + if gp_settings.eraser_mode == 'SOFT': + row = layout.row(align=True) + row.prop(gp_settings, "pen_strength", slider=True) + row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE') elif gp_settings.gpencil_brush_type == 'FILL': row = layout.row() row.prop(gp_settings, "gpencil_fill_leak", text="Leak Size") diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index e763f234f2e..f065e36d19a 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1948,8 +1948,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (brush->gpencil_settings != NULL) { BrushGpencilSettings *gp = brush->gpencil_settings; if (gp->brush_type == GP_BRUSH_TYPE_ERASE) { - gp->era_strength_f = 1.0f; - gp->era_thickness_f = 0.1f; + gp->era_strength_f = 100.0f; + gp->era_thickness_f = 10.0f; } } } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index e8b4d1088df..93c987a4ee8 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1532,8 +1532,8 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p, /* Adjust strength if the eraser is soft */ if (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_SOFT) { - float f_strength = eraser->gpencil_settings->era_strength_f; - float f_thickness = eraser->gpencil_settings->era_thickness_f; + float f_strength = eraser->gpencil_settings->era_strength_f / 100.0f; + float f_thickness = eraser->gpencil_settings->era_thickness_f / 100.0f; if (pt0) { pt0->strength -= gp_stroke_eraser_calc_influence(p, mval, radius, pc0) * strength * f_strength * 0.5f; diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 00209accee7..7eacf6845ea 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1163,18 +1163,20 @@ static void rna_def_gpencil_options(BlenderRNA *brna) RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "eraser_strength_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "era_strength_f"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Strength Factor", + RNA_def_property_range(prop, 0.0, 100.0); + RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1); + RNA_def_property_ui_text(prop, "Affect Stroke Strength", "Amount of erasing for strength "); RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "eraser_thickness_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "era_thickness_f"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Thickness Factor", + RNA_def_property_range(prop, 0.0, 100.0); + RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1); + RNA_def_property_ui_text(prop, "Affect Stroke Thickness", "Amount of erasing for thickness "); RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); |