[Bf-blender-cvs] [079bd115563] master: Fix T91143: Gpencil Set Vertex Color not using Linear

Antonio Vazquez noreply at git.blender.org
Sat Sep 4 18:28:59 CEST 2021


Commit: 079bd115563640b81cccba645d15b6b55efd3b8e
Author: Antonio Vazquez
Date:   Sat Sep 4 18:28:31 2021 +0200
Branches: master
https://developer.blender.org/rB079bd115563640b81cccba645d15b6b55efd3b8e

Fix T91143: Gpencil Set Vertex Color not using Linear

The color was not converted to Linear from Brush color.

===================================================================

M	source/blender/editors/gpencil/gpencil_vertex_ops.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_vertex_ops.c b/source/blender/editors/gpencil/gpencil_vertex_ops.c
index 402bccce2f7..5c3a7cf9e6f 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_ops.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_ops.c
@@ -588,6 +588,7 @@ static int gpencil_vertexpaint_set_exec(bContext *C, wmOperator *op)
               changed = true;
               copy_v3_v3(gps->vert_color_fill, brush->rgb);
               gps->vert_color_fill[3] = factor;
+              srgb_to_linearrgb_v4(gps->vert_color_fill, gps->vert_color_fill);
             }
 
             /* Stroke points. */
@@ -596,10 +597,13 @@ static int gpencil_vertexpaint_set_exec(bContext *C, wmOperator *op)
               int i;
               bGPDspoint *pt;
 
+              float color[4];
+              copy_v3_v3(color, brush->rgb);
+              color[3] = factor;
+              srgb_to_linearrgb_v4(color, color);
               for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
                 if ((!any_selected) || (pt->flag & GP_SPOINT_SELECT)) {
-                  copy_v3_v3(pt->vert_color, brush->rgb);
-                  pt->vert_color[3] = factor;
+                  copy_v3_v3(pt->vert_color, color);
                 }
               }
             }



More information about the Bf-blender-cvs mailing list