[Bf-blender-cvs] [20b1ca6cdf1] greasepencil-object: Fix problem when tint array strokes

Antonio Vazquez noreply at git.blender.org
Fri Jul 21 09:29:27 CEST 2017


Commit: 20b1ca6cdf10f30c45e92eefd2b0b8279389f406
Author: Antonio Vazquez
Date:   Wed Jul 19 16:57:40 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB20b1ca6cdf10f30c45e92eefd2b0b8279389f406

Fix problem when tint array strokes

The new strokes had different color because the tint was done two times

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

M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 630635592c8..861b3932ca7 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -29,6 +29,8 @@
 #include "BKE_global.h"
 #include "BKE_gpencil.h"
 #include "BKE_image.h"
+#include "BKE_paint.h"
+
 #include "ED_gpencil.h"
 #include "ED_view3d.h"
 
@@ -614,6 +616,10 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
 		if ((ob->modifiers.first) && (!is_edit)) {
 			PaletteColor *newpalcolor = MEM_dupallocN(gps->palcolor);
 			if (newpalcolor) {
+				/* need to recover original color to avoid tint again over tinted color */
+				PaletteColor *palcolor = BKE_palette_color_getbyname(gps->palette, gps->colorname);
+				copy_v4_v4(newpalcolor->rgb, palcolor->rgb);
+				copy_v4_v4(newpalcolor->fill, palcolor->fill);
 				gps->palcolor = newpalcolor;
 				BLI_addtail(&tmp_colors, gps->palcolor);
 			}




More information about the Bf-blender-cvs mailing list