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:
authorJanne Karhu <jhkarh@gmail.com>2010-10-11 13:02:19 +0400
committerJanne Karhu <jhkarh@gmail.com>2010-10-11 13:02:19 +0400
commit7ab02f1ec17b4a48aedb2ab4ec43d0fe2d62c565 (patch)
tree2865881b2de33cca98d2196bef4141af69749d00 /source/blender
parent67a1a871a9be8b62344efc3ba1c312dce535da09 (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')
-rw-r--r--source/blender/blenkernel/intern/cloth.c15
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;