[Bf-blender-cvs] [3aa6de7] fracture_modifier: fix for: comparison with wrong rigidbody count caused deactivation of the cache and simulation was not cached any more

Martin Felke noreply at git.blender.org
Fri Oct 10 20:30:11 CEST 2014


Commit: 3aa6de7e43c82deebbbb24c7191c47a2b506d1f9
Author: Martin Felke
Date:   Fri Oct 10 20:30:00 2014 +0200
Branches: fracture_modifier
https://developer.blender.org/rB3aa6de7e43c82deebbbb24c7191c47a2b506d1f9

fix for: comparison with wrong rigidbody count caused deactivation of the cache and simulation was not cached any more

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

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

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 0109fe8..44b841d 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -2824,15 +2824,15 @@ void BKE_rigidbody_rebuild_world(Scene *scene, float ctime)
 	PointCache *cache;
 	PTCacheID pid;
 	int startframe, endframe;
-	int shards = 0, objects = 0, num = 0;
+	int shards = 0, objects = 0;
 
 	BKE_ptcache_id_from_rigidbody(&pid, NULL, rbw);
 	BKE_ptcache_id_time(&pid, scene, ctime, &startframe, &endframe, NULL);
 	cache = rbw->pointcache;
 
 	/* flag cache as outdated if we don't have a world or number of objects in the simulation has changed */
-	num = rigidbody_group_count_items(&rbw->group->gobject, &shards, &objects);
-	if (rbw->physics_world == NULL || rbw->numbodies != num) {
+	rigidbody_group_count_items(&rbw->group->gobject, &shards, &objects);
+	if (rbw->physics_world == NULL || rbw->numbodies != (shards + objects)) {
 		cache->flag |= PTCACHE_OUTDATED;
 	}




More information about the Bf-blender-cvs mailing list