Fix problem when updating or removing layout with non loaded objects

This commit is contained in:
Simone Barbieri 2022-12-15 12:51:43 +00:00
parent 6f2c16fc6d
commit c07bcb2b21

View file

@ -48,8 +48,14 @@ class BlendLayoutLoader(plugin.AssetLoader):
bpy.data.objects.remove(obj)
def _remove_asset_and_library(self, asset_group):
if not asset_group.get(AVALON_PROPERTY):
return
libpath = asset_group.get(AVALON_PROPERTY).get('libpath')
if not libpath:
return
# Check how many assets use the same library
count = 0
for obj in bpy.data.collections.get(AVALON_CONTAINERS).all_objects: