diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-06 07:44:44 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-06 07:44:44 +0400 |
commit | f87fcde686c85820c510c5c7806f6b6b8466ba5c (patch) | |
tree | bbc501d6360aef994164f938d7cc1c32db04571f /source/blender/blenloader/intern/writefile.c | |
parent | b8042f535c43c371d6bdb2fe44d0560d5802083c (diff) |
NLA SoC: Start of 'Meta' Strips
Refactored the backend code/API's to support 'meta' strips (i.e. strips containing other strips). These have been implemented to be nested to 'unlimited' depths (in terms of common usages that is, though there is a very remote chance of stack-overflow in theoretrical evil cases only that shouldn't ever be encountered in production).
This paves the way for implementing the necessary tweaks needed for the transform code (in addition to some cool user-level tricks)
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 80d1d78257b..bfdd89e38b1 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -916,26 +916,34 @@ static void write_keyingsets(WriteData *wd, ListBase *list) } } +static void write_nlastrips(WriteData *wd, ListBase *strips) +{ + NlaStrip *strip; + + for (strip= strips->first; strip; strip= strip->next) { + /* write the strip first */ + writestruct(wd, DATA, "NlaStrip", 1, strip); + + /* write the strip's F-Curves and modifiers */ + write_fcurves(wd, &strip->fcurves); + write_fmodifiers(wd, &strip->modifiers); + + /* write the strip's children */ + write_nlastrips(wd, &strip->strips); + } +} + static void write_nladata(WriteData *wd, ListBase *nlabase) { NlaTrack *nlt; - NlaStrip *strip; /* write all the tracks */ for (nlt= nlabase->first; nlt; nlt= nlt->next) { /* write the track first */ writestruct(wd, DATA, "NlaTrack", 1, nlt); - for (strip= nlt->strips.first; strip; strip= strip->next) { - /* write the strip first */ - writestruct(wd, DATA, "NlaStrip", 1, strip); - - /* write the strip's F-Curves and modifiers */ - write_fcurves(wd, &strip->fcurves); - write_fmodifiers(wd, &strip->modifiers); - - // TODO write the remaps - } + /* write the track's strips */ + write_nlastrips(wd, &nlt->strips); } } |