[Bf-blender-cvs] [39155c1] fracture_modifier: Revert last commit where attempt of keeping autohide state was made

Martin Felke noreply at git.blender.org
Sun Sep 27 21:18:32 CEST 2015


Commit: 39155c1c46df92dc0198093a64c5ae72418409e5
Author: Martin Felke
Date:   Sun Sep 27 21:15:44 2015 +0200
Branches: fracture_modifier
https://developer.blender.org/rB39155c1c46df92dc0198093a64c5ae72418409e5

Revert last commit where attempt of keeping autohide state was made

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

M	source/blender/blenkernel/intern/rigidbody.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_rigidbody_types.h
M	source/blender/modifiers/intern/MOD_fracture.c

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index e64bd10..1115355 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -74,41 +74,6 @@
 
 #ifdef WITH_BULLET
 
-static void do_refresh_autohide_deletion_map(FractureModifierData *fmd)
-{
-	//length of deletion map = poly count of shattered mesh !
-	if (fmd->visible_mesh_cached)
-	{
-		int num_polys = fmd->visible_mesh_cached->getNumPolys(fmd->visible_mesh_cached);
-		int i = 0;
-
-		if (fmd->autohide_deletion_map == NULL)
-		{
-			fmd->autohide_deletion_map = MEM_callocN(sizeof(int) * num_polys, "autohide_deletion_map");
-		}
-		else
-		{
-			for (i = 0; i < num_polys; i++)
-			{
-				fmd->autohide_deletion_map[i] = 0;
-			}
-		}
-	}
-}
-
-static void reset_autohide(RigidBodyWorld *rbw)
-{
-	GroupObject *go;
-
-	/*reset autohide deletion states of all modifier objects in the rigidbody world*/
-	for (go = rbw->group->gobject.first; go; go = go->next)	{
-		FractureModifierData *fmd = (FractureModifierData*)modifiers_findByType(go->ob, eModifierType_Fracture);
-		if (fmd) {
-			do_refresh_autohide_deletion_map(fmd);
-		}
-	}
-}
-
 static void validateShard(RigidBodyWorld *rbw, MeshIsland *mi, Object *ob, int rebuild, int transfer_speed);
 
 static void activateRigidbody(RigidBodyOb* rbo, RigidBodyWorld *UNUSED(rbw), MeshIsland *UNUSED(mi), Object *UNUSED(ob))
@@ -3572,9 +3537,6 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
 		/* rebuild constraints */
 		rbw->flag |= RBW_FLAG_REBUILD_CONSTRAINTS;
 
-		/* reset autohide deletion state */
-		reset_autohide(rbw);
-
 		rbw->ltime = startframe;
 		if (rbw->flag & RBW_FLAG_OBJECT_CHANGED)
 		{       /* flag modifier refresh at their next execution XXX TODO -> still used ? */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 852ae13..75a735a 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4932,7 +4932,6 @@ static void load_fracture_modifier(FileData* fd, FractureModifierData *fmd, Obje
 	fmd->face_pairs = NULL;
 	fmd->vert_index_map = NULL;
 	fmd->vertex_island_map = NULL;
-	fmd->autohide_deletion_map = NULL;
 
 	/*HARDCODING this for now, until we can version it properly, say with 2.75 ? */
 	if (fd->fileversion < 275) {
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index a3fe88b..178a039 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1559,7 +1559,6 @@ typedef struct FractureModifierData {
 	struct GHash *face_pairs;
 	struct GHash *vert_index_map; /*used for autoconversion of former objects to clusters, marks object membership of each vert*/
 	struct GHash *vertex_island_map; /* used for constraint building based on vertex proximity, temporary data */
-	int *autohide_deletion_map; /* store which shards broke and dont reconnect them again, means dont delete this face again */
 	ListBase shard_sequence; /* used as mesh cache / history for dynamic fracturing, for shards (necessary for conversion to DM) */
 	ListBase meshIsland_sequence; /* used as mesh cache / history for dynamic fracturing, for meshIslands (necessary for loc/rot "pointcache") */
 	ShardSequence *current_shard_entry; /*volatile storage of current shard entry, so we dont have to search in the list */
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
index f343f73..ab17416 100644
--- a/source/blender/makesdna/DNA_rigidbody_types.h
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -92,7 +92,6 @@ typedef enum eRigidBodyWorld_Flag {
 	RBW_FLAG_REFRESH_MODIFIERS	= (1 << 4),
 	/* Flag rebuild of constraints in fracture modifier objects */
 	RBW_FLAG_REBUILD_CONSTRAINTS = (1 << 5),
-
 } eRigidBodyWorld_Flag;
 
 /* ******************************** */
diff --git a/source/blender/modifiers/intern/MOD_fracture.c b/source/blender/modifiers/intern/MOD_fracture.c
index 681cdb1..a9d6219 100644
--- a/source/blender/modifiers/intern/MOD_fracture.c
+++ b/source/blender/modifiers/intern/MOD_fracture.c
@@ -210,7 +210,6 @@ static void initData(ModifierData *md)
 	fmd->update_dynamic = false;
 	fmd->limit_impact = false;
 	fmd->reset_shards = false;
-	fmd->autohide_deletion_map = NULL;
 }
 
 static void freeMeshIsland(FractureModifierData *rmd, MeshIsland *mi, bool remove_rigidbody)
@@ -391,11 +390,6 @@ static void free_modifier(FractureModifierData *fmd, bool do_free_seq)
 		fmd->face_pairs = NULL;
 	}
 
-	if (fmd->autohide_deletion_map != NULL){
-		MEM_freeN(fmd->autohide_deletion_map);
-		fmd->autohide_deletion_map = NULL;
-	}
-
 	//called on deleting modifier, object or quitting blender...
 	//why was this necessary again ?!
 	if (fmd->dm) {
@@ -1406,7 +1400,6 @@ static void copyData(ModifierData *md, ModifierData *target)
 	trmd->dynamic_force = rmd->dynamic_force;
 	trmd->update_dynamic = false;
 	trmd->reset_shards = false;
-	trmd->autohide_deletion_map = NULL;
 }
 
 /* mi->bb, its for volume fraction calculation.... */
@@ -2607,18 +2600,6 @@ static void find_other_face(FractureModifierData *fmd, int i, BMesh* bm, BMFace
 		return;
 	}
 
-	if (fmd->autohide_deletion_map == NULL)
-	{
-		int num_polys = fmd->visible_mesh_cached->getNumPolys(fmd->visible_mesh_cached);
-		fmd->autohide_deletion_map = MEM_callocN(sizeof(int) * num_polys, "autohide_deletion_map");
-	}
-
-	if (fmd->autohide_deletion_map[i] || fmd->autohide_deletion_map[other])
-	{
-		/* do not delete this facepair again, keep it */
-		return;
-	}
-
 	f1 = BM_face_at_index(bm, i);
 	f2 = BM_face_at_index(bm, other);
 
@@ -2629,6 +2610,7 @@ static void find_other_face(FractureModifierData *fmd, int i, BMesh* bm, BMFace
 	BM_face_calc_center_mean(f1, f_centr);
 	BM_face_calc_center_mean(f2, f_centr_other);
 
+
 	if ((len_squared_v3v3(f_centr, f_centr_other) < (fmd->autohide_dist)) && (f1 != f2) &&
 	    (f1->mat_nr == 1) && (f2->mat_nr == 1))
 	{
@@ -2638,12 +2620,6 @@ static void find_other_face(FractureModifierData *fmd, int i, BMesh* bm, BMFace
 		(*faces)[(*del_faces) + 1] = f2;
 		(*del_faces) += 2;
 	}
-	else
-	{
-		/* broken face pairs */
-		fmd->autohide_deletion_map[i] = true;
-		fmd->autohide_deletion_map[other] = true;
-	}
 }
 
 static DerivedMesh *do_autoHide(FractureModifierData *fmd, DerivedMesh *dm)




More information about the Bf-blender-cvs mailing list