[Bf-blender-cvs] [15762e96112] master: Fix T92430: Infinite recursion in some cases in new append code.

Bastien Montagne noreply at git.blender.org
Mon Oct 25 10:57:46 CEST 2021


Commit: 15762e961127fb8fbde1855311e01f99dfe5677e
Author: Bastien Montagne
Date:   Mon Oct 25 09:58:16 2021 +0200
Branches: master
https://developer.blender.org/rB15762e961127fb8fbde1855311e01f99dfe5677e

Fix T92430: Infinite recursion in some cases in new append code.

Shapekeys, always shapekeys... Since we cannot deal with them as regular
IDs, we need to handle potential recursion cases ourselves here. sigh.

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

M	source/blender/windowmanager/intern/wm_files_link.c

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

diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index c88e577df6a..97e610b797d 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -583,8 +583,13 @@ static int foreach_libblock_append_callback(LibraryIDLinkCallbackData *cb_data)
     /* While we do not want to add non-linkable ID (shape keys...) to the list of linked items,
      * unfortunately they can use fully linkable valid IDs too, like actions. Those need to be
      * processed, so we need to recursively deal with them here. */
-    BKE_library_foreach_ID_link(
-        cb_data->bmain, id, foreach_libblock_append_callback, data, IDWALK_NOP);
+    /* NOTE: Since we are by-passing checks in `BKE_library_foreach_ID_link` by manually calling it
+     * recursively, we need to take care of potential recursion cases ourselves (e.g.animdata of
+     * shapekey referencing the shapekey itself). */
+    if (id != cb_data->id_self) {
+      BKE_library_foreach_ID_link(
+          cb_data->bmain, id, foreach_libblock_append_callback, data, IDWALK_NOP);
+    }
     return IDWALK_RET_NOP;
   }



More information about the Bf-blender-cvs mailing list