GPencil: Clarify Target weight tooltip and remove lower limit

The target value was affecting the lower value and this was weird. Now the value is clamped between 0 and target weight.
This commit is contained in:
Antonio Vazquez 2019-06-04 17:42:39 +02:00
parent 8b1ca3ec53
commit 636751bb36
2 changed files with 5 additions and 8 deletions

@ -922,14 +922,8 @@ static bool gp_brush_weight_apply(
float curweight = dw ? dw->weight : 0.0f; float curweight = dw ? dw->weight : 0.0f;
if (gp_brush_invert_check(gso)) { if (gp_brush_invert_check(gso)) {
/* reduce weight (verify mainimum target) */
if (curweight - inf < gso->gp_brush->weight) {
curweight = gso->gp_brush->weight;
}
else {
curweight -= inf; curweight -= inf;
} }
}
else { else {
/* increase weight */ /* increase weight */
curweight += inf; curweight += inf;

@ -1548,7 +1548,10 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Weight", "Target weight"); RNA_def_property_ui_text(prop,
"Weight",
"Target weight (define a maximum range limit for the weight. Any value "
"above will be clamped)");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);