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-04-15 11:32:06 +0300
committerAntonioya <blendergit@gmail.com>2019-04-15 11:32:25 +0300
commit240940c58ca3ce65e4bbceebea71dd9d1c2c08bc (patch)
tree97a9c60a7c2e059cef2541667ade5e00c70c21f5 /source/blender/makesrna
parent7c79455297d818a94aab2a9be5807b4d9ca43827 (diff)
GPencil: New Dots gradient
This commit adds support for drawing Dots strokes with a gradient factor to get artistic effects like watercolor. Currently, the option is only supported by Dots materials, and in the future will be added to line strokes, but now there is a limitation on drawing engine and we will keep disabled on Line materials. Also, added the option to align Dots and Boxes strokes textures aligned with the drawing path to get more fluid strokes.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c19
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c18
-rw-r--r--source/blender/makesrna/intern/rna_material.c7
3 files changed, 44 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index ce5b18331c6..23ae314f885 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1197,6 +1197,25 @@ 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);
+ /* gradient control */
+ prop = RNA_def_property(srna, "gradient_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "gradient_f");
+ RNA_def_property_range(prop, 0.001f, 1.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(
+ prop, "Border Opacity Factor",
+ "Amount of gradient for Dot strokes (set to 1 for full solid)");
+ RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
+
+ /* gradient shape ratio */
+ prop = RNA_def_property(srna, "gradient_shape", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "gradient_s");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_range(prop, 0.01f, 1.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Aspect Ratio", "");
+ RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
+
prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "input_samples");
RNA_def_property_range(prop, 0, GP_MAX_INPUT_SAMPLES);
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 73203beb3e2..d154f8de4ad 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -998,6 +998,24 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Thickness", "Thickness of stroke (in pixels)");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ /* gradient control along y */
+ prop = RNA_def_property(srna, "gradient_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "gradient_f");
+ RNA_def_property_range(prop, 0.001f, 1.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Opacity Factor",
+ "Amount of gradient along section of stroke");
+ RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
+ /* gradient shape ratio */
+ prop = RNA_def_property(srna, "gradient_shape", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "gradient_s");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_range(prop, 0.01f, 1.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Aspect Ratio", "");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
}
static void rna_def_gpencil_strokes_api(BlenderRNA *brna, PropertyRNA *cprop)
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 8e5f486fea1..a57f47a8090 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -585,6 +585,13 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Fill", "Show stroke fills of this material");
RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
+ /* keep Dots and Boxes aligned to screen and not to drawing path */
+ prop = RNA_def_property(srna, "use_follow_path", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_STYLE_COLOR_LOCK_DOTS);
+ RNA_def_property_ui_text(prop, "Follow Path",
+ "Keep Dots and Boxes aligned to drawing path");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_nopreview_update");
+
/* pass index for future compositing and editing tools */
prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "index");