GPencil: New Brush postprocesing Simplify
This option allows to apply a simplify when the stroke is completed. The simplify use the Adaptive option to keep the shape.
This commit is contained in:
@@ -1235,6 +1235,13 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
|
||||
reduce += 0.25f; /* reduce the factor */
|
||||
}
|
||||
}
|
||||
|
||||
/* Simplify adaptive */
|
||||
if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) &&
|
||||
(brush->gpencil_settings->simplify_f > 0.0f)) {
|
||||
BKE_gpencil_simplify_stroke(gps, brush->gpencil_settings->simplify_f);
|
||||
}
|
||||
|
||||
/* smooth thickness */
|
||||
if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) &&
|
||||
(brush->gpencil_settings->thick_smoothfac > 0.0f)) {
|
||||
|
||||
@@ -113,7 +113,8 @@ typedef struct BrushGpencilSettings {
|
||||
float gradient_f;
|
||||
/** factor xy of shape for dots gradients */
|
||||
float gradient_s[2];
|
||||
char _pad_2[4];
|
||||
/** Simplify adaptive factor */
|
||||
float simplify_f;
|
||||
|
||||
struct CurveMapping *curve_sensitivity;
|
||||
struct CurveMapping *curve_strength;
|
||||
|
||||
@@ -1189,6 +1189,14 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
|
||||
|
||||
/* Simplify factor */
|
||||
prop = RNA_def_property(srna, "simplify_factor", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "simplify_f");
|
||||
RNA_def_property_range(prop, 0, 100.0);
|
||||
RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3);
|
||||
RNA_def_property_ui_text(prop, "Simplify", "Factor of Simplify using adaptive algorithm");
|
||||
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
||||
|
||||
/* Curves for pressure */
|
||||
prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "curve_sensitivity");
|
||||
|
||||
Reference in New Issue
Block a user