diff options
author | Jacques Lucke <jacques@blender.org> | 2020-04-14 12:59:47 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-04-14 12:59:47 +0300 |
commit | 6692ca602ca6f934ce00da4563434e870e954133 (patch) | |
tree | fe49d439d269f05109d7e29a7776776a9e2bc464 /source/blender/blenkernel/intern/lib_id.c | |
parent | dabd59ba23f877f68aaf73e79f0d58118723d9b7 (diff) | |
parent | b07e8a24f5c69578c5ccae31848bb0f51fd18700 (diff) |
Merge branch 'master' into functionsfunctions
Diffstat (limited to 'source/blender/blenkernel/intern/lib_id.c')
-rw-r--r-- | source/blender/blenkernel/intern/lib_id.c | 34 |
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..80f29a55b28 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 explicitly are aware of all 'loop-back' 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) { |