diff options
author | Joshua Leung <aligorith@gmail.com> | 2013-03-08 14:59:43 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2013-03-08 14:59:43 +0400 |
commit | 181ac91d6de5d2829be3b61aa46d1b264147769c (patch) | |
tree | 5298425c0abc5951c4554507acae4e0d9a8cca1a /source/blender | |
parent | bee0af076f98b88dd79c401d0e589100e223d047 (diff) |
Applying similar optimisations as r.55092 for Animation Data
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 538f6368730..7772bc23097 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -470,6 +470,9 @@ static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers) { FModifier *fcm; + /* Write all modifiers first (for faster reloading) */ + writelist(wd, DATA, "FModifier", fmodifiers); + /* Modifiers */ for (fcm= fmodifiers->first; fcm; fcm= fcm->next) { FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); @@ -510,9 +513,6 @@ static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers) break; } } - - /* Write the modifier */ - writestruct(wd, DATA, "FModifier", 1, fcm); } } @@ -520,10 +520,8 @@ static void write_fcurves(WriteData *wd, ListBase *fcurves) { FCurve *fcu; + writelist(wd, DATA, "FCurve", fcurves); for (fcu=fcurves->first; fcu; fcu=fcu->next) { - /* F-Curve */ - writestruct(wd, DATA, "FCurve", 1, fcu); - /* curve data */ if (fcu->bezt) writestruct(wd, DATA, "BezTriple", fcu->totvert, fcu->bezt); @@ -541,9 +539,8 @@ static void write_fcurves(WriteData *wd, ListBase *fcurves) writestruct(wd, DATA, "ChannelDriver", 1, driver); /* variables */ - for (dvar= driver->variables.first; dvar; dvar= dvar->next) { - writestruct(wd, DATA, "DriverVar", 1, dvar); - + writelist(wd, DATA, "DriverVar", &driver->variables); + for (dvar= driver->variables.first; dvar; dvar= dvar->next) { DRIVER_TARGETS_USED_LOOPER(dvar) { if (dtar->rna_path) @@ -609,10 +606,8 @@ static void write_nlastrips(WriteData *wd, ListBase *strips) { NlaStrip *strip; + writelist(wd, DATA, "NlaStrip", strips); 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); |