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:
authorAntonio Vazquez <blendergit@gmail.com>2020-08-10 14:51:02 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-08-10 16:33:09 +0300
commit3a3dc45e7b9b14a7d6a817763b26d72e593dd95a (patch)
tree70a256f7e8176b90b0840c50d2b35a442497cb0c /source/blender
parentcfba3cb121414ce5302b7991cc44717949072478 (diff)
GPencil: Remove color conversion when convert curve
In previous versions, grease pencil used sRGB and a color conversion was needed, but now all is Linear and the conversion changes the color wrongly.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/gpencil_curve.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index e64369d74cb..d02eeae0edb 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -54,7 +54,8 @@ static int gpencil_check_same_material_color(Object *ob_gp, const float color[4]
{
Material *ma = NULL;
float color_cu[4];
- linearrgb_to_srgb_v3_v3(color_cu, color);
+ copy_v4_v4(color_cu, color);
+
float hsv1[4];
rgb_to_hsv_v(color_cu, hsv1);
hsv1[3] = color[3];
@@ -95,12 +96,12 @@ static Material *gpencil_add_from_curve_material(Main *bmain,
gp_style->flag |= GP_MATERIAL_STROKE_SHOW;
}
else {
- linearrgb_to_srgb_v4(gp_style->stroke_rgba, cu_color);
+ copy_v4_v4(mat_gp->gp_style->stroke_rgba, cu_color);
gp_style->flag &= ~GP_MATERIAL_STROKE_SHOW;
}
/* Fill color. */
- linearrgb_to_srgb_v4(gp_style->fill_rgba, cu_color);
+ copy_v4_v4(mat_gp->gp_style->fill_rgba, cu_color);
/* Fill is false if the original curve hasn't material assigned, so enable it. */
if (fill) {
gp_style->flag |= GP_MATERIAL_FILL_SHOW;
@@ -249,8 +250,7 @@ static void gpencil_convert_spline(Main *bmain,
if ((!only_stroke) && (ob_cu->totcol > 1) && (BKE_object_material_get(ob_cu, 2))) {
mat_curve = BKE_object_material_get(ob_cu, 2);
if (mat_curve) {
- linearrgb_to_srgb_v3_v3(mat_gp->gp_style->stroke_rgba, &mat_curve->r);
- mat_gp->gp_style->stroke_rgba[3] = mat_curve->a;
+ copy_v4_v4(mat_gp->gp_style->stroke_rgba, &mat_curve->r);
}
}
else if ((only_stroke) || (do_stroke)) {