Revision: 31294
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31294
Author:   campbellbarton
Date:     2010-08-12 18:39:23 +0200 (Thu, 12 Aug 2010)

Log Message:
-----------
bugfix: deleting NLA tracks with a keyframed text3d obdata would free the 
curve, missing type checks.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_nla/nla_channels.c

Modified: trunk/blender/source/blender/editors/space_nla/nla_channels.c
===================================================================
--- trunk/blender/source/blender/editors/space_nla/nla_channels.c       
2010-08-12 16:15:50 UTC (rev 31293)
+++ trunk/blender/source/blender/editors/space_nla/nla_channels.c       
2010-08-12 16:39:23 UTC (rev 31294)
@@ -384,21 +384,23 @@
        
        /* add tracks... */
        for (ale= anim_data.first; ale; ale= ale->next) {
-               NlaTrack *nlt= (NlaTrack *)ale->data;
-               AnimData *adt= ale->adt;
-               
-               /* check if just adding a new track above this one,
-                * or whether we're adding a new one to the top of the stack 
that this one belongs to
-                */
-               if (above_sel) {
-                       /* just add a new one above this one */
-                       add_nlatrack(adt, nlt);
+               if(ale->type == ANIMTYPE_NLATRACK) {
+                       NlaTrack *nlt= (NlaTrack *)ale->data;
+                       AnimData *adt= ale->adt;
+                       
+                       /* check if just adding a new track above this one,
+                        * or whether we're adding a new one to the top of the 
stack that this one belongs to
+                        */
+                       if (above_sel) {
+                               /* just add a new one above this one */
+                               add_nlatrack(adt, nlt);
+                       }
+                       else if ((lastAdt == NULL) || (adt != lastAdt)) {
+                               /* add one track to the top of the owning 
AnimData's stack, then don't add anymore to this stack */
+                               add_nlatrack(adt, NULL);
+                               lastAdt= adt;
+                       }
                }
-               else if ((lastAdt == NULL) || (adt != lastAdt)) {
-                       /* add one track to the top of the owning AnimData's 
stack, then don't add anymore to this stack */
-                       add_nlatrack(adt, NULL);
-                       lastAdt= adt;
-               }
        }
        
        /* free temp data */
@@ -450,11 +452,13 @@
        
        /* delete tracks */
        for (ale= anim_data.first; ale; ale= ale->next) {
-               NlaTrack *nlt= (NlaTrack *)ale->data;
-               AnimData *adt= ale->adt;
-               
-               /* call delete on this track - deletes all strips too */
-               free_nlatrack(&adt->nla_tracks, nlt);
+               if(ale->type == ANIMTYPE_NLATRACK) {
+                       NlaTrack *nlt= (NlaTrack *)ale->data;
+                       AnimData *adt= ale->adt;
+                       
+                       /* call delete on this track - deletes all strips too */
+                       free_nlatrack(&adt->nla_tracks, nlt);
+               }
        }
        
        /* free temp data */


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

Reply via email to