diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-06-24 06:11:36 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-06-24 06:11:36 +0400 |
commit | db03788ad3ffe3a4c777b70fa5c53f99c5900620 (patch) | |
tree | 6af6952be2ce63b8298e7fb4a62f9ee068034fec /source/blender/blenloader | |
parent | 483e9479f73dca77fd3b6db7ede72849b1552859 (diff) |
2.5 - Particle Settings now Animateable
Added AnimData to ParticleSettings so that this will work. This seems to be ok in the brief tests I did, but be warned that this may not be optimal for the Particles System...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 5 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 54caad7f35b..7921740cbe8 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2899,7 +2899,9 @@ static void lib_link_particlesettings(FileData *fd, Main *main) part= main->particle.first; while(part) { if(part->id.flag & LIB_NEEDLINK) { + if (part->adt) lib_link_animdata(fd, &part->id, part->adt); part->ipo= newlibadr_us(fd, part->id.lib, part->ipo); // XXX depreceated - old animation system + part->dup_ob = newlibadr(fd, part->id.lib, part->dup_ob); part->dup_group = newlibadr(fd, part->id.lib, part->dup_group); part->eff_group = newlibadr(fd, part->id.lib, part->eff_group); @@ -2912,6 +2914,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main) static void direct_link_particlesettings(FileData *fd, ParticleSettings *part) { + part->adt= newdataadr(fd, part->adt); part->pd= newdataadr(fd, part->pd); part->pd2= newdataadr(fd, part->pd2); } @@ -9522,6 +9525,8 @@ static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSetting expand_doit(fd, mainvar, part->dup_group); expand_doit(fd, mainvar, part->eff_group); expand_doit(fd, mainvar, part->bb_ob); + + expand_animdata(fd, mainvar, part->adt); } static void expand_group(FileData *fd, Main *mainvar, Group *group) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 172c081570b..565e8128f8c 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -382,6 +382,7 @@ static void writedata(WriteData *wd, int filecode, int len, void *adr) /* do not /*These functions are used by blender's .blend system for file saving/loading.*/ void IDP_WriteProperty_OnlyData(IDProperty *prop, void *wd); void IDP_WriteProperty(IDProperty *prop, void *wd); +void write_animdata(WriteData *wd, AnimData *adt); // XXX code needs reshuffling, but not before NLA SoC is merged back into 2.5 static void IDP_WriteArray(IDProperty *prop, void *wd) { @@ -575,6 +576,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase) /* write LibData */ writestruct(wd, ID_PA, "ParticleSettings", 1, part); if (part->id.properties) IDP_WriteProperty(part->id.properties, wd); + if (part->adt) write_animdata(wd, part->adt); writestruct(wd, DATA, "PartDeflect", 1, part->pd); writestruct(wd, DATA, "PartDeflect", 1, part->pd2); } |