[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13666] trunk/blender/source/blender: Cloth: changes in editmode will influence the velocity by 10% now, changed /add some update calls for the implicit function

Daniel Genrich daniel.genrich at gmx.net
Wed Feb 13 11:44:36 CET 2008


Revision: 13666
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13666
Author:   genscher
Date:     2008-02-13 11:44:36 +0100 (Wed, 13 Feb 2008)

Log Message:
-----------
Cloth: changes in editmode will influence the velocity by 10% now, changed/add some update calls for the implicit function

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

Modified: trunk/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cloth.c	2008-02-13 10:44:12 UTC (rev 13665)
+++ trunk/blender/source/blender/blenkernel/intern/cloth.c	2008-02-13 10:44:36 UTC (rev 13666)
@@ -1112,6 +1112,9 @@
 	// init our solver
 	if ( solvers [clmd->sim_parms->solver_type].init )
 		solvers [clmd->sim_parms->solver_type].init ( ob, clmd );
+	
+	if(cache_there)
+		implicit_set_positions(clmd);
 
 	clmd->clothObject->tree = bvh_build_from_cloth ( clmd, clmd->coll_parms->epsilon );
 

Modified: trunk/blender/source/blender/blenkernel/intern/collision.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/collision.c	2008-02-13 10:44:12 UTC (rev 13665)
+++ trunk/blender/source/blender/blenkernel/intern/collision.c	2008-02-13 10:44:36 UTC (rev 13666)
@@ -979,7 +979,7 @@
 	Cloth *cloth=NULL;
 	Object *coll_ob=NULL;
 	BVH *cloth_bvh=NULL;
-	long i=0, j = 0, numfaces = 0, numverts = 0, k = 0;
+	long i=0, j = 0, numfaces = 0, numverts = 0;
 	unsigned int result = 0, ic = 0, rounds = 0; // result counts applied collisions; ic is for debug output; 
 	ClothVertex *verts = NULL;
 	float tnull[3] = {0,0,0};

Modified: trunk/blender/source/blender/src/editmesh.c
===================================================================
--- trunk/blender/source/blender/src/editmesh.c	2008-02-13 10:44:12 UTC (rev 13665)
+++ trunk/blender/source/blender/src/editmesh.c	2008-02-13 10:44:36 UTC (rev 13666)
@@ -1122,12 +1122,12 @@
 			VECCOPY(cloth->verts[i].x, eve->co);
 			Mat4MulVecfl ( G.obedit->obmat, cloth->verts[i].x );
 			
-			/*
+			
 			// not physical correct but gives nicer results when commented
 			VECSUB(temp, cloth->verts[i].x, temp);
-			VecMulf(temp, 1.0f / dt);
+			VecMulf(temp, 1.0f / (dt*10.0));
 			VECADD(cloth->verts[i].v, cloth->verts[i].v, temp);
-			*/
+			
 			if(oldverts) {
 				VECCOPY(mvert->co, oldverts[i].co);
 				if(G.rt > 0)
@@ -1171,12 +1171,9 @@
 		if(G.rt > 0)
 		printf("loadmesh --> cloth_enabled cloth_write_cache\n");
 		cloth_write_cache(G.obedit, clmd, clmd->sim_parms->editedframe);
+		cloth_read_cache(G.obedit, clmd, G.scene->r.cfra);
+		implicit_set_positions(clmd);
 		
-		/* in this case we have to get the data for the requested frame */
-		if(clmd->sim_parms->editedframe != G.scene->r.cfra)
-		{
-			cloth_read_cache(G.obedit, clmd, G.scene->r.cfra);
-		}
 		clmd->sim_parms->flags &= ~CLOTH_SIMSETTINGS_FLAG_EDITMODE;
 	}
 	else





More information about the Bf-blender-cvs mailing list