diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-07 15:52:39 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-07 16:07:51 +0300 |
commit | 514700b307ad4ea46cd1e238216363c93b9572a0 (patch) | |
tree | 9161e381a053d87257355bcc34d6e24bb8264718 /source | |
parent | 8443628e66e57f612a51384c985574d716ddee31 (diff) |
Fix (unreported) crash when remapping armatures.
Objects' Pose holds references to the armature bones, so we have to force POSE_RECALC in those cases...
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/library_remap.c | 18 |
1 files changed, 18 insertions, 0 deletions
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); } |