Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 7eab716d805..0a31af032d3 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1554,18 +1554,18 @@ void BKE_rigidbody_remove_object(Main *bmain, Scene *scene, Object *ob, const bo
BKE_collection_object_add(bmain, scene->master_collection, ob);
}
BKE_collection_object_remove(bmain, rbw->group, ob, free_us);
+
+ /* flag cache as outdated */
+ BKE_rigidbody_cache_reset(rbw);
+ /* Reset cache as the object order probably changed after freeing the object. */
+ PTCacheID pid;
+ BKE_ptcache_id_from_rigidbody(&pid, NULL, rbw);
+ BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
}
/* remove object's settings */
BKE_rigidbody_free_object(ob, rbw);
- /* flag cache as outdated */
- BKE_rigidbody_cache_reset(rbw);
- /* Reset cache as the object order probably changed after freeing the object. */
- PTCacheID pid;
- BKE_ptcache_id_from_rigidbody(&pid, NULL, rbw);
- BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
-
/* Dependency graph update */
DEG_relations_tag_update(bmain);
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);