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-06-26 21:58:18 +0300
committerAntonioya <blendergit@gmail.com>2019-06-26 21:58:30 +0300
commit96af590d58ecbcadd03027084ebe067260b17fe0 (patch)
tree7a2df4d0fdb6699d1bd27d0550509b0fd3f42de0
parent69b3c26e75f00c2b3b4baf78b56733cd8662e8ef (diff)
GPencil: Change HSV modifier to use the same range of parameter that other areas of Blender
The value of the Hue must be between 0 and 1, but the value was between 0 and 2.
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py6
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c7
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c4
3 files changed, 10 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 754cac25f3e..0a4c166d0f7 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1919,9 +1919,9 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
col.label(text="Color:")
- col.prop(md, "hue", text="H")
- col.prop(md, "saturation", text="S")
- col.prop(md, "value", text="V")
+ col.prop(md, "hue", text="H", slider=True)
+ col.prop(md, "saturation", text="S", slider=True)
+ col.prop(md, "value", text="V", slider=True)
row = layout.row()
row.prop(md, "create_materials")
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
index c1a49183a66..f257a718ca2 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
@@ -49,7 +49,7 @@ static void initData(GpencilModifierData *md)
{
ColorGpencilModifierData *gpmd = (ColorGpencilModifierData *)md;
gpmd->pass_index = 0;
- ARRAY_SET_ITEMS(gpmd->hsv, 1.0f, 1.0f, 1.0f);
+ ARRAY_SET_ITEMS(gpmd->hsv, 0.5f, 1.0f, 1.0f);
gpmd->layername[0] = '\0';
gpmd->flag |= GP_COLOR_CREATE_COLORS;
gpmd->modify_color = GP_MODIFY_COLOR_BOTH;
@@ -85,7 +85,10 @@ static void deformStroke(GpencilModifierData *md,
}
copy_v3_v3(factor, mmd->hsv);
- add_v3_fl(factor, -1.0f);
+ /* keep Hue equals. */
+ factor[0] -= 0.5f;
+ factor[1] -= 1.0f;
+ factor[2] -= 1.0f;
if (mmd->modify_color != GP_MODIFY_COLOR_FILL) {
rgb_to_hsv_v(gps->runtime.tmp_stroke_rgba, hsv);
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 1e35db8a64f..2dabaeebb09 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -988,8 +988,8 @@ static void rna_def_modifier_gpencilcolor(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "hue", PROP_FLOAT, PROP_NONE);
- RNA_def_property_range(prop, 0.0, 2.0);
- RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 3);
RNA_def_property_float_sdna(prop, NULL, "hsv[0]");
RNA_def_property_ui_text(prop, "Hue", "Color Hue");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");