Fix T56595: Hair Dynamics stop working after saving new file
[blender.git] / source / blender / blenkernel / intern / cloth.c
index 9666b1ef68f02e80d9436398baba0db28c96afbd..5396a1905b95b6f1c52974cf1cb613701bc6581f 100644 (file)
@@ -1285,6 +1285,11 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
        if (!edgelist)
                return 0;
 
+       clmd->sim_parms->avg_spring_len = 0.0f;
+       for (i = 0; i < mvert_num; i++) {
+               cloth->verts[i].avg_spring_len = 0.0f;
+       }
+
        // structural springs
        for ( i = 0; i < numedges; i++ ) {
                spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );