From 514700b307ad4ea46cd1e238216363c93b9572a0 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 7 Jul 2016 14:52:39 +0200 Subject: Fix (unreported) crash when remapping armatures. Objects' Pose holds references to the armature bones, so we have to force POSE_RECALC in those cases... --- source/blender/blenkernel/intern/library_remap.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 81543fad0fe..a290c1c8cf5 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -354,6 +354,15 @@ void BKE_libblock_remap_locked( } } } + else if (GS(old_id->name) == ID_AR) { + /* Object's pose holds reference to armature bones... sic */ + for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + if (ob->data == old_id && ob->pose) { + BLI_assert(ob->type == OB_ARMATURE); + ob->pose->flag |= POSE_RECALC; + } + } + } libblock_remap_data(bmain, NULL, old_id, new_id, remap_flags, &id_remap_data); @@ -516,6 +525,15 @@ void BKE_libblock_relink_ex( BLI_assert(new_id == NULL); } + if (GS(id->name) == ID_OB) { + Object *ob = (Object *)id; + /* Object's pose holds reference to armature bones... sic */ + if (ob->data && ob->pose && (old_id == NULL || GS(old_id->name) == ID_AR)) { + BLI_assert(ob->type == OB_ARMATURE); + ob->pose->flag |= POSE_RECALC; + } + } + libblock_remap_data(NULL, id, old_id, new_id, remap_flags, NULL); } -- cgit v1.2.3