From 9a80455d8774d6b189ae1ad7441646401b029ea5 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 5 Oct 2021 17:04:35 +0200 Subject: Fix missing proper 'make local' call for liboverrides from outliner. Also includes minor improvements to `BKE_lib_override_library_make_local` itself. This is a complement to rB37458798fa02c. --- source/blender/blenkernel/intern/lib_override.c | 10 ++++++++++ source/blender/editors/space_outliner/outliner_tools.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index fd78e72b9a7..1ba6acf52d0 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1321,6 +1321,16 @@ void BKE_lib_override_library_delete(Main *bmain, ID *id_root) */ void BKE_lib_override_library_make_local(ID *id) { + if (!ID_IS_OVERRIDE_LIBRARY(id)) { + return; + } + if (ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id)) { + /* We should never directly 'make local' virtual overrides (aka shape keys). */ + BLI_assert_unreachable(); + id->flag &= ~LIB_EMBEDDED_DATA_LIB_OVERRIDE; + return; + } + BKE_lib_override_library_free(&id->override_library, true); Key *shape_key = BKE_key_from_id(id); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index b20d6a4a43c..f16e6cbe6f4 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -757,7 +757,7 @@ static void id_local_fn(bContext *C, } } else if (ID_IS_OVERRIDE_LIBRARY_REAL(tselem->id)) { - BKE_lib_override_library_free(&tselem->id->override_library, true); + BKE_lib_override_library_make_local(tselem->id); } } -- cgit v1.2.3