From b0f42ae6cf5d690b8d0fbf1e93f72f933de45f0c Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Thu, 15 Jun 2023 16:50:51 +0100 Subject: [PATCH] Remove library after loading --- openpype/hosts/blender/plugins/load/load_blend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/blender/plugins/load/load_blend.py b/openpype/hosts/blender/plugins/load/load_blend.py index d35df366cf..83ce4ffd3e 100644 --- a/openpype/hosts/blender/plugins/load/load_blend.py +++ b/openpype/hosts/blender/plugins/load/load_blend.py @@ -33,7 +33,7 @@ class BlendLoader(plugin.AssetLoader): return None def _process_data(self, libpath, group_name): - # Append all the data from the .blend file + # Append all the data from the .blend file with bpy.data.libraries.load( libpath, link=False, relative=False ) as (data_from, data_to): @@ -89,6 +89,10 @@ class BlendLoader(plugin.AssetLoader): avalon_container.objects.link(container) + # Remove the library from the blend file + library = bpy.data.libraries.get(bpy.path.basename(libpath)) + bpy.data.libraries.remove(library) + container[AVALON_PROPERTY] = { "schema": "openpype:container-2.0", "id": AVALON_CONTAINER_ID,