diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-04-04 15:42:33 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-04-04 16:49:30 +0300 |
commit | 59f6371a85824b4785db8e2b526c1101a5e30ca7 (patch) | |
tree | f8e512d18b21ed8b58e0dc111e8e807e1bb01c4f /source/blender/editors/armature/meshlaplacian.c | |
parent | c81eca3d986115ae8f3c542e9b00b89795233864 (diff) |
Fix T63252: Bind in Mesh Deform Modifier fails
A regression since 64c8d72ef1ad.
The solution is to force modifier evaluation for an evaluated
object, and let it to copy binding data back to original when
is being evaluated for binding.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4642
Diffstat (limited to 'source/blender/editors/armature/meshlaplacian.c')
-rw-r--r-- | source/blender/editors/armature/meshlaplacian.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 34fea2e0996..66bd7a8db80 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1577,6 +1577,8 @@ void ED_mesh_deform_bind_callback( MeshDeformModifierData *mmd, Mesh *cagemesh, float *vertexcos, int totvert, float cagemat[4][4]) { + MeshDeformModifierData *mmd_orig = + (MeshDeformModifierData *)modifier_get_original(&mmd->modifier); MeshDeformBind mdb; MVert *mvert; int a; @@ -1602,23 +1604,23 @@ void ED_mesh_deform_bind_callback( mul_v3_m4v3(mdb.vertexcos[a], mdb.cagemat, vertexcos + a * 3); /* solve */ - harmonic_coordinates_bind(mmd, &mdb); + harmonic_coordinates_bind(mmd_orig, &mdb); /* assign bind variables */ - mmd->bindcagecos = (float *)mdb.cagecos; - mmd->totvert = mdb.totvert; - mmd->totcagevert = mdb.totcagevert; - copy_m4_m4(mmd->bindmat, mmd->object->obmat); + mmd_orig->bindcagecos = (float *)mdb.cagecos; + mmd_orig->totvert = mdb.totvert; + mmd_orig->totcagevert = mdb.totcagevert; + copy_m4_m4(mmd_orig->bindmat, mmd_orig->object->obmat); /* transform bindcagecos to world space */ for (a = 0; a < mdb.totcagevert; a++) - mul_m4_v3(mmd->object->obmat, mmd->bindcagecos + a * 3); + mul_m4_v3(mmd_orig->object->obmat, mmd_orig->bindcagecos + a * 3); /* free */ MEM_freeN(mdb.vertexcos); /* compact weights */ - modifier_mdef_compact_influences((ModifierData *)mmd); + modifier_mdef_compact_influences((ModifierData *)mmd_orig); end_progress_bar(); waitcursor(0); |