[Bf-blender-cvs] [cbb5201f09b] blender-v2.83-release: Fix T80104: Crash on making material local.

Bastien Montagne noreply at git.blender.org
Wed Sep 2 15:05:10 CEST 2020


Commit: cbb5201f09bd88a5c7e58fe74ee4178fb2aec27f
Author: Bastien Montagne
Date:   Thu Aug 27 15:48:01 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBcbb5201f09bd88a5c7e58fe74ee4178fb2aec27f

Fix T80104: Crash on making material local.

Problem is again with the embedded data, we want to make those local
together with their owner ID, but sometimes we are actually dealing with
copies here, which are inheritently already local.

Code did not considered that possibility before, leading to access to a
NULL `lib` pointer.

This should also be back-ported to 2.83 LTS release.

Maniphest Tasks: T80104

Differential Revision: https://developer.blender.org/D8731

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

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

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

diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 18c72e2a324..fcdc28d3acd 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -396,8 +396,11 @@ static int lib_id_expand_local_cb(LibraryIDLinkCallbackData *cb_data)
   }
 
   if (cb_flag & IDWALK_CB_EMBEDDED) {
-    /* Embedded data-blocks need to be made fully local as well. */
-    if (*id_pointer != NULL) {
+    /* Embedded data-blocks need to be made fully local as well.
+     * Note however that in some cases (when owner ID had to be duplicated instead of being made
+     * local directly), its embedded IDs should also have already been duplicated, and hence be
+     * fully local here already. */
+    if (*id_pointer != NULL && ID_IS_LINKED(*id_pointer)) {
       BLI_assert(*id_pointer != id_self);
 
       lib_id_clear_library_data_ex(bmain, *id_pointer);



More information about the Bf-blender-cvs mailing list