[Bf-blender-cvs] [fd5d4cf] master: GPencil: Bump subversion and ensure that the datablock-level onionskinning flag is set correctly

Joshua Leung noreply at git.blender.org
Sun Dec 13 09:11:53 CET 2015


Commit: fd5d4cfeff289764c42a9faf85a38690ae38f18e
Author: Joshua Leung
Date:   Sun Dec 13 21:09:47 2015 +1300
Branches: master
https://developer.blender.org/rBfd5d4cfeff289764c42a9faf85a38690ae38f18e

GPencil: Bump subversion and ensure that the datablock-level onionskinning flag is set correctly

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

M	source/blender/blenkernel/BKE_blender.h
M	source/blender/blenloader/intern/versioning_270.c

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

diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 8734eac..6886740 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         276
-#define BLENDER_SUBVERSION      3
+#define BLENDER_SUBVERSION      4
 /* Several breakages with 270, e.g. constraint deg vs rad */
 #define BLENDER_MINVERSION      270
 #define BLENDER_MINSUBVERSION   5
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 8a2045d..8cf9332 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -936,9 +936,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 		}
 	}
 
-	{
-		Scene *scene;
-		for (scene = main->scene.first; scene; scene = scene->id.next) {
+	if (!MAIN_VERSION_ATLEAST(main, 276, 4)) {
+		for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
 			ToolSettings *ts = scene->toolsettings;
 			
 			if (ts->gp_sculpt.brush[0].size == 0) {
@@ -1012,5 +1011,23 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 				ts->gpencil_ima_align = GP_PROJECT_VIEWSPACE;
 			}
 		}
+		
+		for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
+			bool enabled = false;
+			
+			/* Ensure that the datablock's onionskinning toggle flag
+			 * stays in sync with the status of the actual layers
+			 */
+			for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+				if (gpl->flag & GP_LAYER_ONIONSKIN) {
+					enabled = true;
+				}
+			}
+			
+			if (enabled)
+				gpd->flag |= GP_DATA_SHOW_ONIONSKINS;
+			else
+				gpd->flag &= ~GP_DATA_SHOW_ONIONSKINS;
+		}
 	}
 }




More information about the Bf-blender-cvs mailing list