[Bf-blender-cvs] [2311c2b4fb6] temp-gpencil-masking: Fix error in versioning code

Antonio Vazquez noreply at git.blender.org
Tue Apr 20 18:43:13 CEST 2021


Commit: 2311c2b4fb66837871e04e5f9ad16d46b355aa69
Author: Antonio Vazquez
Date:   Tue Apr 20 18:42:38 2021 +0200
Branches: temp-gpencil-masking
https://developer.blender.org/rB2311c2b4fb66837871e04e5f9ad16d46b355aa69

Fix error in versioning code

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

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

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

diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 64a21ef1b6c..95cbb1afa5d 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -27,8 +27,25 @@
 #include "BLO_readfile.h"
 #include "readfile.h"
 
-void do_versions_after_linking_300(Main *UNUSED(bmain), ReportList *UNUSED(reports))
+void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports))
 {
+  if (!MAIN_VERSION_ATLEAST(bmain, 300, 0)) {
+    /* Grease Pencil Masking Intersect. */
+    Scene *scene = bmain->scenes.first;
+    if (scene != NULL) {
+      LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+        if (ob->type != OB_GPENCIL) {
+          continue;
+        }
+        bGPdata *gpd = ob->data;
+        LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
+          LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) {
+            mask->flag |= GP_MASK_INTERSECT;
+          }
+        }
+      }
+    }
+  }
 
   /**
    * Versioning code until next subversion bump goes here.
@@ -46,27 +63,9 @@ void do_versions_after_linking_300(Main *UNUSED(bmain), ReportList *UNUSED(repor
 }
 
 /* NOLINTNEXTLINE: readability-function-size */
-void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
+void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *UNUSED(bmain))
 {
   UNUSED_VARS(fd);
-  if (!MAIN_VERSION_ATLEAST(bmain, 300, 0)) {
-    /* Grease Pencil Masking Intersect. */
-    Scene *scene = bmain->scenes.first;
-    if (scene != NULL) {
-      LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
-        if (ob->type != OB_GPENCIL) {
-          continue;
-        }
-        bGPdata *gpd = ob->data;
-        LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
-          LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) {
-            mask->flag |= GP_MASK_INTERSECT;
-          }
-        }
-      }
-    }
-  }
-
   /**
    * Versioning code until next subversion bump goes here.
    *



More information about the Bf-blender-cvs mailing list