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-04-10 11:52:18 +0300
committerBastien Montagne <bastien@blender.org>2020-04-10 11:52:18 +0300
commitda48a8ef506c3fc0778dba5c570bc44f975f9f21 (patch)
tree13954ce140346132507657d7db403a70aecdc35e /source/blender/blenkernel/intern/lib_id.c
parentd3cda49d143c455ae5c1093f3a5ce448c7de6ed3 (diff)
Fix T74815: Shapekeys animation is blocked after second append of the same object.
Logic to handle shepkeys datablocks in helper in 'make local' code that checks which ID should be copied, and which can be directly made local, was wrong.
Diffstat (limited to 'source/blender/blenkernel/intern/lib_id.c')
-rw-r--r--source/blender/blenkernel/intern/lib_id.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 487ec0bf161..9e4f1dda682 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -1720,21 +1720,31 @@ static void library_make_local_copying_check(ID *id,
/* Used_to_user stores ID pointer, not pointer to ID pointer. */
ID *par_id = (ID *)entry->id_pointer;
- /* Our oh-so-beloved 'from' pointers... */
+ /* Our oh-so-beloved 'from' pointers... Those should always be ignored here, since the actual
+ * relation we want to check is in the other way around. */
if (entry->usage_flag & IDWALK_CB_LOOPBACK) {
- /* We totally disregard Object->proxy_from 'usage' here,
- * this one would only generate fake positives. */
- if (GS(par_id->name) == ID_OB) {
- BLI_assert(((Object *)par_id)->proxy_from == (Object *)id);
- continue;
+#ifndef NDEBUG
+ /* Some debug checks to ensure we explicitely are aware of all 'loopback' cases, since those
+ * may not always be manageable in the same way... */
+ switch (GS(par_id->name)) {
+ case ID_OB:
+ BLI_assert(((Object *)par_id)->proxy_from == (Object *)id);
+ break;
+ case ID_KE:
+ BLI_assert(((Key *)par_id)->from == id);
+ break;
+ default:
+ BLI_assert(0);
}
+#endif
+ continue;
+ }
- /* Shapekeys are considered 'private' to their owner ID here, and never tagged
- * (since they cannot be linked), so we have to switch effective parent to their owner.
- */
- if (GS(par_id->name) == ID_KE) {
- par_id = ((Key *)par_id)->from;
- }
+ /* Shapekeys are considered 'private' to their owner ID here, and never tagged
+ * (since they cannot be linked), so we have to switch effective parent to their owner.
+ */
+ if (GS(par_id->name) == ID_KE) {
+ par_id = ((Key *)par_id)->from;
}
if (par_id->lib == NULL) {