[Bf-blender-cvs] [0f5dc7ad80] cloth-improvements: Remove edgeset stuff (no longer used)

Luca Rood noreply at git.blender.org
Fri Jan 20 05:38:50 CET 2017


Commit: 0f5dc7ad80189373b11d58ffd528c9177de67e0c
Author: Luca Rood
Date:   Fri Jan 20 00:42:43 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rB0f5dc7ad80189373b11d58ffd528c9177de67e0c

Remove edgeset stuff (no longer used)

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

M	source/blender/blenkernel/BKE_cloth.h
M	source/blender/blenkernel/intern/cloth.c

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

diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index 67d8973950..ac8838591c 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -96,7 +96,6 @@ typedef struct Cloth {
 	struct BVHTree 		*bvhselftree;			/* collision tree for this cloth object */
 	struct MVertTri		*tri;
 	struct Implicit_Data	*implicit; 		/* our implicit solver connects to this pointer */
-	struct EdgeSet	 	*edgeset; 		/* used for selfcollisions */
 	int last_frame, pad4;
 } Cloth;
 
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index ad7bb9c84e..8e377a69d7 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -499,10 +499,6 @@ void cloth_free_modifier(ClothModifierData *clmd )
 		// we save our faces for collision objects
 		if (cloth->tri)
 			MEM_freeN(cloth->tri);
-
-		if (cloth->edgeset)
-			BLI_edgeset_free(cloth->edgeset);
-		
 		
 		/*
 		if (clmd->clothObject->facemarks)
@@ -571,10 +567,6 @@ void cloth_free_modifier_extern(ClothModifierData *clmd )
 		if (cloth->tri)
 			MEM_freeN(cloth->tri);
 
-		if (cloth->edgeset)
-			BLI_edgeset_free(cloth->edgeset);
-
-
 		/*
 		if (clmd->clothObject->facemarks)
 		MEM_freeN(clmd->clothObject->facemarks);
@@ -742,7 +734,6 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
 		clmd->clothObject->old_solver_type = 255;
 		// clmd->clothObject->old_collision_type = 255;
 		cloth = clmd->clothObject;
-		clmd->clothObject->edgeset = NULL;
 	}
 	else if (!clmd->clothObject) {
 		modifier_setError(&(clmd->modifier), "Out of memory on allocating clmd->clothObject");
@@ -950,11 +941,6 @@ static void cloth_free_errorsprings(Cloth *cloth, LinkNodePair *edgelist)
 	}
 
 	cloth_free_edgelist(edgelist, cloth->mvert_num);
-	
-	if (cloth->edgeset) {
-		BLI_edgeset_free(cloth->edgeset);
-		cloth->edgeset = NULL;
-	}
 }
 
 BLI_INLINE float spring_angle(ClothVertex *verts, int i, int j, int *i_a, int *i_b, int len_a, int len_b)
@@ -1383,7 +1369,6 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 	const MLoop *mloop = dm->getLoopArray(dm);
 	const MLoop *ml;
 	LinkNodePair *edgelist;
-	EdgeSet *edgeset = NULL;
 	LinkNode *search = NULL, *search2 = NULL;
 	BendSpringRef *spring_ref;
 	BendSpringRef *curr_ref;
@@ -1392,13 +1377,11 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 	if ( numedges==0 )
 		return 0;
 
-	/* NOTE: handling ownership of springs and edgeset is quite sloppy
+	/* NOTE: handling ownership of springs is quite sloppy
 	 * currently they are never initialized but assert just to be sure */
 	BLI_assert(cloth->springs == NULL);
-	BLI_assert(cloth->edgeset == NULL);
 
 	cloth->springs = NULL;
-	cloth->edgeset = NULL;
 
 	spring_ref = MEM_callocN(sizeof(*spring_ref) * numedges, "temp bend spring reference");
 
@@ -1605,20 +1588,6 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 	}
 
 	MEM_freeN(spring_ref);
-
-	edgeset = BLI_edgeset_new_ex(__func__, numedges);
-	cloth->edgeset = edgeset;
-
-	for (i = 0; i < numedges; i++) { /* struct springs */
-		BLI_edgeset_add(edgeset, medge[i].v1, medge[i].v2);
-	}
-
-	for (i = 0; i < numpolys; i++) { /* edge springs */
-		if (mpoly[i].totloop == 4) {
-			BLI_edgeset_add(edgeset, mloop[mpoly[i].loopstart + 0].v, mloop[mpoly[i].loopstart + 2].v);
-			BLI_edgeset_add(edgeset, mloop[mpoly[i].loopstart + 1].v, mloop[mpoly[i].loopstart + 3].v);
-		}
-	}
 	
 	cloth->numsprings = struct_springs + shear_springs + bend_springs;




More information about the Bf-blender-cvs mailing list