diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_nla.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index da824fd2093..078c1ba52bb 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -46,7 +46,7 @@ struct NlaStrip *copy_nlastrip(struct NlaStrip *strip); struct NlaTrack *copy_nlatrack(struct NlaTrack *nlt); void copy_nladata(ListBase *dst, ListBase *src); -struct NlaTrack *add_nlatrack(struct AnimData *adt); +struct NlaTrack *add_nlatrack(struct AnimData *adt, struct NlaTrack *prev); struct NlaStrip *add_nlastrip(struct bAction *act); struct NlaStrip *add_nlastrip_to_stack(struct AnimData *adt, struct bAction *act); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 9acbad32a42..cef14128032 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -215,8 +215,10 @@ void copy_nladata (ListBase *dst, ListBase *src) /* Adding ------------------------------------------- */ -/* Add a NLA Track to the given AnimData */ -NlaTrack *add_nlatrack (AnimData *adt) +/* Add a NLA Track to the given AnimData + * - prev: NLA-Track to add the new one after + */ +NlaTrack *add_nlatrack (AnimData *adt, NlaTrack *prev) { NlaTrack *nlt; @@ -232,7 +234,10 @@ NlaTrack *add_nlatrack (AnimData *adt) nlt->index= BLI_countlist(&adt->nla_tracks); /* add track to stack, and make it the active one */ - BLI_addtail(&adt->nla_tracks, nlt); + if (prev) + BLI_insertlinkafter(&adt->nla_tracks, prev, nlt); + else + BLI_addtail(&adt->nla_tracks, nlt); BKE_nlatrack_set_active(&adt->nla_tracks, nlt); /* must have unique name, but we need to seed this */ @@ -308,7 +313,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) (BKE_nlatrack_has_space(adt->nla_tracks.last, strip->start, strip->end)==0) ) { /* no space, so add to a new track... */ - nlt= add_nlatrack(adt); + nlt= add_nlatrack(adt, NULL); } else { |