Remove library after loading

This commit is contained in:
Simone Barbieri 2023-06-15 16:50:51 +01:00
parent 1e3e63aaec
commit b0f42ae6cf

View file

@ -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,