From 179e886ab3d6f8b762ff66c5bb2cb203a4adcb62 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Thu, 8 Aug 2019 16:12:13 +0200 Subject: GPencil: New Simplify modifier mode Sample and operator This mode simplify the stroke doing a resampling of the points and generate new geometry at the distance defined. Sample function developed by @NicksBest New Resample Stroke operator This operator recreates the stroke geometry with a predefined length between points. The operator uses the same code used in Simplify modifier. Reviewers: @mendio --- source/blender/makesrna/intern/rna_gpencil_modifier.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/makesrna/intern/rna_gpencil_modifier.c') diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 754c443e7e6..ed23e603bec 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -617,6 +617,11 @@ static void rna_def_modifier_gpencilsimplify(BlenderRNA *brna) ICON_IPO_EASE_IN_OUT, "Adaptive", "Use a RDP algorithm to simplify"}, + {GP_SIMPLIFY_SAMPLE, + "SAMPLE", + ICON_IPO_EASE_IN_OUT, + "Sample", + "Sample a curve using a fixed length"}, {0, NULL, 0, NULL, NULL}, }; @@ -675,6 +680,13 @@ static void rna_def_modifier_gpencilsimplify(BlenderRNA *brna) RNA_def_property_range(prop, 1, 50); RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply simplify"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + + /* Sample */ + prop = RNA_def_property(srna, "length", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "length"); + RNA_def_property_range(prop, 0, 10); + RNA_def_property_ui_text(prop, "Length", "Length of each segment"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); } static void rna_def_modifier_gpencilthick(BlenderRNA *brna) -- cgit v1.2.3