[Bf-blender-cvs] [514f80b0c4f] master: Fix (unreported) broken logic in `BKE_libblock_relink_to_newid`

Bastien Montagne noreply at git.blender.org
Wed Jun 17 17:09:15 CEST 2020


Commit: 514f80b0c4f6375d1a01db1f2e32b495c23c17ca
Author: Bastien Montagne
Date:   Wed Jun 17 14:58:47 2020 +0200
Branches: master
https://developer.blender.org/rB514f80b0c4f6375d1a01db1f2e32b495c23c17ca

Fix (unreported) broken logic in `BKE_libblock_relink_to_newid`

Existing code would not follow as expected into new sub-IDs if they were
only encoutered once in usages by parent IDs...

===================================================================

M	source/blender/blenkernel/intern/lib_remap.c

===================================================================

diff --git a/source/blender/blenkernel/intern/lib_remap.c b/source/blender/blenkernel/intern/lib_remap.c
index ba986b1661b..d4246056efe 100644
--- a/source/blender/blenkernel/intern/lib_remap.c
+++ b/source/blender/blenkernel/intern/lib_remap.c
@@ -666,9 +666,10 @@ static int id_relink_to_newid_looper(LibraryIDLinkCallbackData *cb_data)
     /* See: NEW_ID macro */
     if (id->newid) {
       BKE_library_update_ID_link_user(id->newid, id, cb_flag);
-      *id_pointer = id->newid;
+      id = id->newid;
+      *id_pointer = id;
     }
-    else if (id->tag & LIB_TAG_NEW) {
+    if (id->tag & LIB_TAG_NEW) {
       id->tag &= ~LIB_TAG_NEW;
       BKE_libblock_relink_to_newid(id);
     }



More information about the Bf-blender-cvs mailing list