diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-12 20:39:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-12 20:39:23 +0400 |
commit | 9f01264610f74723e527fdb623d112af9d0dd477 (patch) | |
tree | 17943238ec719ca3d4891767dd6cf81b4d5a09fd /source/blender/editors | |
parent | dc3ddd518b5df94e89d03523654ae6acc5cb5739 (diff) |
bugfix: deleting NLA tracks with a keyframed text3d obdata would free the curve, missing type checks.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_nla/nla_channels.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 3e0ec5afac2..d834fb07ee7 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -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 */ |