diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-10-11 13:02:19 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-10-11 13:02:19 +0400 |
commit | 7ab02f1ec17b4a48aedb2ab4ec43d0fe2d62c565 (patch) | |
tree | 2865881b2de33cca98d2196bef4141af69749d00 /source/blender/blenkernel/intern/cloth.c | |
parent | 67a1a871a9be8b62344efc3ba1c312dce535da09 (diff) |
Fix for [#24195] Cloth modifier doesn't work after changing subsurf on the object
* Cloth has to reset itself properly on vertex count changes as it can be after a constructive modifier (unlike softbody)
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index be1552a882d..3f47676d7fd 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -446,7 +446,9 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, return dm; } - if(clmd->sim_parms->reset || (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0)) + if(clmd->sim_parms->reset + || (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0) + || (clmd->clothObject && result->getNumVerts(result) != clmd->clothObject->numverts)) { clmd->sim_parms->reset = 0; cache->flag |= PTCACHE_OUTDATED; @@ -457,17 +459,6 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, return result; } - /* verify we still have the same number of vertices, if not do nothing. - * note that this should only happen if the number of vertices changes - * during an animation due to a preceding modifier, this should not - * happen because of object changes! */ - if(clmd->clothObject) { - if(result->getNumVerts(result) != clmd->clothObject->numverts) { - BKE_ptcache_invalidate(cache); - return result; - } - } - // unused in the moment, calculated separately in implicit.c clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame; |