Revision: 17448
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17448
Author:   aligorith
Date:     2008-11-14 03:13:10 +0100 (Fri, 14 Nov 2008)

Log Message:
-----------
Bugfix: 

Grease Pencil crashed after duplicating a screen-area, and deleting a layer 
from the original screen-area. The duplication code was not reassigning some 
pointers.

Modified Paths:
--------------
    trunk/blender/source/blender/src/gpencil.c

Modified: trunk/blender/source/blender/src/gpencil.c
===================================================================
--- trunk/blender/source/blender/src/gpencil.c  2008-11-13 23:12:38 UTC (rev 
17447)
+++ trunk/blender/source/blender/src/gpencil.c  2008-11-14 02:13:10 UTC (rev 
17448)
@@ -267,6 +267,7 @@
                
        /* make a copy of the source frame */
        dst= MEM_dupallocN(src);
+       dst->prev= dst->next= NULL;
        
        /* copy strokes */
        dst->strokes.first = dst->strokes.last= NULL;
@@ -294,13 +295,18 @@
                
        /* make a copy of source layer */
        dst= MEM_dupallocN(src);
+       dst->prev= dst->next= NULL;
        
        /* copy frames */
        dst->frames.first= dst->frames.last= NULL;
        for (gpf= src->frames.first; gpf; gpf= gpf->next) {
-               /* make a copy of source stroke */
+               /* make a copy of source frame */
                gpfd= gpencil_frame_duplicate(gpf);
                BLI_addtail(&dst->frames, gpfd);
+               
+               /* if source frame was the current layer's 'active' frame, 
reassign that too */
+               if (gpf == dst->actframe)
+                       dst->actframe= gpfd;
        }
        
        /* return new layer */


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

Reply via email to