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

This commit is contained in:
Campbell Barton
2010-08-12 16:39:23 +00:00
parent dc3ddd518b
commit 9f01264610

View File

@@ -384,20 +384,22 @@ static int nlaedit_add_tracks_exec (bContext *C, wmOperator *op)
/* 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);
}
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;
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;
}
}
}
@@ -450,11 +452,13 @@ static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *op)
/* 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 */