Commit: b19021ecfa64e5a44c81a786bead1836510232ec
Author: Joshua Leung
Date:   Wed Nov 1 00:13:12 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rBb19021ecfa64e5a44c81a786bead1836510232ec

Temporary (?) fix so that Hero project files get version patched correctly

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

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

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

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 84704e84673..a342b4954c5 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -440,34 +440,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *main)
                                BKE_gpencil_batch_cache_dirty(ob->data);
                        }
                }
-               
-               /* Handle object-linked grease pencil datablocks */
-               for (Object *ob = main->object.first; ob; ob = ob->id.next) {
-                       if (ob->gpd) {
-                               if (ob->type == OB_GPENCIL) {
-                                       /* GP Object - remap the links */
-                                       ob->data = ob->gpd;
-                                       ob->gpd = NULL;
-                               }
-                               else if (ob->type == OB_EMPTY) {
-                                       /* Empty with GP data - This should be 
able to be converted
-                                        * to a GP object with little data loss
-                                        */
-                                       ob->data = ob->gpd;
-                                       ob->gpd = NULL;
-                                       ob->type = OB_GPENCIL;
-                               }
-                               else {
-                                       /* FIXME: What to do in this case?
-                                        *
-                                        * We cannot create new objects for 
these, as we don't have a scene & scene layer
-                                        * to put them into from here...
-                                        */
-                                       printf("WARNING: Old Grease Pencil data 
('%s') still exists on Object '%s'\n",
-                                              ob->gpd->id.name+2, 
ob->id.name+2);
-                               }
-                       }
-               }
 
                /* Convert grease pencil palettes to blender palettes */
                if (!DNA_struct_elem_find(fd->filesdna, "bGPDstroke", 
"Palette", "*palette")) {
@@ -580,6 +552,37 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *main)
                        }
                }
        }
+       
+       /* XXX: Merge back into previous case... leaving like this so the Hero 
animatic/production files so far don't break */
+       if (!MAIN_VERSION_ATLEAST(main, 280, 3)) {
+               /* Handle object-linked grease pencil datablocks */
+               for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+                       if (ob->gpd) {
+                               if (ob->type == OB_GPENCIL) {
+                                       /* GP Object - remap the links */
+                                       ob->data = ob->gpd;
+                                       ob->gpd = NULL;
+                               }
+                               else if (ob->type == OB_EMPTY) {
+                                       /* Empty with GP data - This should be 
able to be converted
+                                        * to a GP object with little data loss
+                                        */
+                                       ob->data = ob->gpd;
+                                       ob->gpd = NULL;
+                                       ob->type = OB_GPENCIL;
+                               }
+                               else {
+                                       /* FIXME: What to do in this case?
+                                        *
+                                        * We cannot create new objects for 
these, as we don't have a scene & scene layer
+                                        * to put them into from here...
+                                        */
+                                       printf("WARNING: Old Grease Pencil data 
('%s') still exists on Object '%s'\n",
+                                              ob->gpd->id.name+2, 
ob->id.name+2);
+                               }
+                       }
+               }
+       }
 
        {
                if (!DNA_struct_elem_find(fd->filesdna, "View3D", "short", 
"custom_orientation_index")) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to