Fix T38227: Cloth cache storing only every 10 frames.

Make sure pointcache step is set to 1 for cloth when copying objects.
This commit is contained in:
Sergej Reich 2014-01-15 06:08:44 +01:00
parent 435a896fbe
commit a86f43df9f
Notes: blender-bot 2023-02-14 11:20:28 +01:00
Referenced by issue #38227, Cloth cache storing only every 10 frames.
2 changed files with 4 additions and 1 deletions

View File

@ -2781,8 +2781,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData*) md;
if (!clmd->point_cache)
if (!clmd->point_cache) {
clmd->point_cache = BKE_ptcache_add(&clmd->ptcaches);
clmd->point_cache->step = 1;
}
}
}
}

View File

@ -150,6 +150,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tclmd->sim_parms->effector_weights = MEM_dupallocN(clmd->sim_parms->effector_weights);
tclmd->coll_parms = MEM_dupallocN(clmd->coll_parms);
tclmd->point_cache = BKE_ptcache_add(&tclmd->ptcaches);
tclmd->point_cache->step = 1;
tclmd->clothObject = NULL;
}