From f4eb0f507f96eedae9f110aaaf46b5ef4ab40b6b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Dec 2011 17:24:34 +0000 Subject: `#if 0` use of Object.nlastrips, there is no way to add or remove these from blender so better not run. --- source/blender/blenloader/intern/readfile.c | 46 +++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c72bc17cc1c..b5baeab5d5f 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -109,7 +109,7 @@ #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_deform.h" -#include "BKE_effect.h" /* give_parteff */ +#include "BKE_effect.h" #include "BKE_fcurve.h" #include "BKE_global.h" // for G #include "BKE_group.h" @@ -7084,6 +7084,40 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen) } } +/* deprecated, only keep this for readfile.c */ +static PartEff *do_version_give_parteff_245(Object *ob) +{ + PartEff *paf; + + paf= ob->effect.first; + while(paf) { + if(paf->type==EFF_PARTICLE) return paf; + paf= paf->next; + } + return NULL; +} +static void do_version_free_effect_245(Effect *eff) +{ + PartEff *paf; + + if(eff->type==EFF_PARTICLE) { + paf= (PartEff *)eff; + if(paf->keys) MEM_freeN(paf->keys); + } + MEM_freeN(eff); +} +static void do_version_free_effects_245(ListBase *lb) +{ + Effect *eff; + + eff= lb->first; + while(eff) { + BLI_remlink(lb, eff); + do_version_free_effect_245(eff); + eff= lb->first; + } +} + static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) { MTex *mtex; @@ -7659,7 +7693,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob = main->object.first; PartEff *paf; while (ob) { - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf) { if (paf->staticstep == 0) { paf->staticstep= 5; @@ -8868,7 +8902,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf) { if(paf->disp == 0) paf->disp = 100; @@ -9876,7 +9910,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* convert old particles to new system */ - if((paf = give_parteff(ob))) { + if((paf = do_version_give_parteff_245(ob))) { ParticleSystem *psys; ModifierData *md; ParticleSystemModifierData *psmd; @@ -9989,7 +10023,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) part->type = PART_FLUID; } - free_effects(&ob->effect); + do_version_free_effects_245(&ob->effect); printf("Old particle system converted to new system.\n"); } @@ -13444,7 +13478,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) expand_doit(fd, mainvar, ob->mat[a]); } - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf && paf->group) expand_doit(fd, mainvar, paf->group); -- cgit v1.2.3