forked from bartvdbraak/blender
GP: Improve errase panel and toolbars
Some names were not clear enough and some parameters were missing.
This commit is contained in:
parent
54f1375e29
commit
6b024c7e1a
@ -1239,8 +1239,13 @@ class _defs_gpencil_paint:
|
|||||||
gp_settings = brush.gpencil_settings
|
gp_settings = brush.gpencil_settings
|
||||||
|
|
||||||
if gp_settings.gpencil_brush_type == 'ERASE':
|
if gp_settings.gpencil_brush_type == 'ERASE':
|
||||||
row = layout.row()
|
row = layout.row(align=True)
|
||||||
row.prop(brush, "size", text="Radius")
|
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':
|
elif gp_settings.gpencil_brush_type == 'FILL':
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(gp_settings, "gpencil_fill_leak", text="Leak Size")
|
row.prop(gp_settings, "gpencil_fill_leak", text="Leak Size")
|
||||||
|
@ -1948,8 +1948,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
if (brush->gpencil_settings != NULL) {
|
if (brush->gpencil_settings != NULL) {
|
||||||
BrushGpencilSettings *gp = brush->gpencil_settings;
|
BrushGpencilSettings *gp = brush->gpencil_settings;
|
||||||
if (gp->brush_type == GP_BRUSH_TYPE_ERASE) {
|
if (gp->brush_type == GP_BRUSH_TYPE_ERASE) {
|
||||||
gp->era_strength_f = 1.0f;
|
gp->era_strength_f = 100.0f;
|
||||||
gp->era_thickness_f = 0.1f;
|
gp->era_thickness_f = 10.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1532,8 +1532,8 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p,
|
|||||||
|
|
||||||
/* Adjust strength if the eraser is soft */
|
/* Adjust strength if the eraser is soft */
|
||||||
if (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_SOFT) {
|
if (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_SOFT) {
|
||||||
float f_strength = eraser->gpencil_settings->era_strength_f;
|
float f_strength = eraser->gpencil_settings->era_strength_f / 100.0f;
|
||||||
float f_thickness = eraser->gpencil_settings->era_thickness_f;
|
float f_thickness = eraser->gpencil_settings->era_thickness_f / 100.0f;
|
||||||
|
|
||||||
if (pt0) {
|
if (pt0) {
|
||||||
pt0->strength -= gp_stroke_eraser_calc_influence(p, mval, radius, pc0) * strength * f_strength * 0.5f;
|
pt0->strength -= gp_stroke_eraser_calc_influence(p, mval, radius, pc0) * strength * f_strength * 0.5f;
|
||||||
|
@ -1163,18 +1163,20 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
|
|||||||
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
||||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
|
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_float_sdna(prop, NULL, "era_strength_f");
|
||||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
RNA_def_property_range(prop, 0.0, 100.0);
|
||||||
RNA_def_property_ui_text(prop, "Strength Factor",
|
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 ");
|
"Amount of erasing for strength ");
|
||||||
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
||||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
|
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_float_sdna(prop, NULL, "era_thickness_f");
|
||||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
RNA_def_property_range(prop, 0.0, 100.0);
|
||||||
RNA_def_property_ui_text(prop, "Thickness Factor",
|
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 ");
|
"Amount of erasing for thickness ");
|
||||||
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
||||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
|
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user