Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-08-08 17:12:13 +0300
committerAntonioya <blendergit@gmail.com>2019-08-08 17:43:54 +0300
commit179e886ab3d6f8b762ff66c5bb2cb203a4adcb62 (patch)
tree3586e7f51fe1b28156604f4f6b20ee86c81f95e6 /source/blender/makesrna/intern/rna_gpencil_modifier.c
parent5ca3bc7a145f8ac1740cbf46e4701fee3a245b14 (diff)
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c12
1 files changed, 12 insertions, 0 deletions
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)