svn merge ^/trunk/blender -r43693:43733
[blender-staging.git] / source / blender / blenkernel / intern / particle_system.c
index daee707d143e40332f299dfe80667aee97a95301..f259ddbf5770bf1175998db96ea00dafdbc1ece4 100644 (file)
@@ -3489,6 +3489,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
        int totedge;
        int k;
        float hairmat[4][4];
+       float (*deformedVerts)[3];
 
        if(!psys->clmd) {
                psys->clmd = (ClothModifierData*)modifier_new(eModifierType_Cloth);
@@ -3582,7 +3583,15 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
        psys->clmd->point_cache = psys->pointcache;
        psys->clmd->sim_parms->effector_weights = psys->part->effector_weights;
 
-       psys->hair_out_dm = clothModifier_do(psys->clmd, sim->scene, sim->ob, dm);
+       deformedVerts = MEM_callocN(sizeof(*deformedVerts)*dm->getNumVerts(dm), "do_hair_dynamics vertexCos");
+       psys->hair_out_dm = CDDM_copy(dm, 0);
+       psys->hair_out_dm->getVertCos(psys->hair_out_dm, deformedVerts);
+
+       clothModifier_do(psys->clmd, sim->scene, sim->ob, dm, deformedVerts);
+
+       CDDM_apply_vert_coords(psys->hair_out_dm, deformedVerts);
+
+       MEM_freeN(deformedVerts);
 
        psys->clmd->sim_parms->effector_weights = NULL;
 }