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:
authorBastien Montagne <bastien@blender.org>2021-11-04 19:15:34 +0300
committerBastien Montagne <bastien@blender.org>2021-11-04 19:16:49 +0300
commit2eed1afd114fa7f3e7a1be530924e4f11b68128d (patch)
tree9453de9d7384b6b44547e15581688066deb84c26
parentffe115d1a8f625bb5a6b72616fa2f955448869ff (diff)
Fix T92778: Cloth Point Cache Name disappears after Make Library Override.
Cloth modifier had a unique, weird and weak way of copying its pointcache, now make it use `BKE_ptcache_copy_list` like done for e.g. particles or softbody data.
-rw-r--r--source/blender/modifiers/intern/MOD_cloth.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index c9d5ef73c49..8aff29dc17d 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -201,13 +201,9 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
tclmd->point_cache = clmd->point_cache;
}
else {
- tclmd->point_cache = BKE_ptcache_add(&tclmd->ptcaches);
- if (clmd->point_cache != NULL) {
- tclmd->point_cache->step = clmd->point_cache->step;
- tclmd->point_cache->startframe = clmd->point_cache->startframe;
- tclmd->point_cache->endframe = clmd->point_cache->endframe;
- tclmd->point_cache->flag |= (clmd->point_cache->flag & PTCACHE_FLAGS_COPY);
- }
+ const int clmd_point_cache_index = BLI_findindex(&clmd->ptcaches, clmd->point_cache);
+ BKE_ptcache_copy_list(&tclmd->ptcaches, &clmd->ptcaches, flag);
+ tclmd->point_cache = BLI_findlink(&tclmd->ptcaches, clmd_point_cache_index);
}
tclmd->sim_parms = MEM_dupallocN(clmd->sim_parms);