diff options
author | Bastien Montagne <bastien@blender.org> | 2020-08-28 16:09:42 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-08-28 16:09:42 +0300 |
commit | b4a608c11c8a5a5cd6b72e292e1075858ae6c828 (patch) | |
tree | 51fd18620669fa0684426994a436dd03699ea6d0 /source/blender | |
parent | 4fdd8452a6a714ceddd4a2c5105f64b9ccf7e265 (diff) | |
parent | df8a63bb9c0a7090562e3f33c5da80d5dafa386d (diff) |
Merge branch 'blender-v2.90-release' into master
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_remap.c | 12 |
2 files changed, 20 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index cca312270bc..e9244c5af73 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1685,6 +1685,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 diff --git a/source/blender/blenkernel/intern/lib_remap.c b/source/blender/blenkernel/intern/lib_remap.c index d4246056efe..c88513ec2af 100644 --- a/source/blender/blenkernel/intern/lib_remap.c +++ b/source/blender/blenkernel/intern/lib_remap.c @@ -244,17 +244,17 @@ static void libblock_remap_data_preprocess(IDRemap *r_id_remap_data) ID *old_id = r_id_remap_data->old_id; if (!old_id || GS(old_id->name) == ID_AR) { Object *ob = (Object *)r_id_remap_data->id_owner; - /* Object's pose holds reference to armature bones... sic */ - /* Note that in theory, we should have to bother about - * linked/non-linked/never-null/etc. flags/states. + /* Object's pose holds reference to armature bones. sic */ + /* Note that in theory, we should have to bother about linked/non-linked/never-null/etc. + * flags/states. * Fortunately, this is just a tag, so we can accept to 'over-tag' a bit for pose recalc, * and avoid another complex and risky condition nightmare like the one we have in - * foreach_libblock_remap_callback()... */ + * foreach_libblock_remap_callback(). */ if (ob->pose && (!old_id || ob->data == old_id)) { BLI_assert(ob->type == OB_ARMATURE); ob->pose->flag |= POSE_RECALC; - /* We need to clear pose bone pointers immediately, things like undo writefile may be - * called before pose is actually recomputed, can lead to segfault... */ + /* 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); } } |