[Bf-blender-cvs] [8506e3a] master: Fix T38294: enabling hair dynamics very slow / hangs with many hairs.

Brecht Van Lommel noreply at git.blender.org
Mon Jan 20 17:23:14 CET 2014


Commit: 8506e3a78c9955937bbe386b594aeb224bc9f380
Author: Brecht Van Lommel
Date:   Mon Jan 20 17:20:58 2014 +0100
https://developer.blender.org/rB8506e3a78c9955937bbe386b594aeb224bc9f380

Fix T38294: enabling hair dynamics very slow / hangs with many hairs.

This function call was accidentally placed inside a loop which gave O(n^2)
behavior, but there's no reason for it.

===================================================================

M	source/blender/blenkernel/intern/implicit.c

===================================================================

diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index ef21c3f..af057b6 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -776,11 +776,10 @@ int implicit_init(Object *UNUSED(ob), ClothModifierData *clmd)
 	id->z = create_lfvector(cloth->numverts);
 	
 	id->S[0].vcount = 0;
+	update_matrixS(verts, cloth->numverts, id->S);
 
 	for (i = 0; i < cloth->numverts; i++) {
 		id->A[i].r = id->A[i].c = id->dFdV[i].r = id->dFdV[i].c = id->dFdX[i].r = id->dFdX[i].c = id->P[i].c = id->P[i].r = id->Pinv[i].c = id->Pinv[i].r = id->bigI[i].c = id->bigI[i].r = id->M[i].r = id->M[i].c = i;
-
-		update_matrixS(verts, cloth->numverts, id->S);
 		
 		initdiag_fmatrixS(id->M[i].m, verts[i].mass);
 	}




More information about the Bf-blender-cvs mailing list