fix [#28112] Vertex paint crash
authorCampbell Barton <ideasman42@gmail.com>
Mon, 1 Aug 2011 06:50:24 +0000 (06:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 1 Aug 2011 06:50:24 +0000 (06:50 +0000)
source/blender/blenkernel/intern/DerivedMesh.c

index d9c98bc..62b8830 100644 (file)
@@ -1883,7 +1883,9 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                        
                        /* set the DerivedMesh to only copy needed data */
                        mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
-                       DM_set_only_copy(dm, mask);
+                       /* needMapping check here fixes bug [#28112], otherwise its
+                        * possible that it wont be copied */
+                       DM_set_only_copy(dm, mask | (needMapping ? CD_MASK_ORIGINDEX : 0));
                        
                        /* add cloth rest shape key if need */
                        if(mask & CD_MASK_CLOTH_ORCO)