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.
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user