[Bf-blender-cvs] [195c779] master: Fix: Some settings (e.g. "volumetric strokes") from old files were not getting correctly ported to GPv2

Joshua Leung noreply at git.blender.org
Mon Aug 29 07:12:50 CEST 2016


Commit: 195c7797e68ec99d8a4a6c396a74264d7d836189
Author: Joshua Leung
Date:   Mon Aug 29 17:00:18 2016 +1200
Branches: master
https://developer.blender.org/rB195c7797e68ec99d8a4a6c396a74264d7d836189

Fix: Some settings (e.g. "volumetric strokes") from old files were not getting correctly ported to GPv2

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

M	source/blender/blenloader/intern/versioning_270.c

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

diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 49ef8ba..0a36e78 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1306,12 +1306,20 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 							/* set color attributes */
 							copy_v4_v4(palcolor->color, gpl->color);
 							copy_v4_v4(palcolor->fill, gpl->fill);
-							palcolor->flag = gpl->flag;
+							
+							if (gpl->flag & GP_LAYER_HIDE)       palcolor->flag |= PC_COLOR_HIDE;
+							if (gpl->flag & GP_LAYER_LOCKED)     palcolor->flag |= PC_COLOR_LOCKED;
+							if (gpl->flag & GP_LAYER_ONIONSKIN)  palcolor->flag |= PC_COLOR_ONIONSKIN;
+							if (gpl->flag & GP_LAYER_VOLUMETRIC) palcolor->flag |= PC_COLOR_VOLUMETRIC;
+							if (gpl->flag & GP_LAYER_HQ_FILL)    palcolor->flag |= PC_COLOR_HQ_FILL;
+							
 							/* set layer opacity to 1 */
 							gpl->opacity = 1.0f;
+							
 							/* set tint color */
 							ARRAY_SET_ITEMS(gpl->tintcolor, 0.0f, 0.0f, 0.0f, 0.0f);
-
+							
+							/* flush relevant layer-settings to strokes */
 							for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
 								for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
 									/* set stroke to palette and force recalculation */
@@ -1319,14 +1327,15 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 									gps->palcolor = NULL;
 									gps->flag |= GP_STROKE_RECALC_COLOR;
 									gps->thickness = gpl->thickness;
+									
 									/* set alpha strength to 1 */
 									for (int i = 0; i < gps->totpoints; i++) {
 										gps->points[i].strength = 1.0f;
 									}
-
 								}
 							}
 						}
+						
 						/* set thickness to 0 (now it is a factor to override stroke thickness) */
 						gpl->thickness = 0.0f;
 					}




More information about the Bf-blender-cvs mailing list