[Bf-blender-cvs] [43d426b] fracture_modifier: fix: crasher when appending object with modifier and when trying to remove rigidbody traces when no rigidbody world is available

Martin Felke noreply at git.blender.org
Sat Feb 7 15:06:58 CET 2015


Commit: 43d426bb26577187e53a36a06aaa842e4e454f5b
Author: Martin Felke
Date:   Sat Feb 7 15:06:44 2015 +0100
Branches: fracture_modifier
https://developer.blender.org/rB43d426bb26577187e53a36a06aaa842e4e454f5b

fix: crasher when appending object with modifier and when trying to remove rigidbody traces when no rigidbody world is available

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

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

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 6e1acbc..2bc2ee6 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -2397,6 +2397,10 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob)
 		}
 	}
 
+	/* force removal of object settings even if world may be invalid e.g. after link/append */
+	if (!rbw && rbo)
+		BKE_rigidbody_free_object(ob);
+
 	/* flag cache as outdated */
 	BKE_rigidbody_cache_reset(rbw);
 }
@@ -3283,10 +3287,10 @@ static void restoreKinematic(RigidBodyWorld *rbw)
 
 void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw)
 {
-	if (rbw)
+	if (rbw) {
 		rbw->pointcache->flag |= PTCACHE_OUTDATED;
-
-	restoreKinematic(rbw);
+		restoreKinematic(rbw);
+	}
 }
 
 /* ------------------ */




More information about the Bf-blender-cvs mailing list