[Bf-blender-cvs] [735727e] temp_remove_pointcache: Removed DNA for point caches.

Lukas Tönne noreply at git.blender.org
Sat Apr 30 14:20:35 CEST 2016


Commit: 735727e2b84b64a64aa6abc26f1115af37ff55ba
Author: Lukas Tönne
Date:   Sat Apr 30 14:20:13 2016 +0200
Branches: temp_remove_pointcache
https://developer.blender.org/rB735727e2b84b64a64aa6abc26f1115af37ff55ba

Removed DNA for point caches.

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

M	source/blender/blenkernel/BKE_rigidbody.h
M	source/blender/blenkernel/intern/bpath.c
M	source/blender/blenkernel/intern/rigidbody.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/makesdna/DNA_dynamicpaint_types.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_object_force.h
M	source/blender/makesdna/DNA_rigidbody_types.h
M	source/blender/makesdna/DNA_smoke_types.h
M	source/blender/makesrna/intern/rna_rigidbody.c
M	source/blender/makesrna/intern/rna_smoke.c
M	source/blender/render/intern/source/voxeldata.c

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

diff --git a/source/blender/blenkernel/BKE_rigidbody.h b/source/blender/blenkernel/BKE_rigidbody.h
index 272abc4..6731356 100644
--- a/source/blender/blenkernel/BKE_rigidbody.h
+++ b/source/blender/blenkernel/BKE_rigidbody.h
@@ -99,7 +99,6 @@ void BKE_rigidbody_remove_constraint(struct Scene *scene, struct Object *ob);
 void BKE_rigidbody_aftertrans_update(struct Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle);
 void BKE_rigidbody_sync_transforms(struct RigidBodyWorld *rbw, struct Object *ob, float ctime);
 bool BKE_rigidbody_check_sim_running(struct RigidBodyWorld *rbw, float ctime);
-void BKE_rigidbody_cache_reset(struct RigidBodyWorld *rbw);
 void BKE_rigidbody_rebuild_world(struct Scene *scene, float ctime);
 void BKE_rigidbody_do_simulation(struct Scene *scene, float ctime);
 
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index 37ecbb3..e338974 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -462,19 +462,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
 			Object *ob = (Object *)id;
 			ModifierData *md;
 
-#define BPATH_TRAVERSE_POINTCACHE(ptcaches)                                    \
-	{                                                                          \
-		PointCache *cache;                                                     \
-		for (cache = (ptcaches).first; cache; cache = cache->next) {           \
-			if (cache->flag & PTCACHE_DISK_CACHE) {                            \
-				rewrite_path_fixed(cache->path,                                \
-				                   visit_cb,                                   \
-				                   absbase,                                    \
-				                   bpath_user_data);                           \
-			}                                                                  \
-		}                                                                      \
-	} (void)0
-
 			/* do via modifiers instead */
 #if 0
 			if (ob->fluidsimSettings) {
@@ -489,16 +476,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
 						rewrite_path_fixed(fluidmd->fss->surfdataPath, visit_cb, absbase, bpath_user_data);
 					}
 				}
-				else if (md->type == eModifierType_Smoke) {
-					SmokeModifierData *smd = (SmokeModifierData *)md;
-					if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
-						BPATH_TRAVERSE_POINTCACHE(smd->domain->ptcaches[0]);
-					}
-				}
-				else if (md->type == eModifierType_Cloth) {
-					ClothModifierData *clmd = (ClothModifierData *) md;
-					BPATH_TRAVERSE_POINTCACHE(clmd->ptcaches);
-				}
 				else if (md->type == eModifierType_Ocean) {
 					OceanModifierData *omd = (OceanModifierData *) md;
 					rewrite_path_fixed(omd->cachepath, visit_cb, absbase, bpath_user_data);
@@ -509,12 +486,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
 				}
 			}
 
-			if (ob->soft) {
-				BPATH_TRAVERSE_POINTCACHE(ob->soft->ptcaches);
-			}
-
-#undef BPATH_TRAVERSE_POINTCACHE
-
 			break;
 		}
 		case ID_SO:
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 9cd38b7..9eefcbe 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -963,10 +963,9 @@ void BKE_rigidbody_world_id_loop(RigidBodyWorld *rbw, RigidbodyWorldIDFunc func,
 }
 
 /* Add rigid body settings to the specified object */
-RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type)
+RigidBodyOb *BKE_rigidbody_create_object(Scene *UNUSED(scene), Object *ob, short type)
 {
 	RigidBodyOb *rbo;
-	RigidBodyWorld *rbw = scene->rigidbody_world;
 
 	/* sanity checks
 	 *	- rigidbody world must exist
@@ -1010,18 +1009,14 @@ RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type)
 	/* set initial transform */
 	mat4_to_loc_quat(rbo->pos, rbo->orn, ob->obmat);
 
-	/* flag cache as outdated */
-	BKE_rigidbody_cache_reset(rbw);
-
 	/* return this object */
 	return rbo;
 }
 
 /* Add rigid body constraint to the specified object */
-RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short type)
+RigidBodyCon *BKE_rigidbody_create_constraint(Scene *UNUSED(scene), Object *ob, short type)
 {
 	RigidBodyCon *rbc;
-	RigidBodyWorld *rbw = scene->rigidbody_world;
 
 	/* sanity checks
 	 *	- rigidbody world must exist
@@ -1071,9 +1066,6 @@ RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short ty
 	rbc->motor_ang_max_impulse = 1.0f;
 	rbc->motor_ang_target_velocity = 1.0f;
 
-	/* flag cache as outdated */
-	BKE_rigidbody_cache_reset(rbw);
-
 	/* return this object */
 	return rbc;
 }
@@ -1133,9 +1125,6 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob)
 
 	/* remove object's settings */
 	BKE_rigidbody_free_object(ob);
-
-	/* flag cache as outdated */
-	BKE_rigidbody_cache_reset(rbw);
 }
 
 void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob)
@@ -1149,9 +1138,6 @@ void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob)
 	}
 	/* remove object's settings */
 	BKE_rigidbody_free_constraint(ob);
-
-	/* flag cache as outdated */
-	BKE_rigidbody_cache_reset(rbw);
 }
 
 
@@ -1418,9 +1404,9 @@ static void rigidbody_update_simulation_post_step(RigidBodyWorld *rbw)
 	}
 }
 
-bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float ctime)
+bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float UNUSED(ctime))
 {
-	return (rbw && (rbw->flag & RBW_FLAG_MUTED) == 0 && ctime > rbw->pointcache->startframe);
+	return (rbw && (rbw->flag & RBW_FLAG_MUTED) == 0);
 }
 
 /* Sync rigid body and object transformations */
@@ -1483,12 +1469,6 @@ void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], flo
 	// RB_TODO update rigid body physics object's loc/rot for dynamic objects here as well (needs to be done outside bullet's update loop)
 }
 
-void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw)
-{
-	if (rbw)
-		rbw->pointcache->flag |= PTCACHE_OUTDATED;
-}
-
 /* ------------------ */
 
 /* Rebuild rigid body world */
@@ -1571,7 +1551,6 @@ void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob) {}
 void BKE_rigidbody_sync_transforms(RigidBodyWorld *rbw, Object *ob, float ctime) {}
 void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle) {}
 bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float ctime) { return false; }
-void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {}
 void BKE_rigidbody_rebuild_world(Scene *scene, float ctime) {}
 void BKE_rigidbody_do_simulation(Scene *scene, float ctime) {}
 
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 1361ecd..e1a4e25 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1057,57 +1057,6 @@ static void write_userdef(WriteData *wd)
 	}
 }
 
-/* update this also to readfile.c */
-static const char *ptcache_data_struct[] = {
-	"", // BPHYS_DATA_INDEX
-	"", // BPHYS_DATA_LOCATION
-	"", // BPHYS_DATA_VELOCITY
-	"", // BPHYS_DATA_ROTATION
-	"", // BPHYS_DATA_AVELOCITY / BPHYS_DATA_XCONST */
-	"", // BPHYS_DATA_SIZE:
-	"", // BPHYS_DATA_TIMES:
-	"BoidData" // case BPHYS_DATA_BOIDS:
-};
-static const char *ptcache_extra_struct[] = {
-	"",
-	"ParticleSpring"
-};
-static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
-{
-	PointCache *cache = ptcaches->first;
-	int i;
-
-	for (; cache; cache=cache->next) {
-		writestruct(wd, DATA, "PointCache", 1, cache);
-
-		if ((cache->flag & PTCACHE_DISK_CACHE)==0) {
-			PTCacheMem *pm = cache->mem_cache.first;
-
-			for (; pm; pm=pm->next) {
-				PTCacheExtra *extra = pm->extradata.first;
-
-				writestruct(wd, DATA, "PTCacheMem", 1, pm);
-				
-				for (i=0; i<BPHYS_TOT_DATA; i++) {
-					if (pm->data[i] && pm->data_types & (1<<i)) {
-						if (ptcache_data_struct[i][0] == '\0')
-							writedata(wd, DATA, MEM_allocN_len(pm->data[i]), pm->data[i]);
-						else
-							writestruct(wd, DATA, ptcache_data_struct[i], pm->totpoint, pm->data[i]);
-					}
-				}
-
-				for (; extra; extra=extra->next) {
-					if (ptcache_extra_struct[extra->type][0] == '\0')
-						continue;
-					writestruct(wd, DATA, "PTCacheExtra", 1, extra);
-					writestruct(wd, DATA, ptcache_extra_struct[extra->type], extra->totdata, extra->data);
-				}
-			}
-		}
-	}
-}
-
 static void write_properties(WriteData *wd, ListBase *lb)
 {
 	bProperty *prop;
@@ -1417,7 +1366,6 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
 			writestruct(wd, DATA, "ClothSimSettings", 1, clmd->sim_parms);
 			writestruct(wd, DATA, "ClothCollSettings", 1, clmd->coll_parms);
 			writestruct(wd, DATA, "EffectorWeights", 1, clmd->sim_parms->effector_weights);
-			write_pointcaches(wd, &clmd->ptcaches);
 		}
 		else if (md->type==eModifierType_Smoke) {
 			SmokeModifierData *smd = (SmokeModifierData*) md;
@@ -1451,8 +1399,6 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
 					writestruct(wd, DATA, "DynamicPaintSurface", 1, surface);
 				/* write caches and effector weights */
 				for (surface=pmd->canvas->surfaces.first; surface; surface=surface->next) {
-					write_pointcaches(wd, &(surface->ptcaches));
-
 					writestruct(wd, DATA, "EffectorWeights", 1, surface->effector_weights);
 				}
 			}
@@ -1552,7 +1498,6 @@ static void write_objects(WriteData *wd, ListBase *idbase)
 			writestruct(wd, DATA, "PartDeflect", 1, ob->pd);
 			writestruct(wd, DATA, "SoftBody", 1, ob->soft);
 			if (ob->soft) {
-				write_pointcaches(wd, &ob->soft->ptcaches);
 				writestruct(wd, DATA, "EffectorWeights", 1, ob->soft->effector_weights);
 			}
 			writestruct(wd, DATA, "BulletSoftBody", 1, ob->bsoft);
@@ -2422,7 +2367,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
 		if (sce->rigidbody_world) {
 			writestruct(wd, DATA, "RigidBodyWorld", 1, sce->rigidbody_world);
 			writestruct(wd, DATA, "EffectorWeights", 1, sce->rigidbody_world->effector_weights);
-			write_pointcaches(wd, &(sce->rigidbody_world->ptcac

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list