[Bf-blender-cvs] [96af590d58e] master: GPencil: Change HSV modifier to use the same range of parameter that other areas of Blender
Antonioya
noreply at git.blender.org
Wed Jun 26 20:58:37 CEST 2019
Commit: 96af590d58ecbcadd03027084ebe067260b17fe0
Author: Antonioya
Date: Wed Jun 26 20:58:18 2019 +0200
Branches: master
https://developer.blender.org/rB96af590d58ecbcadd03027084ebe067260b17fe0
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.
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
M source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
M source/blender/makesrna/intern/rna_gpencil_modifier.c
===================================================================
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");
More information about the Bf-blender-cvs
mailing list