[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32411] trunk/blender/source/blender/ blenkernel/intern/cloth.c: Fix for [#24195] Cloth modifier doesn' t work after changing subsurf on the object

Janne Karhu jhkarh at gmail.com
Mon Oct 11 11:02:19 CEST 2010


Revision: 32411
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32411
Author:   jhk
Date:     2010-10-11 11:02:19 +0200 (Mon, 11 Oct 2010)

Log Message:
-----------
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)

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/cloth.c

Modified: trunk/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cloth.c	2010-10-11 08:19:28 UTC (rev 32410)
+++ trunk/blender/source/blender/blenkernel/intern/cloth.c	2010-10-11 09:02:19 UTC (rev 32411)
@@ -446,7 +446,9 @@
 		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 @@
 		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;
 





More information about the Bf-blender-cvs mailing list