diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-11-12 01:54:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-11-12 01:54:14 +0300 |
commit | 7f2e43968a917e4512117164a8645756893c93da (patch) | |
tree | cfd391353933b5e3c98aa7a5ba62bc65c6ef67e0 /source/blender/blenloader/intern | |
parent | 828eba48420c69bf25752b2ed0a2d47badbc0f67 (diff) |
Mesh Deform Modifier
====================
Dynamic binding support. This means that the mesh can move _within_
the cage and still deform correct. If the mesh goes out of the cage,
don't expect correct result. Must be enabled with the 'Dynamic'
option, because it is slower and consumes more memory.
This is useful to use e.g. the cage mesh for main deformations and
still have shape keys for facial deformation working.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 5 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 384a6d93480..615d1759f66 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2894,6 +2894,9 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) mmd->bindweights= newdataadr(fd, mmd->bindweights); mmd->bindcos= newdataadr(fd, mmd->bindcos); + mmd->dyngrid= newdataadr(fd, mmd->dyngrid); + mmd->dyninfluences= newdataadr(fd, mmd->dyninfluences); + mmd->dynverts= newdataadr(fd, mmd->dynverts); if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) { int a; @@ -2902,6 +2905,8 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) SWITCH_INT(mmd->bindweights[a]) for(a=0; a<mmd->totcagevert*3; a++) SWITCH_INT(mmd->bindcos[a]) + for(a=0; a<mmd->totvert; a++) + SWITCH_INT(mmd->dynverts[a]) } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 43907a30ac2..1aa47960bad 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -787,11 +787,16 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) } else if (md->type==eModifierType_MeshDeform) { MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; + int size = mmd->dyngridsize; writedata(wd, DATA, sizeof(float)*mmd->totvert*mmd->totcagevert, mmd->bindweights); writedata(wd, DATA, sizeof(float)*3*mmd->totcagevert, mmd->bindcos); + writedata(wd, DATA, sizeof(MDefCell)*size*size*size, mmd->dyngrid); + writedata(wd, DATA, sizeof(MDefInfluence)*mmd->totinfluence, + mmd->dyninfluences); + writedata(wd, DATA, sizeof(int)*mmd->totvert, mmd->dynverts); } } } |