diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-18 13:28:40 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-18 13:31:58 +0300 |
commit | 7d2590bbfab7d7fa378c4c85ff79dccc57b1db98 (patch) | |
tree | d15f7d8b7f2e33c507c7221b326f757af03ec132 | |
parent | 5efd2b7f36fbe2444e77d2b7b275d793da997c84 (diff) |
Fix T42608: Mesh deform modifier for curve fails in render
The issue was caused by render engine duplicating the curve object because
it then converts the object to mesh. The mesh deform duplication code didn't
duplicate binded data, so after duplication modifier is no longer applyable.
So now copyData of mesh deform would copy data needed for binding. This solves
reported render bug and also solves possible frustration when duplicating an
object with mesh deform in the viewport with Shift-D.
Checked other modifiers and laplacian deform already was copying binded data.
Didn't see other modifiers which might also need to copy extra data.
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshdeform.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index c253c0314ad..c6756f21af0 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -84,9 +84,16 @@ static void copyData(ModifierData *md, ModifierData *target) MeshDeformModifierData *mmd = (MeshDeformModifierData *) md; MeshDeformModifierData *tmmd = (MeshDeformModifierData *) target; - tmmd->gridsize = mmd->gridsize; - tmmd->flag = mmd->flag; - tmmd->object = mmd->object; + *tmmd = *mmd; + + if (mmd->bindinfluences) tmmd->bindinfluences = MEM_dupallocN(mmd->bindinfluences); + if (mmd->bindoffsets) tmmd->bindoffsets = MEM_dupallocN(mmd->bindoffsets); + if (mmd->bindcagecos) tmmd->bindcagecos = MEM_dupallocN(mmd->bindcagecos); + if (mmd->dyngrid) tmmd->dyngrid = MEM_dupallocN(mmd->dyngrid); + if (mmd->dyninfluences) tmmd->dyninfluences = MEM_dupallocN(mmd->dyninfluences); + if (mmd->dynverts) tmmd->dynverts = MEM_dupallocN(mmd->dynverts); + if (mmd->bindweights) tmmd->dynverts = MEM_dupallocN(mmd->bindweights); /* deprecated */ + if (mmd->bindcos) tmmd->dynverts = MEM_dupallocN(mmd->bindcos); /* deprecated */ } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) |