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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-16 02:49:03 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-16 02:55:17 +0300
commite760d37733e432a698f89388cf446a1f41701424 (patch)
treef5065b19f18a01486ae1b0554a2397f3c769e771 /source
parent6830adaaabbd7f33e7a90608bcfb6bfad1957ecc (diff)
Fix T62913: datablock append removing unrelated rigid body objects.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/library.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index c505188d421..efd1e35f207 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1968,20 +1968,27 @@ void BKE_library_make_local(
* relationship), se we tag it to be fully recomputed, but this does not seems to be enough in some cases,
* and evaluation code ends up trying to evaluate a not-yet-updated armature object's deformations.
* Try "make all local" in 04_01_H.lighting.blend from Agent327 without this, e.g. */
- /* Also, we use this object loop to handle rigid body resetting. */
for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
if (ob->data != NULL && ob->type == OB_ARMATURE && ob->pose != NULL && ob->pose->flag & POSE_RECALC) {
BKE_pose_rebuild(bmain, ob, ob->data, true);
}
+ }
+
+ /* Reset rigid body objects. */
+ for (LinkNode *it = copied_ids; it; it = it->next) {
+ ID *id = it->link;
+ if (GS(id->name) == ID_OB) {
+ Object *ob = (Object *)id;
- /* If there was ever any rigidbody settings in the object, we reset it. */
- if (ob->rigidbody_object) {
- for (Scene *scene_iter = bmain->scenes.first; scene_iter; scene_iter = scene_iter->id.next) {
- if (scene_iter->rigidbody_world) {
- BKE_rigidbody_remove_object(bmain, scene_iter, ob);
+ /* If there was ever any rigidbody settings in the object, we reset it. */
+ if (ob->rigidbody_object) {
+ for (Scene *scene_iter = bmain->scenes.first; scene_iter; scene_iter = scene_iter->id.next) {
+ if (scene_iter->rigidbody_world) {
+ BKE_rigidbody_remove_object(bmain, scene_iter, ob);
+ }
}
+ BKE_rigidbody_free_object(ob, NULL);
}
- BKE_rigidbody_free_object(ob, NULL);
}
}