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:
authorBastien Montagne <bastien@blender.org>2020-08-27 17:50:01 +0300
committerBastien Montagne <bastien@blender.org>2020-08-28 15:53:22 +0300
commitdf8a63bb9c0a7090562e3f33c5da80d5dafa386d (patch)
tree22953a4bdce37c0cc0dbb0294d9651861ef328bf /source/blender/blenkernel/intern/lib_override.c
parent65dcf812a5e33285fb0726ca478210cf4e565a93 (diff)
Fix T80078: Overrides: Crash with animated IK control on linked armature.
Issue was with our dear posebones again... when applying overrides we keep the same address/pointer for the IDs themselves, (which avoids us the need to remap their usages), but their inner data is often re-allocated. Therefore, we need once again to go over armature objects and invalidate their posebone pointers. This should also be back-ported to Blender LTS 2.83. Maniphest Tasks: T80078 Differential Revision: https://developer.blender.org/D8734
Diffstat (limited to 'source/blender/blenkernel/intern/lib_override.c')
-rw-r--r--source/blender/blenkernel/intern/lib_override.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 6929d3a3c4b..6475535a22e 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -1475,6 +1475,20 @@ void BKE_lib_override_library_update(Main *bmain, ID *local)
/* XXX And crashing in complex cases (e.g. because depsgraph uses same data...). */
BKE_id_free_ex(bmain, tmp_id, LIB_ID_FREE_NO_UI_USER, true);
+ if (GS(local->name) == ID_AR) {
+ /* Funtime again, thanks to bone pointers in pose data of objects. We keep same ID addresses,
+ * but internal data has changed for sure, so we need to invalidate posebones caches. */
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ if (ob->pose != NULL && ob->data == local) {
+ BLI_assert(ob->type == OB_ARMATURE);
+ ob->pose->flag |= POSE_RECALC;
+ /* We need to clear pose bone pointers immediately, some code may access those before pose
+ * is actually recomputed, which can lead to segfault. */
+ BKE_pose_clear_pointers(ob->pose);
+ }
+ }
+ }
+
if (local->override_library->storage) {
/* We know this datablock is not used anywhere besides local->override->storage. */
/* XXX For until we get fully shadow copies, we still need to ensure storage releases