diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2016-03-27 13:24:14 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-03-27 17:21:28 +0300 |
commit | bfbbc8ec4001243ad5e9954665ddf9621329319f (patch) | |
tree | 95ec19c1cb7714e8d978a517676f4680cf1f8d88 /source/blender/makesrna/intern/rna_gpencil.c | |
parent | 71107208ddb2d70cc69d65f03088a8fa348ab030 (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.c | 16 |
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); |