diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-08-03 17:09:23 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-08-03 17:09:23 +0400 |
commit | 641c8e69a82fc8f674f81948e329cae334ef60fc (patch) | |
tree | 9e67c1672c83d49a728f28da3a7ca48dd5f6d558 /source/blender/blenloader | |
parent | cd905eef702555b27d4d90983b079a1a62c31fb8 (diff) |
2.5 - MetaBalls are now animateable
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 876b07eef89..8dde100dff2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2488,7 +2488,8 @@ static void lib_link_mball(FileData *fd, Main *main) mb= main->mball.first; while(mb) { if(mb->id.flag & LIB_NEEDLINK) { - + if (mb->adt) lib_link_animdata(fd, &mb->id, mb->adt); + for(a=0; a<mb->totcol; a++) mb->mat[a]= newlibadr_us(fd, mb->id.lib, mb->mat[a]); mb->ipo= newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX depreceated - old animation system @@ -2501,6 +2502,9 @@ static void lib_link_mball(FileData *fd, Main *main) static void direct_link_mball(FileData *fd, MetaBall *mb) { + mb->adt= newdataadr(fd, mb->adt); + direct_link_animdata(fd, mb->adt); + mb->mat= newdataadr(fd, mb->mat); test_pointer_array(fd, (void **)&mb->mat); @@ -9946,6 +9950,9 @@ static void expand_mball(FileData *fd, Main *mainvar, MetaBall *mb) for(a=0; a<mb->totcol; a++) { expand_doit(fd, mainvar, mb->mat[a]); } + + if(mb->adt) + expand_animdata(fd, mainvar, mb->adt); } static void expand_curve(FileData *fd, Main *mainvar, Curve *cu) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index da68132700d..05ea60b50df 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1297,6 +1297,7 @@ static void write_mballs(WriteData *wd, ListBase *idbase) /* direct data */ writedata(wd, DATA, sizeof(void *)*mb->totcol, mb->mat); + if (mb->adt) write_animdata(wd, mb->adt); ml= mb->elems.first; while(ml) { |