Revision: 47717
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47717
Author:   aligorith
Date:     2012-06-11 03:03:36 +0000 (Mon, 11 Jun 2012)
Log Message:
-----------
Bugfix: Crash in Sequencer when trying to undo after using Grease Pencil

Grease Pencil data was not getting correctly relinked after file reload (for
undo)

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c   2012-06-11 
02:29:25 UTC (rev 47716)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2012-06-11 
03:03:36 UTC (rev 47717)
@@ -5288,6 +5288,14 @@
                                                 */
                                                sima->gpd = newlibadr_us(fd, 
sc->id.lib, sima->gpd);
                                        }
+                                       else if (sl->spacetype == SPACE_SEQ) {
+                                               SpaceSeq *sseq = (SpaceSeq *)sl;
+                                               
+                                               /* NOTE: pre-2.5, this was 
local data not lib data, but now we need this as lib data
+                                                * so fingers crossed this 
works fine!
+                                                */
+                                               sseq->gpd = newlibadr_us(fd, 
sc->id.lib, sseq->gpd);
+                                       }
                                        else if (sl->spacetype == SPACE_NLA) {
                                                SpaceNla *snla= (SpaceNla *)sl;
                                                bDopeSheet *ads= snla->ads;
@@ -5358,15 +5366,21 @@
                                        }
                                        else if (sl->spacetype == SPACE_CLIP) {
                                                SpaceClip *sclip = (SpaceClip 
*)sl;
-
+                                               
                                                sclip->clip = newlibadr_us(fd, 
sc->id.lib, sclip->clip);
                                                sclip->mask = newlibadr_us(fd, 
sc->id.lib, sclip->mask);
-
+                                               sclip->gpd = newlibadr_us(fd, 
sc->id.lib, sclip->gpd);
+                                               
                                                sclip->scopes.track_search = 
NULL;
                                                sclip->scopes.track_preview = 
NULL;
                                                sclip->draw_context = NULL;
                                                sclip->scopes.ok = 0;
                                        }
+                                       else if (sl->spacetype == SPACE_LOGIC) {
+                                               SpaceLogic *slog = (SpaceLogic 
*)sl;
+                                               
+                                               slog->gpd = newlibadr_us(fd, 
sc->id.lib, slog->gpd);
+                                       }
                                }
                        }
                        sc->id.flag -= LIB_NEEDLINK;
@@ -5559,6 +5573,14 @@
                                         */
                                        sima->gpd = 
restore_pointer_by_name(newmain, (ID *)sima->gpd, 1);
                                }
+                               else if (sl->spacetype == SPACE_SEQ) {
+                                       SpaceSeq *sseq = (SpaceSeq *)sl;
+                                       
+                                       /* NOTE: pre-2.5, this was local data 
not lib data, but now we need this as lib data
+                                        * so assume that here we're doing for 
undo only...
+                                        */
+                                       sseq->gpd = 
restore_pointer_by_name(newmain, (ID *)sseq->gpd, 1);
+                               }
                                else if (sl->spacetype == SPACE_NLA) {
                                        SpaceNla *snla = (SpaceNla *)sl;
                                        bDopeSheet *ads = snla->ads;
@@ -5628,7 +5650,14 @@
                                        sclip->mask = 
restore_pointer_by_name(newmain, (ID *)sclip->mask, 1);
                                        
                                        sclip->scopes.ok = 0;
+                                       
+                                       sclip->gpd = 
restore_pointer_by_name(newmain, (ID *)sclip->gpd, 1);
                                }
+                               else if (sl->spacetype == SPACE_LOGIC) {
+                                       SpaceLogic *slog = (SpaceLogic *)sl;
+                                       
+                                       slog->gpd = 
restore_pointer_by_name(newmain, (ID *)slog->gpd, 1);
+                               }
                        }
                }
        }

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

Reply via email to