From 7d2590bbfab7d7fa378c4c85ff79dccc57b1db98 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 18 Nov 2014 11:28:40 +0100 Subject: 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. --- source/blender/modifiers/intern/MOD_meshdeform.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_meshdeform.c') 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) -- cgit v1.2.3