[Bf-blender-cvs] [62528677bf5] master: Fix 'Make Local' operation to support liboverrides.

Bastien Montagne noreply at git.blender.org
Wed Oct 21 16:59:20 CEST 2020


Commit: 62528677bf5d1feadeb8a6020922de3b59e8cbb2
Author: Bastien Montagne
Date:   Wed Oct 21 16:58:06 2020 +0200
Branches: master
https://developer.blender.org/rB62528677bf5d1feadeb8a6020922de3b59e8cbb2

Fix 'Make Local' operation to support liboverrides.

One can now use 'make local' from the Outliner or the 3DView to also
fully localize overrides of linked data.

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

M	source/blender/blenkernel/intern/lib_id.c
M	source/blender/editors/space_outliner/outliner_tools.c

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

diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 27422440cd5..ae6ee71da82 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -1884,6 +1884,9 @@ void BKE_library_make_local(Main *bmain,
       if (id->lib == NULL) {
         id->tag &= ~(LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW);
         id->flag &= ~LIB_INDIRECT_WEAK_LINK;
+        if (ID_IS_OVERRIDE_LIBRARY_REAL(id)) {
+          BKE_lib_override_library_free(&id->override_library, true);
+        }
       }
       /* The check on the fourth line (LIB_TAG_PRE_EXISTING) is done so it's possible to tag data
        * you don't want to be made local, used for appending data,
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 3357b0b7346..cbdeb350ba4 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -730,6 +730,9 @@ static void id_local_fn(bContext *C,
       BKE_main_id_clear_newpoins(bmain);
     }
   }
+  else if (ID_IS_OVERRIDE_LIBRARY_REAL(tselem->id)) {
+    BKE_lib_override_library_free(&tselem->id->override_library, true);
+  }
 }
 
 static void object_proxy_to_override_convert_fn(bContext *C,



More information about the Bf-blender-cvs mailing list