diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-23 15:19:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-23 15:19:06 +0400 |
commit | 08775e8f145a863938c982d18191d1d55a517f98 (patch) | |
tree | 94e2d84b1e446558e86b9e77688dbec45ff29ef9 /source/blender/editors/armature | |
parent | d43bef938f950691b5a607eff7393e9e47690d33 (diff) |
Mesh Deform Modifier: compress static binding weights better, threshold
is still set very low so in many cases it could be even smaller, but being
a bit conservative here to try to avoid breaking rigs.
This is not forward-compatible, i.e. loading new files in older blender
versions will loose the binding.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/meshlaplacian.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 700f4573e3a..f0f7bc9eb88 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -44,6 +44,7 @@ #include "BLI_memarena.h" #include "BKE_DerivedMesh.h" +#include "BKE_modifier.h" #include "BKE_utildefines.h" #ifdef RIGID_DEFORM @@ -1991,19 +1992,22 @@ void mesh_deform_bind(Scene *scene, DerivedMesh *dm, MeshDeformModifierData *mmd #endif /* assign bind variables */ - mmd->bindcos= (float*)mdb.cagecos; + mmd->bindcagecos= (float*)mdb.cagecos; mmd->totvert= mdb.totvert; mmd->totcagevert= mdb.totcagevert; copy_m4_m4(mmd->bindmat, mmd->object->obmat); - /* transform bindcos to world space */ + /* transform bindcagecos to world space */ for(a=0; a<mdb.totcagevert; a++) - mul_m4_v3(mmd->object->obmat, mmd->bindcos+a*3); + mul_m4_v3(mmd->object->obmat, mmd->bindcagecos+a*3); /* free */ mdb.cagedm->release(mdb.cagedm); MEM_freeN(mdb.vertexcos); + /* compact weights */ + modifier_mdef_compact_influences((ModifierData*)mmd); + end_progress_bar(); waitcursor(0); } |