[Bf-blender-cvs] [7d2590b] master: Fix T42608: Mesh deform modifier for curve fails in render

Sergey Sharybin noreply at git.blender.org
Tue Nov 18 11:31:24 CET 2014


Commit: 7d2590bbfab7d7fa378c4c85ff79dccc57b1db98
Author: Sergey Sharybin
Date:   Tue Nov 18 11:28:40 2014 +0100
Branches: master
https://developer.blender.org/rB7d2590bbfab7d7fa378c4c85ff79dccc57b1db98

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.

===================================================================

M	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 c253c03..c6756f2 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)




More information about the Bf-blender-cvs mailing list