Merging r48470 through r48489 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 2 Jul 2012 11:29:55 +0000 (11:29 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 2 Jul 2012 11:29:55 +0000 (11:29 +0000)
1  2 
source/blender/blenloader/intern/readfile.c

index 37e05623f2d9d0079f85fcc331fc539f50c65af6,836f723327eba2839b59584f5141b51c09be250e..60469a31a8c815ccedf4942973d9578ab8c8f20f
@@@ -5909,11 -5909,20 +5909,20 @@@ static void direct_link_screen(FileDat
                                }
                        }
                        else if (sl->spacetype == SPACE_SEQ) {
+                               /* grease pencil data is not a direct data and can't be linked from direct_link*
+                                * functions, it should be linked from lib_link* funcrions instead
+                                *
+                                * otherwise it'll lead to lost grease data on open because it'll likely be
+                                * read from file after all other users of grease pencil and newdataadr would
+                                * simple return NULL here (sergey)
+                                */
+ #if 0
                                SpaceSeq *sseq = (SpaceSeq *)sl;
                                if (sseq->gpd) {
                                        sseq->gpd = newdataadr(fd, sseq->gpd);
                                        direct_link_gpencil(fd, sseq->gpd);
                                }
+ #endif
                        }
                        else if (sl->spacetype == SPACE_BUTS) {
                                SpaceButs *sbuts = (SpaceButs *)sl;
@@@ -8007,7 -8016,7 +8016,7 @@@ BlendFileData *blo_read_file_internal(F
        fix_relpaths_library(fd->relabase, bfd->main); /* make all relative paths, relative to the open blend file */
        
        link_global(fd, bfd);   /* as last */
 -      
 +
        return bfd;
  }