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:
authorAntonio Vazquez <blendergit@gmail.com>2016-03-27 13:24:14 +0300
committerJoshua Leung <aligorith@gmail.com>2016-03-27 17:21:28 +0300
commitbfbbc8ec4001243ad5e9954665ddf9621329319f (patch)
tree95ec19c1cb7714e8d978a517676f4680cf1f8d88 /source/blender/makesrna/intern/rna_gpencil.c
parent71107208ddb2d70cc69d65f03088a8fa348ab030 (diff)
Improve grease pencil stroke quality
Improve the quality of current grease pencil strokes adding a new dynamic smooth and subdivision. The level of smooth and subdivide can be adjusted using UI parameters. These options are disabled by default in order to keep the grease pencil stroke compatible with any existing add-on. Both parameters are defined at layer level. Reviewers: aligorith Differential Revision: https://developer.blender.org/D1866
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil.c')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 291456a591b..7d5e7c1b49a 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -796,7 +796,21 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-
+
+ /* dynamic smooth factor */
+ prop = RNA_def_property(srna, "smooth_drawfac", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "smooth_drawfac");
+ RNA_def_property_range(prop, 0.0, 2.0f);
+ RNA_def_property_ui_text(prop, "Smooth", "Amount of smoothing to apply to newly created strokes, to reduce jitter/noise");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
+ /* Subdivision level */
+ prop = RNA_def_property(srna, "subdivision", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "sublevel");
+ RNA_def_property_range(prop, 0, 3);
+ RNA_def_property_ui_text(prop, "Subdivide", "Number of times to subdivide newly created strokes, for less jagged strokes");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
/* Flags */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);