Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorishbosamiya <ishbosamiya@gmail.com>2021-08-19 14:28:26 +0300
committerishbosamiya <ishbosamiya@gmail.com>2021-08-19 14:28:26 +0300
commite68cf37413bb29e6238bd4f8a5cad19dc18821b9 (patch)
treee30c529ffe2e225150d8ffa4bb3fa425afe96c64 /source/blender
parent5afe71daf54212c3488306c986fb73504183bfb6 (diff)
cloth: fix: reset per vertex spring count when building springs
While building the structural springs, the vertices that connect the springs, their spring count is incremented. Since the springs are being rebuilt entirely, the spring count should also be reset.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/cloth.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 1e99921b911..ff304cf7c7e 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -1715,9 +1715,11 @@ bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh)
BLI_rng_free(rng);
}
+ /* Reset the spring length and spring count */
clmd->sim_parms->avg_spring_len = 0.0f;
for (int i = 0; i < mvert_num; i++) {
cloth->verts[i].avg_spring_len = 0.0f;
+ cloth->verts[i].spring_count = 0;
}
if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW) {